Re: Timer problems PIC18LF14K50
Posted: Sat Feb 10, 2024 1:28 pm
Hi
As mentioned I don't have the chip but I do have other PICs that offer the same functionality.
Using a PIC16F1939 in an BL0080 multiprogrammer (coz it was already in it) using an 8MHz clock, I set up a very basic chart with an LCD didplay and an interrupt on Timer 0 set to CLK0 with a prescale of 1:128 giving an interrupt of apprpox 60Hz.
The ISR would simply increment a counter (roughly 60 times per second). In Main loop if the counter reached 120 it would display a message before repeating.
No issues, did exactly as expected.
I then changed the chart to interrupt on TOCKI (rising edge) with prescaler set at 1:1 and with a Signal Generator set to a 4Vpp Square Wave with 50% duty connected to pin RA4 and set to 8MHz I got my interrupts as expected.
So whilst this doesn't exactly help you, it does confirm that the FC Timer 0 interrupt on TOCKI feaure does work.
It may mean an issue with that particular chip, or possibly connections / settings. Do you have a signal generator to test with?
Regards
As mentioned I don't have the chip but I do have other PICs that offer the same functionality.
Using a PIC16F1939 in an BL0080 multiprogrammer (coz it was already in it) using an 8MHz clock, I set up a very basic chart with an LCD didplay and an interrupt on Timer 0 set to CLK0 with a prescale of 1:128 giving an interrupt of apprpox 60Hz.
The ISR would simply increment a counter (roughly 60 times per second). In Main loop if the counter reached 120 it would display a message before repeating.
No issues, did exactly as expected.
I then changed the chart to interrupt on TOCKI (rising edge) with prescaler set at 1:1 and with a Signal Generator set to a 4Vpp Square Wave with 50% duty connected to pin RA4 and set to 8MHz I got my interrupts as expected.
So whilst this doesn't exactly help you, it does confirm that the FC Timer 0 interrupt on TOCKI feaure does work.
It may mean an issue with that particular chip, or possibly connections / settings. Do you have a signal generator to test with?
Regards