Page 1 of 1

Custom timer interrupts

Posted: Sun Jun 08, 2014 1:34 am
by outlawstc
I'm trying to set up some custom timers for controlling a TLC5940 16 channel pwm chip..
There isnt really any info at all on how to set it up.. i understand how to set up timers in normal C programming

Think is I really feel that the timer interrupt part of the program is under developed and could be made to work much more simpler for the user

like I don't understand why you only have prescaler values as the available interrupt timing and if you need a specific amount of time you have to revert to programming the specific registry's..

I'm trying to get the custom interrupt to call on a particular macro and it seems to not work.. since in the macro i call a simple high and low to a output pin and it doesn't occur ..

Any help would be great

Re: Custom timer interrupts

Posted: Sun Jun 08, 2014 1:52 am
by outlawstc
I also understand how I can count via interrupts from the prescale setup of timer interrupt but is that accurate? I will try that to see how accurate it is..

Re: Custom timer interrupts

Posted: Sun Jun 08, 2014 8:32 am
by medelec35
Hi outlawstc,
If you can post your flowchart and specify the required interrupt frequency, then I can help you further.
It would also help if you can state if using internal or external oscillator and what frequency it's running at.

The most common mistake when setting up a timer interrupt is not changing the clock source select from the default external to internal if applicable to the interrupt you're using.

Only issue is I'm only mainly use to PICs and not AVRs (if thet is what you're using) so I may not get the information totally correct.
Martin

Re: Custom timer interrupts

Posted: Sun Jun 08, 2014 5:11 pm
by outlawstc
Im using a AVR atmega328p in this project..
Im more familiar with programming the output compare registers which cause interrupt routines at the clock count desired..
I thought that doing a normal prescale interrupt provided by flowcode would cause innaccuracies with timing if you were to apply some calulation routines and if statements in the interrupt macro..
I was wrong about that and it does not add any significant delays..

So that works as desired..

I am gonna start a new topic and continue this in detail with the topic being on subject with what this is being applied to..

The new topic will be called "Flowcode applied to a TLC5940 16 channel 12 bit pwm "

Thanks for the response medelec35