Yahoo Groups archive

AVR-Chat

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

Thread

RE: [AVR-Chat] Re: Code stuck waiting for SPI transmission but only after power-up

RE: [AVR-Chat] Re: Code stuck waiting for SPI transmission but only after power-up

2010-03-13 by John Samperi

At 09:53 AM 13/03/2010, you wrote:
>4.5V It's complicated why :-)

No, it makes sense. So you have about 0.5V-0.7V headroom
which should be OK. Have you measured that it is 4.5V? ie
is the R1/R2 divider calculated correctly for 4.5V and do
you have the small cap there also?

I would not set the BOD at say, 4.3V but somewhat lower
depending on the chip used.

************************
ADDITION and of course make sure that the rest of the chips
are happy at 4.5V and don't have a minimum of 4.75V.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

RE: [AVR-Chat] Re: Code stuck waiting for SPI transmission but only after power-up

2010-03-13 by Cat C

It is near 4.5V, I don't think exact value matters.
Yes to small cap.
I tried all levels of BOD with no difference.

The other chips are varied in their power (voltage) requirements, I use level converters for some, but I don't see how that matters when the microcontroller is an SPI master and it gets stuck sending data (the flag never gets set or cleared, whichever is the case).

I'll have to leave it at that, use the watchdog workaround.

Thanks everybody for your help.

Cat

> To: AVR-Chat@yahoogroups.com
> From: samperi@ampertronics.com.au
> Date: Sat, 13 Mar 2010 12:09:41 +1100
> Subject: RE: [AVR-Chat] Re: Code stuck waiting for SPI transmission but  only after power-up
> 
> At 09:53 AM 13/03/2010, you wrote:
> >4.5V It's complicated why :-)
> 
> No, it makes sense. So you have about 0.5V-0.7V headroom
> which should be OK. Have you measured that it is 4.5V? ie
> is the R1/R2 divider calculated correctly for 4.5V and do
> you have the small cap there also?
> 
> I would not set the BOD at say, 4.3V but somewhat lower
> depending on the chip used.
> 
> ************************
> ADDITION and of course make sure that the rest of the chips
> are happy at 4.5V and don't have a minimum of 4.75V.
> 
> Regards
> 

 		 	   		  

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

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

2010-03-13 by Ken Holt

Since Cat has been so persistent in trying to find real causality,
it finally dawned on me that this might be the same as my
USART transmit SW (assumed) problem on my mega168.

 From the data book:
/* Wait for empty transmit buffer */
while ( !( UCSRnA & (1<<UDREn)) )

This has never worked for me, but I assumed that it was not
a HW problem, but a problem with me being a newbie at
properly compiling C, using Programmer's Notepad.
For my solution, I have just deleted the while, and put a
Delay1ms after the transmit buffer is loaded.
I think that the Usart and SPI are similar circuits internally.

Ken Holt




Cat C wrote:
Show quoted textHide quoted text
>
>
> It is near 4.5V, I don't think exact value matters.
> Yes to small cap.
> I tried all levels of BOD with no difference.
>
> The other chips are varied in their power (voltage) requirements, I 
> use level converters for some, but I don't see how that matters when 
> the microcontroller is an SPI master and it gets stuck sending data 
> (the flag never gets set or cleared, whichever is the case).
>
> I'll have to leave it at that, use the watchdog workaround.
>
> Thanks everybody for your help.
>
> Cat
>
> > To: AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com>
> > From: samperi@ampertronics.com.au <mailto:samperi%40ampertronics.com.au>
> > Date: Sat, 13 Mar 2010 12:09:41 +1100
> > Subject: RE: [AVR-Chat] Re: Code stuck waiting for SPI transmission 
> but only after power-up
> >
> > At 09:53 AM 13/03/2010, you wrote:
> > >4.5V It's complicated why :-)
> >
> > No, it makes sense. So you have about 0.5V-0.7V headroom
> > which should be OK. Have you measured that it is 4.5V? ie
> > is the R1/R2 divider calculated correctly for 4.5V and do
> > you have the small cap there also?
> >
> > I would not set the BOD at say, 4.3V but somewhat lower
> > depending on the chip used.
> >
> > ************************
> > ADDITION and of course make sure that the rest of the chips
> > are happy at 4.5V and don't have a minimum of 4.75V.
> >
> > Regards
> >
>
>
>
> [Non-text portions of this message have been removed]
>
>

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

2010-03-13 by John Samperi

At 05:27 AM 14/03/2010, you wrote:
>  From the data book:
>/* Wait for empty transmit buffer */
>while ( !( UCSRnA & (1<<UDREn)) )
>
>This has never worked for me,

What do you mean? Never compiled or you have problem
in transmitting?

If the 1st case then have you replaced the n with a number
for the USART used like 0, 1, 2 or 3?

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

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.