Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Code stuck waiting for SPI transmission but only after power-up. (ATMega644P)

2010-03-14 by Dennis Clark

The watchdog is a pretty extreme way to get out of a communications 
timeout loop.  Have you considered using a regular interrupt instead and 
clean up the SPI call in that?  In my mind the doggy is best used to 
recover from going into the weeds, not from a simple communications timeout.

DLC

On 3/14/10 10:11 AM, Cat C wrote:
> I kick the dog in the main loop, not the SPI loop, so that works fine when there are no problems.
> I WANT to get a reset if SPI doesn't work, so I DON'T want it to time out and exit.
>
>    
>> To: AVR-Chat@yahoogroups.com
>> From: bob.paddock@gmail.com
>> Date: Sun, 14 Mar 2010 09:59:04 -0400
>> Subject: Re: [AVR-Chat] Code stuck waiting for SPI transmission but only after 	power-up. (ATMega644P)
>>
>> On Sun, Mar 14, 2010 at 9:47 AM, erikc<firewevr@airmail.net>  wrote:
>>
>>      
>>>
>>>
>>> My understanding is that you have to feed the watchdog from time to
>>> time in various parts of the programme, and that would include
>>> software timer or stall loops as well.
>>>
>>>        
>> http://www.ganssle.com/watchdogs.htm
>>
>>      
>>> You could feed the watchdog from inside the counter loop. Then, you'd
>>> still get the timeout.
>>>        
>> Bad idea to feed watchdog from inside of loops.  Better to set a time out
>> that is long enough for the loop to complete,
>> then refresh the watchdog before entering the loop and right after exiting
>> the loop.  Look at the link above for better ideas.
>>
>> [Non-text portions of this message have been removed]
>>
>>      
>   		 	   		
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>    

-- 
Dennis Clark
TTT Enterprises

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.