Hi,
SEROUT is for serial RS232 communication. It's just used as an example in the LOOKUP section of the manual.
Code:
i VAR BYTE
Main:
For i = 0 to 9
LOOKUP i, [0, 6, 91, 79, 102, 109, 125, 7, 127, 103], GPIO
Pause 500
Next
Goto Main
See, when i is 0 the first value in the lookup table (0) will get written to GPIO, all bits will be reset, when i is 6 the seventh value (125) in the lookup table will get written to GPIO. 125 is the same as %01111101 which means all segments except the one driven by Bit1 will be on - the display will show "6".
Now, this would work on a PIC with seven or more consecutive GPIO pins, which apparently doesn't exist.... Getting a PIC with a "full" PortB and using that instead of GPIO would do it. It's still possible to do on the '684 (which has 6 bits on PortA and 6 bits on PortB, no GPIO) but then maby the Lookup aproach isn't the most suitable.
There are many many ways to skin the cat, sit down and play a bit with what you have, if you already have the BCD-Seven segment decoder go ahead and use that and play around.
/Henrik.
Bookmarks