BCD output

Graham Ogle

New Member
I am trying to control a frequency synthesiser. I need 4, 4 bit BCD outputs. I need pins 0-3 to be variable1, pins 4-7 variable2 etc. I'm just trying with 8 outputs on an 18X pic before going up to a 40x for 16 output lines. Can anyone give me any ideas please? I have found out about masking pins for inputs, but no mention of using the same technique for outputs.
Thanks in anticipation

 
 

pha555

Senior Member
PINS = variable2 * 16 + variable1

Note that variable2 is shifted to the upper nibble by multiplying by 16.

PH Anderson, http://www.phanderson.com/picaxe/picaxe.html
 
Top