It seems no timers work at all when configured in Flowcode for PIC18F25Q10. I've tried Timer 0, Timer 1 and Timer 2 with the same results.
There is nothing else in the code, just enabling any Timer causes the code not to compile. All other code on my program works fine at the moment.
When compiling the output shows:
Code: Select all
PIC2_PLAYER1_TEST.c: main()
91: T0CONbits.T0CS = 0;
^ (192) undefined identifier "T0CONbits"
^ (196) struct/union required
92: T0CONbits.T0SE = 0;
^ (196) struct/union required
93: T0CON = (T0CON & 0xF0) | 0x08;
^ (192) undefined identifier "T0CON"
95: INTCONbits.TMR0IE = 1;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S1339
PIC2_PLAYER1_TEST.c: myisr()
111: if ((INTCONbits.TMR0IF) && (INTCONbits.TMR0IE))
^ (255) not a member of the struct/union ""
(255) not a member of the struct/union "" ^
(199) logical type required ^
(199) logical type required ^
114: INTCONbits.TMR0IF = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S1339
(908) exit status = 1
(908) exit status = 1
- Three 8-Bit Timers (TMR2/4/6) with Hardware Limit Timer (HLT)
Four 16-Bit Timers (TMR0/1/3/5)
Code: Select all
Flowcode1.c: main()
90: T0CONbits.T0CS = 0;
^ (192) undefined identifier "T0CONbits"
^ (196) struct/union required
91: T0CONbits.T0SE = 1;
^ (196) struct/union required
92: T0CON = (T0CON & 0xF0) | 0x08;
^ (192) undefined identifier "T0CON"
(908) exit status = 1
(908) exit status = 1
I have checked the Data Sheet and it seems the register should be T0CON0 and not T0CON
The code generated by Flowcode is:
Code: Select all
cr_bit(T0CON, T0CS);
cr_bit(T0CON, T0SE);
T0CON = (T0CON & 0xF0) | 0x08;
st_bit(INTCON0, GIE);
st_bit(PIE3, TMR0IE);
Code: Select all
T0CON0 = 0x80;
I am no C programmer in any way (this is why I use Flowcode), but I feel there is a bug here with Flowcode not generating the correct code maybe?
Help would be appreciated as can't do much on my project without a Timer on both MCUs
Thanks in advance for your kind help!
R