Just had a similar problem this week (changed the power input to go through a schottkey, SPI comm started acting up). Lowering the brownout from 4.3 to 2.7 fixed it. Setting the fuse to let the clock settle longer is a good idea as well.
-Terrance
--- In AVR-Chat@yahoogroups.com, Cat C <catalin_cluj@...> wrote:
>
>
> Me again... :-)
>
> My code sends stuff over SPI, like this:
>
>
> SPDR = something;
> while(!(SPSR & (1<<SPIF))) //Wait for transmission complete
> { ; }
>
> I know I should have a counter and get out with an error, but... that's beside the point...
>
> This used to work fine, but at some point it started to get stuck on the "while" first time I power up the board.
> It works fine after a reset.
>
> Any ideas please?
>
> Thanks,
>
> Cat
>
>
> [Non-text portions of this message have been removed]
>Message
Re: Code stuck waiting for SPI transmission but only after power-up. (ATMega644P)
2010-03-12 by Terrance