views:

44

answers:

1

I've got some code that needs to run every 2 minutes which seems simple enough. The problem seems that triggering a long running process from within a timer causes the timers to go wobbly? any suggestions.

My C knowledge is not that great so help me out with some basic ideas. The MCU is an Atmel Mega128L

The long running process is an http call through a Telit GSM device (through UART1), this works great on its own but needs to be run out of the main loop as it needs to monitor other processes.

+2  A: 

I have been been told to set a flag within the interrupt and have those long-taking jobs done from the main routine, which checks for the flag perpetually, the task loop.

lImbus
problem is that the main loop is waiting for a uart char and won't run thru to check for the long running process. will try and implement this in any case. tx.
Jan de Jager
can't you get the "waiting for uart char" into another interrupt ?
lImbus
That's what i thought of last night, going to try it today. Thanks!
Jan de Jager