Timer not working

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

Moderators: Benj, Mods

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

Timer not working

Postby D.Bouchier » Tue Sep 28, 2010 1:16 pm

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 236 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8332
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2381 times
Been thanked: 3393 times
Contact:

Re: Timer not working

Postby medelec35 » Tue Sep 28, 2010 3:38 pm

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 251 times
These users thanked the author medelec35 for the post:
D.Bouchier (Fri Oct 22, 2010 6:31 am)
Rating: 5.56%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

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

Re: Timer not working

Postby D.Bouchier » Tue Oct 12, 2010 7:49 am

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