Hi All,
I wrote some code some years ago on an early version of PBP 3 for the P16F877A.
That computer is long gone but I still have the code and tried to compile it recently using PBP 3.0.10.4 and MicroCode Studio v5.0.0.5
So, this code was working and I still have a chip somewhere with this code actually running on it.
The error I get is "Redefinition of LABEL TMR0ON".
It is defined once in the program here:
;----[Aliases]------------------------------------------------------------------
Symbol T0CS = T0CON.5 ; Timer0 Clock Source Select bit 1 = external 0 = internal
Symbol T08BIT = T0CON.6 ; Timer0 8 / 16 bit flag 1 = 8 bit 0 = 16 bit
Symbol TMR0ON = T0CON.7 ; Timer0 Enable flag 1 = enable 0 = stop
Symbol PSA0 = T0CON.3 ; Prescaler Assignment bit 1 = On 0 = Off
symbol T0PS2 = T0CON.2
symbol T0PS1 = T0CON.1
symbol T0PS0 = T0CON.0
The first line of code which throws the error is " TMR0ON = 0 ; // Stop Timer1 "
e.g.
IF TMR0IF = 1 then ; // interrupt triggered by TMR0 overflow
TMR0ON = 0 ; // Stop Timer1
TMR0_last = TMR0
TMR0 = 0 ; // zero timer0
TMR0ON = 1 ; // Start Timer0
enable ; // enable GIE flag
resume ; // return from interrupt
TMR0ON is not defined anywhere else. It is not in P16F877A.INC or P16F877A.PBPINC.
You can rename all instances of TMR0ON to any other string & you still get the error.
Any advice ?
Thanks,
Wilson.
Bookmarks