Timer problems PIC18LF14K50

Any bugs you encounter with Flowcode should be discussed here.
chipfryer27
Valued Contributor
Posts: 1367
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 330 times
Been thanked: 475 times

Re: Timer problems PIC18LF14K50

Post by chipfryer27 »

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

electronick
Posts: 20
Joined: Tue Dec 08, 2020 3:10 pm
Has thanked: 8 times

Re: Timer problems PIC18LF14K50

Post by electronick »

Hi.

I have also used the T0CKI feature on other chips Both using C code and FC interrupt with success.
This chip doesn´t seem to be as easy as the other though and perhaps it has something to do with its limited program memory and RAM?
Because as soon as I add USB serial component to the chart all timers but Timer2 stops functioning, and >40% program memory, >55% Ram disappears.
I will give it a few more tries then use some other chip that I have previously used instead.

About the hardware, I have tested it by tying INT0(RC0), connected to RC5, and a 12Vp-p, 60kHz signal which produces a 3,3-0,05VDC square wave signal on RC0-RC5.
Signals were confirmed by oscilloscope.

Regards
Nick

Post Reply