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
Custom timer interrupts
Moderator: Benj
- outlawstc
- Posts: 32
- Joined: Tue Oct 15, 2013 6:14 pm
- Has thanked: 12 times
- Been thanked: 9 times
- Contact:
Custom timer interrupts
"If your having code problems I feel bad for you son... I got 99 problems but a glitch ain't one"
- outlawstc
- Posts: 32
- Joined: Tue Oct 15, 2013 6:14 pm
- Has thanked: 12 times
- Been thanked: 9 times
- Contact:
Re: Custom timer interrupts
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..
"If your having code problems I feel bad for you son... I got 99 problems but a glitch ain't one"
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Custom timer interrupts
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
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
Martin
- outlawstc
- Posts: 32
- Joined: Tue Oct 15, 2013 6:14 pm
- Has thanked: 12 times
- Been thanked: 9 times
- Contact:
Re: Custom timer interrupts
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
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
"If your having code problems I feel bad for you son... I got 99 problems but a glitch ain't one"