Posted: Mon Nov 07, 2011 12:52 am Post subject: AVR ATMega32 Timer 1 interrupts
Hello, this is my first post here and I have not actually used Bascom yet. One question that
I am not clear on is can you use Timer1 interrupt and have code 'inside' the interrupt routine.
I have done this using 'C' in that inside the Timer Overflow routine , I check the value of
a variable, if it is > 0, then I decrement the variable, reset the timer parameters and then
return from interrupt, nothing else inside the interrupt routine.
In the 'main' code section, I test to see what the value of that variable is and if it is '0'
the that causes some action in the main code and then resets the variable to the original
value.
This is a handy way to generate time slots, say based on a basic 10 milli second Timer1
overflow interrupt.
I am thinking that that could be handled different in using the Bascom compiler.
I am looking forward to using the Bascom compiler, it looks like there is great support for various libraries to support things like I2C (TWI) and was happy to see MODBUS support as well. I do play around with PLC's (Automation Direct) and that is the way to communicate
with that type of equipment using serial communications.
Thanks Dave, I will start digging into the documentation. I think I will install the demo version ans determine if this is the way for me to go.
Once again, thanks.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum