Timer not working

For MIAC users to discuss projects, applications, and any other issues related to the MIAC unit.

Moderators: Benj, Mods

Post Reply
D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time

Timer not working

Post by D.Bouchier »

Hello dear people,

I made a program in Flowcode with PWM and a timer to turn it on and off, this did not quite work in the simulation so i made a different program with just the timer because i know PWM also uses a timer so it might have caused problems, but even without the PWM it still acts strange, it does work in the simulation now but not on my MIAC.

Also looked at some examples but those didnt really make any sense for me when simulating them

Could anybody take a look at this and shed some light on my problem and/or give advice how to make it work?

thanks in advance
Attachments
test.fcf
(7 KiB) Downloaded 452 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Timer not working

Post by medelec35 »

Hello D.Bouchier.

The main issue is having a delay within your interrupt. This delay is occurs for a longer duration than the interrupt takes to fire which is a big no no.
Any delays or component macros which also have delays should not be used within timer interrupts. Also you have got your timer interrupt to trigger on external pin, and not via oscillator.
Try this.
Attachments
test modified.fcf
(13 KiB) Downloaded 442 times
Martin

D.Bouchier
Posts: 28
Joined: Tue Sep 28, 2010 12:36 pm
Has thanked: 5 times
Been thanked: 1 time

Re: Timer not working

Post by D.Bouchier »

Thank you for this insight, i have learned something from this.

Post Reply