PDA

View Full Version : how do I get a byte out of two 6 bit wide ports.



kitcat
- 28th February 2005, 14:03
Hi.
I am about to use a PIC16F688 which is a 14 pin package. Porta and Portc are only 6 bits wide. I want to count pulses on a pin (such as porta.0) and send the result to portc. Unfortunately the number is goign to end up at about 100 so I need a 7 bit wide port. I also want to use another pin to toggle to signify that a count has taken place (simply changing the state high or low on each count command).
So how do I combine two ports to write out a byte?

Thanks

mister_e
- 28th February 2005, 14:29
MyByte = 255

PORTC = Mybyte
PORTA.0 = MyByte.6
PORTA.1 = MyByte.7