
Originally Posted by
HankMcSpank
....does it add much in the way of delay? (ie if I was sequencing 8 leds fast would this start slowing stuff up)
VirtualPort will be faster than using lists of HIGH/LOW since it doesn't set the TRIS bits each and every time.
That in itself may be a problem when running at 32Mhz and the old R-M-W issue may come into play.
Let me know if it does and I'll change it to use the LAT registers on the 16F1's.
In a similar vein, can I group just two specific leds together for ease of handling? (I always will want two specific LEDS to light/extinguish together - but want to treat them as one entity vs having to duplicate the commands to each port/pin per LED)
The pin list macro can have multiple pins assigned to each bit.
In this example both RC6 and RB3 would turn on and off according to bit0 of the value passed to WritePort.
Code:
MyPortPins macro ; these define which bits go with which pins
Vpin 0, PORTC,6
Vpin 0, PORTB,3
Vpin 1, PORTB,6
Vpin 2, PORTB,5
Bookmarks