Hello,
I use a main loop to turn on and turn off LED1 every 1 second. Using a timer interrupt to call Macro LED2_Blink.
In the timer interrupt setting, I use 1:1024 Prescaler Rate to set the Interrupt Frequency to 61.035 HZ.
As I understand, in every 1 second the timer interrupt will active 61 times.
In the Macro LED2_Blink, I made a Variable :Count , to count the active times of timer interrupt, if the Count goes up to 61, I will turn on/turn off the Led 2. After that ,the Count will be set back to 0.
Than the 2 Leds should blink almost in same step, every 1 second turn on or turn off.
But in the simulation mode, the Led 2 is much fast than Led 1.
I have attached my program, could you please support me for this?
Thank you in advance!
Best regards,
Adam.
Timer Interrupt Prescaler Rate
-
- Posts: 9
- http://meble-kuchenne.info.pl
- Joined: Wed Jan 12, 2022 8:25 am
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: Timer Interrupt Prescaler Rate
Hi Adam,
Timings for interrupts in the simulation will not be accurate, mainly bacause they rely on Windows based timings which are not timing accurate. On the actual microcontroller the timing should be much more as expected.
Timings for interrupts in the simulation will not be accurate, mainly bacause they rely on Windows based timings which are not timing accurate. On the actual microcontroller the timing should be much more as expected.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 9
- Joined: Wed Jan 12, 2022 8:25 am
Re: Timer Interrupt Prescaler Rate
Hi Ben,
Thank you for your reply, I will test it in microcontroller.
BR
Adam
Thank you for your reply, I will test it in microcontroller.
BR
Adam