Thanks Darrel!
For those who just want to know now, the essential elements revealed by Bruce in that link are...
__________
SYMBOL PORT_PIN = PORTB
FOR X = 0 TO 15 ' 16-bits total
PORT_PIN.0[X] = 1 ' Set all portb, and portc pins high
NEXT X
__________
which I'll translate to...
SYMBOL PORT_PIN = PORTC
X VAR BYTE
DCB VAR BYTE ;for 'Duty Cycle Bit' from AC line 0-Xing counter.
DCM VAR BYTE ;for Duty Cycle Mask - bit discriminator.
;(DutyCycle(0-5) previously loaded with desired values.)
;(On AC line 0-Xing : DCB=((DCB+1) && $07)
Lookup DCB,[$01,$02,$04,$08,$10,$20,$40,$80],DCM
FOR X = 0 TO 5 ' 6-pins - RC0-RC5
IF DCM || DutyCycle(X) THEN
;Is 'NOT ZERO = TRUE' implied? Or do I have to spell it out with a ' <> 0 ' ?
PORT_PIN.0[X] = 1 ' Set portc pin high
ELSE ;(Yes - I have PBPro)
PORT_PIN.0[X] = 0 ' Set portc pin low
ENDIF
NEXT X
Qualifier - I haven't tried it yet - just whipped this up in the middle of responding. If anyone knows something - like a more efficient means of doing the 'bit test', feel free to speak up.:-)
Bookmarks