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-15 by Cat C

The watchdog does it's job, it just happens to be the convenient way to have a reset a little while after a power up, if the SPI doesn't work.
I don't see any other way of "cleaning" the SPI.
It's not a simple communication timeout, it's a complicated one, and if I have 1000 SPI calls, they will all fail until I do a reset.
If you're gonna propose a reset chip, or other circuitry to get a reset other ways, why?  This works fine.

> To: AVR-Chat@yahoogroups.com
> CC: catalin_cluj@hotmail.com
> From: dlc@frii.com
> Date: Sun, 14 Mar 2010 12:21:27 -0600
> Subject: Re: [AVR-Chat] Code stuck waiting for SPI transmission but only after 	power-up. (ATMega644P)
> 
> 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
> 
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
 		 	   		  

[Non-text portions of this message have been removed]

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.