Datasheet's with combined PICs drive me nuts, but in most cases I've seen so far it's usually just 2 PICs; this is the first time I've run across one which has 6 and only some have ECCP modules (I think the 16F690 has it, which may be why a search through the datasheet comes up with 'CCP1CON'.
I trimmed the code to test and left out the definition of BLINKYFREQ - even with it back in, though, it still doesn't compile (same reason).
For the 8 pins together, its because of this cool code from Darrel:
Code:
;----[Main Program Loop]----------------------------------------
Main:
' Check if flash mode has changed
IF FlashMode <> Old_FlashMode Then
Old_FlashMode = FlashMode
GOSUB SetNavLtsFlashRates
EndIF
x = (x + 1) // LEDcount
PORTB.1(x) = !!(LoopLED(x) < OnTime(x))
LoopLED(x) = (LoopLED(x) + 1) // (OnTime(x) + OffTime(x))
#IFDEF USE_RANDOM_SEQUENCE
IF x < 5 THEN
RandPeriod(x) = RandPeriod(x) - 1
IF RandPeriod(x) = 0 THEN
READ RandPeriods+(x<<1), WORD RandPeriod(x)
RANDOM RND
OnTime(x) = (MAX_ON - MIN_ON)* RND.HighByte / 255 + MIN_ON
OffTime(x)= (MAX_OFF - MIN_OFF)* RND.LowByte / 255 + MIN_OFF
ENDIF
ENDIF
#ENDIF
IF x != (LEDcount - 1) THEN Main
Waiting: IF !CCPIF THEN Waiting
CCPIF = 0
GOTO Main
In this example, it's offset by 1 since PORTB.0 is the INT pin which is being used to detect a button push.
Bookmarks