help problem in uart
2005-07-01 by aswinefy2003
Yahoo Groups archive
Index last updated: 2026-04-28 22:41 UTC
Thread
2005-07-01 by aswinefy2003
i have the following code written in iccavr
while(condition=true)
{
while(!(UCSRA&(1<<UDRE)));
UDR=data
//delay();
}
the problem is when i remove the delay()routine ,atmega32 is not
transmitting the correct data ,but any how transmitting some
garbage .Please help2005-07-01 by Lasse Madsen
Hi.
Your problem is most likely that the compiler optimizes the line
while(!(UCSRA&(1<<UDRE))); away.
Try this instead.
while(condition=true)
{
while(!(UCSRA&(1<<UDRE)))
{
#asm("nop"); // or how ever your compiler accesses assembly
inside C.
}
UDR=data
}
Regards
Lasse Madsen
_____ From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of aswinefy2003
Sent: 1. juli 2005 13:35
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] help problem in uart
i have the following code written in iccavr
while(condition=true)
{
while(!(UCSRA&(1<<UDRE)));
UDR=data
//delay();
}
the problem is when i remove the delay()routine ,atmega32 is not
transmitting the correct data ,but any how transmitting some
garbage .Please help
_____
YAHOO! GROUPS LINKS
* Visit your group "AVR-Chat <http://groups.yahoo.com/group/AVR-Chat>
" on the web.
* To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
<mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
_____2005-07-01 by arhodes19044
If the compiler optimizes it away, then it thinks that USCRA is not
volatile. So.... can you declare somehow that UCSRA is volatile?
However, I have never had the problem with references to hardware
registers being optimized away....
-Tony
--- In AVR-Chat@yahoogroups.com, "Lasse Madsen" <lasse.madsen@e...>
wrote:
> Hi.
>
>
>
> Your problem is most likely that the compiler optimizes the line
> while(!(UCSRA&(1<<UDRE))); away.
>
>
>
> Try this instead.
>
>
>
> while(condition=true)
> {
> while(!(UCSRA&(1<<UDRE)))
>
> {
>
> #asm("nop"); // or how ever your compiler accesses
assembly
> inside C.
>
> }
> UDR=data
> }
>
>
>
> Regards
>
>
>
> Lasse Madsen
>
>
>
>
>
>
>
> _____
>
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com]
On Behalf
> Of aswinefy2003
> Sent: 1. juli 2005 13:35
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] help problem in uart
>
>
>
> i have the following code written in iccavr
>
>
> while(condition=true)
> {
> while(!(UCSRA&(1<<UDRE)));
> UDR=data
> //delay();
> }
> the problem is when i remove the delay()routine ,atmega32 is not
> transmitting the correct data ,but any how transmitting some
> garbage .Please help
>
>
>
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AVR-Chat
<http://groups.yahoo.com/group/AVR-Chat>> " on the web. > > * To unsubscribe from this group, send an email to: > AVR-Chat-unsubscribe@yahoogroups.com > <mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe> > > * Your use of Yahoo! Groups is subject to the Yahoo! > <http://docs.yahoo.com/info/terms/> Terms of Service. > > > > _____
2005-07-01 by arhodes19044
Oh, wait.... I see. It gets optimized away because the while loop
does not do anything. Therefore the need to insert a nop.
-got it....
-Tony
--- In AVR-Chat@yahoogroups.com, "arhodes19044" <spamiam@c...> wrote:
> If the compiler optimizes it away, then it thinks that USCRA is
not
> volatile. So.... can you declare somehow that UCSRA is volatile?
>
> However, I have never had the problem with references to hardware
> registers being optimized away....
>
> -Tony
>
> --- In AVR-Chat@yahoogroups.com, "Lasse Madsen"
<lasse.madsen@e...>
> wrote:
> > Hi.
> >
> >
> >
> > Your problem is most likely that the compiler optimizes the line
> > while(!(UCSRA&(1<<UDRE))); away.
> >
> >
> >
> > Try this instead.
> >
> >
> >
> > while(condition=true)
> > {
> > while(!(UCSRA&(1<<UDRE)))
> >
> > {
> >
> > #asm("nop"); // or how ever your compiler
accesses
> assembly
> > inside C.
> >
> > }
> > UDR=data
> > }
> >
> >
> >
> > Regards
> >
> >
> >
> > Lasse Madsen
> >
> >
> >
> >
> >
> >
> >
> > _____
> >
> > From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com]
> On Behalf
> > Of aswinefy2003
> > Sent: 1. juli 2005 13:35
> > To: AVR-Chat@yahoogroups.com
> > Subject: [AVR-Chat] help problem in uart
> >
> >
> >
> > i have the following code written in iccavr
> >
> >
> > while(condition=true)
> > {
> > while(!(UCSRA&(1<<UDRE)));
> > UDR=data
> > //delay();
> > }
> > the problem is when i remove the delay()routine ,atmega32 is not
> > transmitting the correct data ,but any how transmitting some
> > garbage .Please help
> >
> >
> >
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit your group "AVR-Chat
> <http://groups.yahoo.com/group/AVR-Chat>
> > " on the web.
> >
> > * To unsubscribe from this group, send an email to:
> > AVR-Chat-unsubscribe@yahoogroups.com
> > <mailto:AVR-Chat-unsubscribe@yahoogroups.com?
subject=Unsubscribe> > > > > * Your use of Yahoo! Groups is subject to the Yahoo! > > <http://docs.yahoo.com/info/terms/> Terms of Service. > > > > > > > > _____
2005-07-01 by Lasse Madsen
IAR's compiler also does this on the same line . so I think it has nothing to do with hardware references but simply that it's a while without "content" Regars lasse _____
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of arhodes19044
Sent: 1. juli 2005 21:27
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] Re: help problem in uart
Oh, wait.... I see. It gets optimized away because the while loop
does not do anything. Therefore the need to insert a nop.
-got it....
-Tony
--- In AVR-Chat@yahoogroups.com, "arhodes19044" <spamiam@c...> wrote:
> If the compiler optimizes it away, then it thinks that USCRA is
not
> volatile. So.... can you declare somehow that UCSRA is volatile?
>
> However, I have never had the problem with references to hardware
> registers being optimized away....
>
> -Tony
>
> --- In AVR-Chat@yahoogroups.com, "Lasse Madsen"
<lasse.madsen@e...>
> wrote:
> > Hi.
> >
> >
> >
> > Your problem is most likely that the compiler optimizes the line
> > while(!(UCSRA&(1<<UDRE))); away.
> >
> >
> >
> > Try this instead.
> >
> >
> >
> > while(condition=true)
> > {
> > while(!(UCSRA&(1<<UDRE)))
> >
> > {
> >
> > #asm("nop"); // or how ever your compiler
accesses
> assembly
> > inside C.
> >
> > }
> > UDR=data
> > }
> >
> >
> >
> > Regards
> >
> >
> >
> > Lasse Madsen
> >
> >
> >
> >
> >
> >
> >
> > _____
> >
> > From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com]
> On Behalf
> > Of aswinefy2003
> > Sent: 1. juli 2005 13:35
> > To: AVR-Chat@yahoogroups.com
> > Subject: [AVR-Chat] help problem in uart
> >
> >
> >
> > i have the following code written in iccavr
> >
> >
> > while(condition=true)
> > {
> > while(!(UCSRA&(1<<UDRE)));
> > UDR=data
> > //delay();
> > }
> > the problem is when i remove the delay()routine ,atmega32 is not
> > transmitting the correct data ,but any how transmitting some
> > garbage .Please help
> >
> >
> >
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit your group "AVR-Chat
> <http://groups.yahoo.com/group/AVR-Chat>
> > " on the web.
> >
> > * To unsubscribe from this group, send an email to:
> > AVR-Chat-unsubscribe@yahoogroups.com
> > <mailto:AVR-Chat-unsubscribe@yahoogroups.com?
subject=Unsubscribe>
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo!
> > <http://docs.yahoo.com/info/terms/> Terms of Service.
> >
> >
> >
> > _____
_____
YAHOO! GROUPS LINKS
* Visit your group "AVR-Chat <http://groups.yahoo.com/group/AVR-Chat>
" on the web.
* To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
<mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
_____2005-07-01 by Robert Adsett
At 10:34 PM 7/1/05 +0200, Lasse Madsen wrote: >IAR s compiler also does this on the same line & so I think it has nothing >to do with hardware references but simply that it s a while without content > >---------- >From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf >Of arhodes19044 >Oh, wait.... I see. It gets optimized away because the while loop >does not do anything. Therefore the need to insert a nop. > >-got it.... > >-Tony > >--- In AVR-Chat@yahoogroups.com, "arhodes19044" <spamiam@c...> wrote: > > If the compiler optimizes it away, then it thinks that USCRA is >not > > volatile. So.... can you declare somehow that UCSRA is volatile? > > > > However, I have never had the problem with references to hardware > > registers being optimized away.... > > > > -Tony > > > > --- In AVR-Chat@yahoogroups.com, "Lasse Madsen" ><lasse.madsen@e...> > > wrote: > > > Hi. > > > > > > Your problem is most likely that the compiler optimizes the line > > > while(!(UCSRA&(1<<UDRE))); away. > > > Hmm, I'd consider that a compiler bug. Whether the loop is empty or not if the expression contains volatile references it and by extension the while expression should not be optimized away. Robert " 'Freedom' has no meaning of itself. There are always restrictions, be they legal, genetic, or physical. If you don't believe me, try to chew a radio signal. " -- Kelvin Throop, III http://www.aeolusdevelopment.com/
2005-07-02 by wbounce
I know you go other responses but garbage on the uart could also mean wrong baud or corrupt fuse settings.
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
Behalf Of aswinefy2003
Sent: Friday, July 01, 2005 7:35 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] help problem in uart
i have the following code written in iccavr
while(condition=true)
{
while(!(UCSRA&(1<<UDRE)));
UDR=data
//delay();
}
the problem is when i remove the delay()routine ,atmega32 is not
transmitting the correct data ,but any how transmitting some
garbage .Please help
Yahoo! Groups Links2005-07-03 by Pigeon
2005-07-03 by John Samperi
At 12:57 PM 3/07/2005, you wrote:
>I would like something very accurate (so I can just keep using the same
>setup over and over..)
>
If you don't use the internal oscillator and there is not lots of boards
involved,
then use a crystal for best results. Resonators are good if you are trying
to save a few
cents a board. I use the HC49-HS types (low profile).
Regards
John Samperi
******************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Email: samperi@ampertronics.com.au
Website http://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
******************************************************2005-07-03 by Pigeon
----- Original Message -----From: John SamperiSent: Saturday, July 02, 2005 11:12 PMSubject: Re: [AVR-Chat] What crystals/resonators do you'll use?At 12:57 PM 3/07/2005, you wrote:
>I would like something very accurate (so I can just keep using the same
>setup over and over..)
>
If you don't use the internal oscillator and there is not lots of boards
involved,
then use a crystal for best results. Resonators are good if you are trying
to save a few
cents a board. I use the HC49-HS types (low profile).
Regards
John Samperi
******************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Email: samperi@ampertronics.com.au
Website http://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
******************************************************
SPONSORED LINKSAtmel avr Microcontrollers Intel microprocessors Pic microcontrollers
2005-07-03 by John Samperi
At 01:55 PM 3/07/2005, you wrote:
>So HC49 is the package/case type?
>
>I didn't see any hc49-hs on digikey.. just hc49 hc49/51 hc49/UA hc49/us
Must be the hc49/us. They are shown on the sparkfun website. They
are the mid sized ones.
>Also, would I need any caps with this?
I use 2x15pf caps only because I have lots of them.
The more suitable may be 18-22pf.
Regards
John Samperi
******************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Email: samperi@ampertronics.com.au
Website http://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
******************************************************2005-07-03 by Dave Mucha
I am doing a tach project and timing is important. As I understand, resonators are lower accuracy than crystals, and many resonators have internal caps. Easier to install, and often not very important. I have wondered just how important the associated capacitors are for accuracy? But for the tach, timing becomes much more important. As I understand, there are two ways to go. count till you hit a number, then check how long it took. or to select a time period and count how many pulses occured in that window. If I'm missing something, please let me know. If anyone has anything that might help, I'd be glad to find out. So, the questions comes down to component selection. For a tachometer with a rate up to 35khz, what would be a good choice ? Dave
2005-07-03 by Dave VanHorn
> >I have wondered just how important the associated capacitors are for accuracy? Bing, pet peeve button pressed.. :) http://www.dvanhorn.org/Micros/All/Crystals.php
2005-07-03 by Ralph Hilton
On Sun, 03 Jul 2005 13:58:41 -0000 you wrote: >I am doing a tach project and timing is important. > >As I understand, resonators are lower accuracy than crystals, and many >resonators have internal caps. Easier to install, and often not very >important. > >I have wondered just how important the associated capacitors are for >accuracy? > >But for the tach, timing becomes much more important. > >As I understand, there are two ways to go. > >count till you hit a number, then check how long it took. or to select >a time period and count how many pulses occured in that window. > >If I'm missing something, please let me know. > >If anyone has anything that might help, I'd be glad to find out. > >So, the questions comes down to component selection. For a tachometer >with a rate up to 35khz, what would be a good choice ? At 35,000Hz a crystal would give an error of only a couple of Hz. A resonator could be off by around 200Hz. It depends on your requirement. -- Ralph Hilton http://www.ralphhilton.org C-Meter: http://www.cmeter.org FZAOINT http://www.fzaoint.net
2005-07-03 by Don Jackson
Dave VanHorn wrote: >>I have wondered just how important the associated capacitors are for accuracy? > > > Bing, pet peeve button pressed.. :) > http://www.dvanhorn.org/Micros/All/Crystals.php Hi Dave! I've read your web page(s) and like your discussion not only on xtals but also bypassing. Interesting. And if anyone reading this wants to know a little about bar-decoding, Dave's website is a good resource. I have a project where I need to be able to adjust the crystal frequency to a specific "exact" value. I haven't breadboarded it yet, but do you have any experience or advice along this line? My thought was to just make one of the crystal caps variable (make any difference which one?). For example, using a 10 MHz xtal, I wish to be able to zero beat WWV. (Long term stability not too important, so it would not be ovenized or otherwise temp-compensated.) I'm not too sure how close the cheap microcontroller crystals are to their specified frequency either -- imagine that would depend on manufacturer, lot, etc. In my application some selection would be acceptable rather than go to closer tolerance xtals. Other than parts count and cost, do you see any downside to using the microcontroller's oscillator in this manner versus using a separate crystal oscillator (with transistor) driving the microcontroller? Don
2005-07-03 by Dave VanHorn
> >I have a project where I need to be able to adjust the crystal frequency >to a specific "exact" value. I haven't breadboarded it yet, but do you >have any experience or advice along this line? My thought was to just >make one of the crystal caps variable (make any difference which one?). > For example, using a 10 MHz xtal, I wish to be able to zero beat WWV. >(Long term stability not too important, so it would not be ovenized or >otherwise temp-compensated.) I would think you could do this with a trimcap, maybe half the nominal C value, across a fixed cap to make up the rest of the value. I'd try the input side first, the driven side should mostly be about phase shift. You could even use a Varactor diode, and feed it with a DAC, if that's interesting. >I'm not too sure how close the cheap microcontroller crystals are to >their specified frequency either -- imagine that would depend on >manufacturer, lot, etc. In my application some selection would be >acceptable rather than go to closer tolerance xtals. They are spec'd to a given PPM over temperature >Other than parts count and cost, do you see any downside to using the >microcontroller's oscillator in this manner versus using a separate >crystal oscillator (with transistor) driving the microcontroller? I'd be wary of using the on-chip circuit for this application. It's likely to have a lot of noise on it's supply, and would probably be pretty broad. uP crystals aren't too interested in stability in the <1S timeframe.
2005-07-04 by Pigeon
----- Original Message -----From: John SamperiSent: Sunday, July 03, 2005 3:43 AMSubject: Re: [AVR-Chat] What crystals/resonators do you'll use?At 01:55 PM 3/07/2005, you wrote:
>So HC49 is the package/case type?
>
>I didn't see any hc49-hs on digikey.. just hc49 hc49/51 hc49/UA hc49/us
Must be the hc49/us. They are shown on the sparkfun website. They
are the mid sized ones.
>Also, would I need any caps with this?
I use 2x15pf caps only because I have lots of them.
The more suitable may be 18-22pf.
Regards
John Samperi
******************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495 Fax (02) 9674-8745
Email: samperi@ampertronics.com.au
Website http://www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
******************************************************
2005-07-04 by Dave VanHorn
Sounds good.
Just to double check (because I am about to make an order from digkey) (and my last order.. I had some wrongly ordered parts)
For the Caps, I would use:
http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=328204&Row=415594&Site=US
2005-07-04 by Pigeon
----- Original Message -----From: Dave VanHornSent: Sunday, July 03, 2005 11:55 PMSubject: Re: [AVR-Chat] What crystals/resonators do you'll use?At 10:03 PM 7/3/2005, Pigeon wrote:
Sounds good.
Just to double check (because I am about to make an order from digkey) (and my last order.. I had some wrongly ordered parts)
For the Caps, I would use:
http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=328204&Row=415594&Site=US
Ah grasshopper, you have missed the calculation of the cap values.
C = 2CL - Cstray
C = (2*18)-6 Guessing at 5-6pF or thereabouts
C = 30pF
The reason for this, in short, is that from the crystal's point of view, the caps are in series.
2005-07-04 by aswinefy2003
Even after trying the code mentioned the problem is not rectified
Please suggest some reason
--- In AVR-Chat@yahoogroups.com, "arhodes19044" <spamiam@c...> wrote:
> If the compiler optimizes it away, then it thinks that USCRA is not
> volatile. So.... can you declare somehow that UCSRA is volatile?
>
> However, I have never had the problem with references to hardware
> registers being optimized away....
>
> -Tony
>
> --- In AVR-Chat@yahoogroups.com, "Lasse Madsen" <lasse.madsen@e...>
> wrote:
> > Hi.
> >
> >
> >
> > Your problem is most likely that the compiler optimizes the line
> > while(!(UCSRA&(1<<UDRE))); away.
> >
> >
> >
> > Try this instead.
> >
> >
> >
> > while(condition=true)
> > {
> > while(!(UCSRA&(1<<UDRE)))
> >
> > {
> >
> > #asm("nop"); // or how ever your compiler
accesses > assembly
> > inside C.
> >
> > }
> > UDR=data
> > }
> >
> >
> >
> > Regards
> >
> >
> >
> > Lasse Madsen
> >
> >
> >
> >
> >
> >
> >
> > _____
> >
> > From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com]
> On Behalf
> > Of aswinefy2003
> > Sent: 1. juli 2005 13:35
> > To: AVR-Chat@yahoogroups.com
> > Subject: [AVR-Chat] help problem in uart
> >
> >
> >
> > i have the following code written in iccavr
> >
> >
> > while(condition=true)
> > {
> > while(!(UCSRA&(1<<UDRE)));
> > UDR=data
> > //delay();
> > }
> > the problem is when i remove the delay()routine ,atmega32 is not
> > transmitting the correct data ,but any how transmitting some
> > garbage .Please help
> >
> >
> >
> >
> >
> > _____
> >
> > YAHOO! GROUPS LINKS
> >
> >
> >
> > * Visit your group "AVR-Chat
> <http://groups.yahoo.com/group/AVR-Chat>
> > " on the web.
> >
> > * To unsubscribe from this group, send an email to:
> > AVR-Chat-unsubscribe@yahoogroups.com
> > <mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo!
> > <http://docs.yahoo.com/info/terms/> Terms of Service.
> >
> >
> >
> > _____2005-07-04 by Kathy Quinlan
Pigeon wrote: > Thanks for the reply! > > I cannot find any 30pF for breadboarding.. > > I found 27pF: > http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338257&Row=256525&Site=US > <http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338257&Row=256525&Site=US> > > and they carry 33pF: > http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338569&Row=256670&Site=US > <http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338569&Row=256670&Site=US> > > > What would be a better option? (So I assume all the crystals in my > previous email would work with the same caps..) > > > thanks > Lee I use 33pf personally. Regards, Kat.
2005-07-04 by Dave VanHorn
Thanks for the reply!
I cannot find any 30pF for breadboarding..
I found 27pF:
http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338257&Row=256525&Site=US
and they carry 33pF:
http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338569&Row=256670&Site=US
What would be a better option? (So I assume all the crystals in my previous email would work with the same caps..)
2005-07-04 by Paul Maddox
Just my tuppence, I use Crystal Oscillator Modules, I find them more stable and reliable than a crystal with caps. Plus they usually have enough 'umph' to drive multiple AVRs.. Paul
2005-07-04 by Dave VanHorn
At 09:49 AM 7/4/2005, Paul Maddox wrote: >Just my tuppence, > >I use Crystal Oscillator Modules, I find them more stable and reliable than >a crystal with caps. >Plus they usually have enough 'umph' to drive multiple AVRs.. I don't, because of space, cost, and potential EMI problems. Plus, I just don't see the need. There's nothing in the can other than a simple two-transistor oscillator, and now you have to assure a low impedance and direct ground connection from this can, to everything it feeds. Driving multiple chips is one advantage though.
2005-07-04 by Paul Maddox
Dave, > I don't, because of space, doesn't take up much more than a crystal and two caps. > cost, yep, they are more. > and potential EMI problems. Huh? i would've thought the output of tehse would've cleaner and better defined that a crystal with caps. > Plus, I just don't see the need. There's nothing in the can other > than a simple two-transistor oscillator, and now you have to assure a > low impedance and direct ground connection from this can, to > everything it feeds. Unlike having to ensure a good screen around the crystal when it comes to laying out a PCB? > Driving multiple chips is one advantage though. yep, I used it on one board to drive 6 AVRs, very handy.. In fairness, both have advatnages/disadvantages.. Paul
2005-07-04 by Dave VanHorn
At 10:30 AM 7/4/2005, Paul Maddox wrote: >Dave, > > > I don't, because of space, > >doesn't take up much more than a crystal and two caps. The smallest I've seen are square, about 400 mils >Huh? >i would've thought the output of tehse would've cleaner and better defined >that a crystal with caps. They are capable or relatively high output current, and that alone makes for more EMI. The more the output departs from a sine wave, the more odd harmonic content you have to contend with. Plus you have their power feed to consider. To limit EMI, a resistor in the feed to each device is a good idea, and now you have to think about multiple feeds with resistors, or a single feed with taps, and what do you do about the reflection off the end of that feed? Even at 10-20 MHz, you're doing RF design now, and you have to think in those terms. Finally, you need a low Z path between the ground of the module, and whatever it feeds, so that the return current has a definite path. Individual crystals, for six clients, is certainly more board area than an oscillator, but you don't have all the distribution issues to contend with, nor the track space. >Unlike having to ensure a good screen around the crystal when it >comes to laying out a PCB? I don't actually do that much in that regard. I take the caps back to the uP ground by a discrete track, and I take the crystal leads back to the uP in parallel. I have done small discrete ground zones, but I haven't seen much advantage from it. I don't run other signals through that area though. > > Driving multiple chips is one advantage though. > >yep, I used it on one board to drive 6 AVRs, very handy.. > >In fairness, both have advatnages/disadvantages.. Engineering is the art of compromise :)
2005-07-04 by Pigeon
----- Original Message -----From: Dave VanHornSent: Monday, July 04, 2005 10:35 AMSubject: Re: [AVR-Chat] What crystals/resonators do you'll use?At 11:57 PM 7/3/2005, Pigeon wrote:
Thanks for the reply!
I cannot find any 30pF for breadboarding..
I found 27pF:
http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338257&Row=256525&Site=US
and they carry 33pF:
http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=338569&Row=256670&Site=US
Order both, and see which gets you closer. Remember, the 6pF number was just a guess.
What would be a better option? (So I assume all the crystals in my previous email would work with the same caps..)
I didn't check through them, but if they all say 18pF, then yes.
2005-07-04 by Dave VanHorn
Yes, all the crystals said 18pF (I take it, that that is all Ineed to know to know what caps I need?)
Also.. I have no scope. How will I see what ones are closer?
2005-07-04 by Pigeon
----- Original Message -----From: Dave VanHornSent: Monday, July 04, 2005 5:13 PMSubject: Re: [AVR-Chat] What crystals/resonators do you'll use?At 04:08 PM 7/4/2005, Pigeon wrote:
Yes, all the crystals said 18pF (I take it, that that is all Ineed to know to know what caps I need?)
Also.. I have no scope. How will I see what ones are closer?
Do you have a shortwave radio with BFO?
A frequency counter?
Other than that, you'll have to rely on a carefully constructed software loop that executes a known number of cycles, or a timer routine that divides down the crystal, either way, you then toggle an output pin at some reasonable rate, like once a second, and then count the results over a long time.
You adjust your debugging tools to what you have on hand, or what you can easily get.
2005-07-04 by Dave VanHorn
Hmm. I have none of that extra hardware..
I will go with the 33pF like Kathy.
Even if the 27pF was perfect'', this would still be a better solution that going with ceramic resonators?
Oh yeah, I was thinking about going with something like an Crystal Oscillator Modules.. but I couldn't find these on digikey.. How much do these normally run and where can I get a dip ver?
2005-07-04 by Pigeon
----- Original Message -----From: Dave VanHornSent: Monday, July 04, 2005 5:37 PMSubject: Re: [AVR-Chat] What crystals/resonators do you'll use?At 04:27 PM 7/4/2005, Pigeon wrote:
Hmm. I have none of that extra hardware..
I will go with the 33pF like Kathy.
Even if the 27pF was perfect'', this would still be a better solution that going with ceramic resonators?
"better" is hard to define. Resonators are less accurate. If you don't need this much accuracy, then you're wasting money.
Oh yeah, I was thinking about going with something like an Crystal Oscillator Modules.. but I couldn't find these on digikey.. How much do these normally run and where can I get a dip ver?
Looks like $1.50 and up
http://www.digikey.com/scripts/DkSearch/dksus.dll?Criteria?Ref=81296&Site=US&Cat=31064989
2005-07-04 by Kathy Quinlan
Pigeon wrote: > Hmm.. because I would rather have something super simple.. and high > quality, I like the idea of the > crystal clock oscillator > http://rocky.digikey.com/WebLib/Epson/Web%20Data/SG-51,531%20Series.pdf > > but my question is. > I see > pin1: 0E > pin7: GND > pin8: OUT > pin14: Vdd > > but what pins go to what? (do I need any external caps/resistors) > > I have seen a schematic that had xtal 1 go to the crystal clock > oscillator.. then xtal2 go to another avr's xtal 1.. but that isn't what > i want. > > I guess the pdf of this schematic expects an expert to be reading it :/ > > > what do you'll think? > > Lee The ones I use (from Radio Spares in Au (only as I needed 2 and they deliver ;)) Pin 1 is No Connection Pin 7 is Ground Pin 8 is Output Pin 14 is Vcc Not all the modules have the inverted output, some even have just a buffer so that it can drive 2 loads. All you need for most apps is Pins 7,8,14 and leave pin 1 open circuit. The only special attention I give them is a 10uF electro and a 0.1uF mono caps as close as possible (the mono is usually on the bottom as I do mainly SMD these days. In most products I design I have 2 versions, 1 uses a crystal, and the other the internal oscillator. but unless it is a package that can have its crystal pins used as IO, then I tend to wack a crystal in with the two caps (it only adds au$1 to the product cost) and I am not making 100's of these, most runs are bellow 20. Regards, Kat.
2005-07-04 by Dave VanHorn
Hmm.. because I would rather have something super simple.. and high quality, I like the idea of the
crystal clock oscillator
http://rocky.digikey.com/WebLib/Epson/Web%20Data/SG-51,531%20Series.pdf
but my question is.
I see
pin1: 0E
pin7: GND
pin8: OUT
pin14: Vdd
but what pins go to what? (do I need any external caps/resistors)
I have seen a schematic that had xtal 1 go to the crystal clock oscillator.. then xtal2 go to another avr's xtal 1.. but that isn't what i want.
I guess the pdf of this schematic expects an expert to be reading it :/
2005-07-04 by Pigeon
----- Original Message -----From: Kathy QuinlanSent: Monday, July 04, 2005 7:02 PMSubject: Re: [AVR-Chat] What crystals/resonators do you'll use?Pigeon wrote:
> Hmm.. because I would rather have something super simple.. and high
> quality, I like the idea of the
> crystal clock oscillator
> http://rocky.digikey.com/WebLib/Epson/Web%20Data/SG-51,531%20Series.pdf
>
> but my question is.
> I see
> pin1: 0E
> pin7: GND
> pin8: OUT
> pin14: Vdd
>
> but what pins go to what? (do I need any external caps/resistors)
>
>; I have seen a schematic that had xtal 1 go to the crystal clock
> oscillator.. then xtal2 go to another avr's xtal 1.. but that isn't what
> i want.
>
> I guess the pdf of this schematic expects an expert to be reading it :/
>
>
> what do you'll think?
>
> Lee
The ones I use (from Radio Spares in Au (only as I needed 2 and they
deliver ;))
Pin 1 is No Connection
Pin 7 is Ground
Pin 8 is Output
Pin 14 is Vcc
Not all the modules have the inverted output, some even have just a
buffer so that it can drive 2 loads.
All you need for most apps is Pins 7,8,14 and leave pin 1 open circuit.
The only special attention I give them is a 10uF electro and a 0.1uF
mono caps as close as possible (the mono is usually on the bottom as I
do mainly SMD these days.
In most products I design I have 2 versions, 1 uses a crystal, and the
other the internal oscillator. but unless it is a package that can have
its crystal pins used as IO, then I tend to wack a crystal in with the
two caps (it only adds au$1 to the product cost) and I am not making
100's of these, most runs are bellow 20.
Regards,
Kat.
2005-07-04 by Dave VanHorn
Oh, ok.. I guess I was thinking xtal1 would output.. instead of input..
So that is why the pin8 on the crystalclock oscillator would be hooked directly up to xtal1.
So what would I do with xtal2? Leave it unconnected?
2005-07-05 by Alexandre Guimaraes
2005-07-05 by Dave VanHorn
Hi,
All this talk about crystals got me thinking about a cheap way to make a external oscillator for the Tiny13.... The only thing bad about this part is that it can not drive a crystal to make serial comms possible :-( Nothing can be perfect....
Does anyone have a handy, small and cheap crystal oscillator circuit that is reliable and uses low power ??? If it could use a resonator even better.... It gets cheaper and is good enough for serial communications...
2005-07-05 by Alexandre Guimaraes
Hi, Dave Thanks a lot for the fast answer... http://www.qrpp-i.com/elmer001/elmer001-e.htm That one looks really nice and is as simple as it can get... I do have some questions about it... But I will breadboard it tomorrow to see... It generates a sine wave, do you thing the Tiny13 would be happy with it ? Do you thing the level of the signal would be enough for driving the MCU ? Could it work with a resonator ? The Internal circuit would have the same configuration as the crystal and the 100pf cap's, wouldn't it ? Best regards, Alexandre Guimaraes
2005-07-05 by erikc
Alexandre Guimaraes wrote: > Hi, Dave > > Thanks a lot for the fast answer... > > http://www.qrpp-i.com/elmer001/elmer001-e.htm > > That one looks really nice and is as simple as it can get... I do have some > questions about it... But I will breadboard it tomorrow to see... > > It generates a sine wave, do you thing the Tiny13 would be happy with it ? > Do you thing the level of the signal would be enough for driving the MCU ? Add a transistor invertor at the output of the oscillator. A 10K base resistor and a 1K collector resistor should work nicely. It will put out a decent approximation to a square wave. > Could it work with a resonator ? The Internal circuit would have the same > configuration as the crystal and the 100pf cap's, wouldn't it ? I dunno. Try it and see. > Best regards, > Alexandre Guimaraes > -- erikc
2005-07-05 by Dave VanHorn
At 07:44 PM 7/4/2005, Alexandre Guimaraes wrote: >Hi, Dave > >Thanks a lot for the fast answer... > >http://www.qrpp-i.com/elmer001/elmer001-e.htm > >That one looks really nice and is as simple as it can get... I do have some >questions about it... But I will breadboard it tomorrow to see... > >It generates a sine wave, do you thing the Tiny13 would be happy with it ? >Do you thing the level of the signal would be enough for driving the MCU ? Should be, if not, a single transistor buffer amp should do it. >Could it work with a resonator ? The Internal circuit would have the same >configuration as the crystal and the 100pf cap's, wouldn't it ? Yes.
2005-07-05 by James Hatley
Hello, Reviewing your original note ... you want to do serial communication and you think you need a crystal oscillator to clock the mpu. It seems to me that there is no reason that the internal oscillator and a bit-bang serial comm solution won't work just fine. These type of routines have been through here a number of times and I'm sure that there are a number of examples around. The internal oscillator, at least in the Atmel mpus that I've used, can be tweeked with OSCCAL to get pretty close, like 2% or better. That should be quite sufficient to do serial communication. That part, the ATtiny13 doesn't have too many pins and we don't know what you want to do but you may want/need to use the pin for something else. Jim
----- Original Message -----
From: Alexandre Guimaraes
To: AVR-Chat@yahoogroups.com
Sent: Monday, July 04, 2005 5:21 PM
Subject: [AVR-Chat] External oscillator for the Tiny13.
Hi,
All this talk about crystals got me thinking about a cheap way to make a
external oscillator for the Tiny13.... The only thing bad about this part is
that it can not drive a crystal to make serial comms possible :-( Nothing
can be perfect....
Does anyone have a handy, small and cheap crystal oscillator circuit
that is reliable and uses low power ??? If it could use a resonator even
better.... It gets cheaper and is good enough for serial communications...
Best regards,
Alexandre Guimaraes
YAHOO! GROUPS LINKS
Visit your group "AVR-Chat" on the web.
To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.2005-07-05 by Mark Jordan
On 4 Jul 2005 at 21:21, Alexandre Guimaraes wrote: > Does anyone have a handy, small and cheap crystal oscillator circuit that > is reliable and uses low power ??? If it could use a resonator even > better.... It gets cheaper and is good enough for serial communications... > See attached.
2005-07-05 by Dave VanHorn
At 10:12 PM 7/4/2005, Mark Jordan wrote: >On 4 Jul 2005 at 21:21, Alexandre Guimaraes wrote: > > > Does anyone have a handy, small and cheap crystal oscillator circuit that > > is reliable and uses low power ??? If it could use a resonator even > > better.... It gets cheaper and is good enough for serial communications... > > There is that one. Seems oddly familiar.
2005-07-05 by Dave Mucha
--- In AVR-Chat@yahoogroups.com, "Pigeon" <fredit@c...> wrote: > Hmm.. because I would rather have something super simple.. and high quality, I like the idea of the > crystal clock oscillator > From my surfing, there is super simple. that is a 3 pin resonator with caps on-board. tiny, around the sides of a TO92 and complete. high quality is a pandoras box. Unless one is doing some form of timing that has to relate to human time, all these methods will work. Only when human time is involved, such as report events per second or some such, does accuracy need to be discussed. Dave
2005-07-05 by Dave VanHorn
At 09:20 AM 7/5/2005, Dave Mucha wrote: >--- In AVR-Chat@yahoogroups.com, "Pigeon" <fredit@c...> wrote: > > Hmm.. because I would rather have something super simple.. and high >quality, I like the idea of the > > crystal clock oscillator I don't understand why the crystal is perceived to be so difficult. The resonator includes two caps. Well Whoopee. How do they magically pick the right value of caps for your circuit? They don't. This is one reason, though not the dominant one, that they are not as accurate as a properly applied crystal. A crystal, and any cap within 50% of the right value is more accurate than the resonators. Really, if putting two caps on the board scares someone, then why is he doing these sorts of projects?
2005-07-05 by Alexandre Guimaraes
Hi, James
The OSCCAL calibration works really very well if you can guarante the
operating temperature.. If temperature varies too much it will not be enough
for reliable communications.. What makes the Tiny13 even more interesting is
that the voltage reference is much better than in the Atmega8, for example
and the price tag is great for simple applications. It is small but for some
applications sparing a pin is possible..
The only other way that I can see to make reliable serial comms at some
speed with it is if we calibrate the timing using the timing of the start
bit from the other serial device.. That works great but just under some
protocols and it also makes software much more complicated..
If the external oscillator can be made cheaply enough it is a great
option for many applications... The sub-dollar price tag with a nice AD
converter and voltage reference that works makes the Tiny13 a very, very
nice beast to be explored....
Best regards,
Alexandre Guimaraes
----- Original Message ----- From: "James Hatley" <james.hatley@comcast.net> To: <AVR-Chat@yahoogroups.com> Sent: Monday, July 04, 2005 11:47 PM Subject: Re: [AVR-Chat] External oscillator for the Tiny13. > Hello, > > Reviewing your original note ... you want to do serial communication and > you > think you need a crystal oscillator to clock the mpu. > > It seems to me that there is no reason that the internal oscillator and a > bit-bang serial comm solution won't work just fine. These type of routines > have been through here a number of times and I'm sure that there are a > number of examples around. The internal oscillator, at least in the Atmel > mpus that I've used, can be tweeked with OSCCAL to get pretty close, like > 2% > or better. That should be quite sufficient to do serial communication. > > That part, the ATtiny13 doesn't have too many pins and we don't know what > you want to do but you may want/need to use the pin for something else. > > Jim > > ----- Original Message ----- > From: Alexandre Guimaraes > To: AVR-Chat@yahoogroups.com > Sent: Monday, July 04, 2005 5:21 PM > Subject: [AVR-Chat] External oscillator for the Tiny13. > > > Hi, > > All this talk about crystals got me thinking about a cheap way to make > a > external oscillator for the Tiny13.... The only thing bad about this part > is > that it can not drive a crystal to make serial comms possible :-( Nothing > can be perfect.... > > Does anyone have a handy, small and cheap crystal oscillator circuit > that is reliable and uses low power ??? If it could use a resonator even > better.... It gets cheaper and is good enough for serial communications... > > Best regards, > Alexandre Guimaraes > > > > > YAHOO! GROUPS LINKS > > Visit your group "AVR-Chat" on the web. > > To unsubscribe from this group, send an email to: > AVR-Chat-unsubscribe@yahoogroups.com > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > > > > > Yahoo! Groups Links > > > > > >
2005-07-05 by James Hatley
I still think that you can do it without a crystal or other external oscillator. You are going to have to use 2 pins for serial communication in any case. I assume you want to talk to it in some way. Wake up your unit with a few characters that you can measure the bit length like 5s or As or whatever you pick, then set you bit time at what you find. Maybe that little processor doesn't have enough memory for that sort of thing. But it is totally doable to have a self adapting serial bit-bang type comm IO. You can get it real close and each time it will figure out itself what is accurate based on the input. If you must have an external oscillator, I'd take Dave's advice. That oscillator will probably work fine just as it is. The sine wave will also most likely run the processor very well or as suggested you can square it up but it may not be required. Important this is to try it and see what happens. Good luck, Jim ----- Original Message ----- From: "Alexandre Guimaraes" <listas@logikos.com.br> To: <AVR-Chat@yahoogroups.com> Sent: Tuesday, July 05, 2005 1:07 PM Subject: Re: [AVR-Chat] External oscillator for the Tiny13. > Hi, James > > The OSCCAL calibration works really very well if you can guarante the > operating temperature.. If temperature varies too much it will not be enough > for reliable communications.. What makes the Tiny13 even more interesting is > that the voltage reference is much better than in the Atmega8, for example > and the price tag is great for simple applications. It is small but for some > applications sparing a pin is possible.. > > The only other way that I can see to make reliable serial comms at some > speed with it is if we calibrate the timing using the timing of the start > bit from the other serial device.. That works great but just under some > protocols and it also makes software much more complicated.. > > If the external oscillator can be made cheaply enough it is a great > option for many applications... The sub-dollar price tag with a nice AD > converter and voltage reference that works makes the Tiny13 a very, very > nice beast to be explored.... > > Best regards, > Alexandre Guimaraes > > ----- Original Message ----- > From: "James Hatley" <james.hatley@comcast.net> > To: <AVR-Chat@yahoogroups.com> > Sent: Monday, July 04, 2005 11:47 PM > Subject: Re: [AVR-Chat] External oscillator for the Tiny13. > > > > Hello, > > > > Reviewing your original note ... you want to do serial communication and > > you > > think you need a crystal oscillator to clock the mpu. > > > > It seems to me that there is no reason that the internal oscillator and a > > bit-bang serial comm solution won't work just fine. These type of routines > > have been through here a number of times and I'm sure that there are a > > number of examples around. The internal oscillator, at least in the Atmel > > mpus that I've used, can be tweeked with OSCCAL to get pretty close, like > > 2% > > or better. That should be quite sufficient to do serial communication. > > > > That part, the ATtiny13 doesn't have too many pins and we don't know what > > you want to do but you may want/need to use the pin for something else. > > > > Jim > > > > ----- Original Message ----- > > From: Alexandre Guimaraes > > To: AVR-Chat@yahoogroups.com > > Sent: Monday, July 04, 2005 5:21 PM > > Subject: [AVR-Chat] External oscillator for the Tiny13. > > > > > > Hi, > > > > All this talk about crystals got me thinking about a cheap way to make > > a > > external oscillator for the Tiny13.... The only thing bad about this part > > is > > that it can not drive a crystal to make serial comms possible :-( Nothing > > can be perfect.... > > > > Does anyone have a handy, small and cheap crystal oscillator circuit > > that is reliable and uses low power ??? If it could use a resonator even > > better.... It gets cheaper and is good enough for serial communications...
> > > > Best regards, > > Alexandre Guimaraes > > > > > > > > > > YAHOO! GROUPS LINKS > > > > Visit your group "AVR-Chat" on the web. > > > > To unsubscribe from this group, send an email to: > > AVR-Chat-unsubscribe@yahoogroups.com > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > > > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > Yahoo! Groups Links > > > > > > >
2005-07-06 by Dave VanHorn
Has anyone on here done any development with the FPSlic? I'm a bit put off by the licensing requirements for the toolchain, but this appears an attractive option for an upcoming project.
2005-07-06 by Alexandre Guimaraes
Hi, James
>I still think that you can do it without a crystal or other external
> oscillator. You are going to have to use 2 pins for serial communication
> in
> any case. I assume you want to talk to it in some way. Wake up your unit
> with a few characters that you can measure the bit length like 5s or As or
> whatever you pick, then set you bit time at what you find. Maybe that
> little
> processor doesn't have enough memory for that sort of thing. But it is
> totally doable to have a self adapting serial bit-bang type comm IO. You
> can
> get it real close and each time it will figure out itself what is accurate
> based on the input.
Usually you do not even need to measure a character time... The start
bit is enough. You are absolutely right about memory... The program to adapt
the timing and that stuff will eat precious program and storage memory. It
all depends on the constraints of the projetct. If memory is not a problem
that is the way to go, if it is a cheap external oscillator may be a better
option. You also need to have the IO pins available.. Like most of the
problems that we deal, there's always many ways that are better at each
project. The best thing is to have the basics well solved in the "bag of
tricks" and ready to work when the next project arrives :-)
> If you must have an external oscillator, I'd take Dave's advice. That
> oscillator will probably work fine just as it is. The sine wave will also
> most likely run the processor very well or as suggested you can square it
> up
> but it may not be required. Important this is to try it and see what
> happens.
I am a little worried about getting a sine wave in the clock input..
There is no detailed especification and I am not even sure if that input has
a schhmit trigger.. It may work erractly.. I am not sure.. I will try it out
anyway and let the list know if it works...
Best regards,
Alexandre Guimaraes> Good luck, > > Jim > > ----- Original Message ----- > From: "Alexandre Guimaraes" <listas@logikos.com.br> > To: <AVR-Chat@yahoogroups.com> > Sent: Tuesday, July 05, 2005 1:07 PM > Subject: Re: [AVR-Chat] External oscillator for the Tiny13. > > >> Hi, James >> >> The OSCCAL calibration works really very well if you can guarante the >> operating temperature.. If temperature varies too much it will not be > enough >> for reliable communications.. What makes the Tiny13 even more interesting > is >> that the voltage reference is much better than in the Atmega8, for >> example >> and the price tag is great for simple applications. It is small but for > some >> applications sparing a pin is possible.. >> >> The only other way that I can see to make reliable serial comms at > some >> speed with it is if we calibrate the timing using the timing of the start >> bit from the other serial device.. That works great but just under some >> protocols and it also makes software much more complicated.. >> >> If the external oscillator can be made cheaply enough it is a great >> option for many applications... The sub-dollar price tag with a nice AD >> converter and voltage reference that works makes the Tiny13 a very, very >> nice beast to be explored.... >> >> Best regards, >> Alexandre Guimaraes >> >> ----- Original Message ----- >> From: "James Hatley" <james.hatley@comcast.net> >> To: <AVR-Chat@yahoogroups.com> >> Sent: Monday, July 04, 2005 11:47 PM >> Subject: Re: [AVR-Chat] External oscillator for the Tiny13. >> >> >> > Hello, >> > >> > Reviewing your original note ... you want to do serial communication >> > and >> > you >> > think you need a crystal oscillator to clock the mpu. >> > >> > It seems to me that there is no reason that the internal oscillator and > a >> > bit-bang serial comm solution won't work just fine. These type of > routines >> > have been through here a number of times and I'm sure that there are a >> > number of examples around. The internal oscillator, at least in the > Atmel >> > mpus that I've used, can be tweeked with OSCCAL to get pretty close, > like >> > 2% >> > or better. That should be quite sufficient to do serial communication. >> > >> > That part, the ATtiny13 doesn't have too many pins and we don't know > what >> > you want to do but you may want/need to use the pin for something else. >> > >> > Jim >> > >> > ----- Original Message ----- >> > From: Alexandre Guimaraes >> > To: AVR-Chat@yahoogroups.com >> > Sent: Monday, July 04, 2005 5:21 PM >> > Subject: [AVR-Chat] External oscillator for the Tiny13. >> > >> > >> > Hi, >> > >> > All this talk about crystals got me thinking about a cheap way to > make >> > a >> > external oscillator for the Tiny13.... The only thing bad about this > part >> > is >> > that it can not drive a crystal to make serial comms possible :-( > Nothing >> > can be perfect.... >> > >> > Does anyone have a handy, small and cheap crystal oscillator circuit >> > that is reliable and uses low power ??? If it could use a resonator >> > even >> > better.... It gets cheaper and is good enough for serial > communications... >> > >> > Best regards, >> > Alexandre Guimaraes >> > >> > >> > >> > >> > YAHOO! GROUPS LINKS >> > >> > Visit your group "AVR-Chat" on the web. >> > >> > To unsubscribe from this group, send an email to: >> > AVR-Chat-unsubscribe@yahoogroups.com >> > >> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. >> > >> > >> > >> > >> > >> > Yahoo! Groups Links >> > >> > >> > >> > >> > >> > >> >> >> >> >> Yahoo! Groups Links >> >> >> >> >> >> >> > > > > > > Yahoo! Groups Links > > > > > >
2005-07-06 by James Hatley
Eventually, you will have to breadboard up things and try something. The ATtiny13 does not have a uart so you will have to write the code with timing and all anyway. It would be easy to make a simple measurement to find out the bit time and go from there. Incidentally, I haven't had any problem with the internal oscillator running the uart for serial communication at 9600 baud using the 8Mhz internal oscillator. However, maybe you should consider one of the other fine AVR processors that has a uart if you don't want to mess with the bit-bang solution required. Jim ----- Original Message ----- From: "Alexandre Guimaraes" <listas@logikos.com.br> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, July 06, 2005 8:48 AM Subject: Re: [AVR-Chat] External oscillator for the Tiny13. > Hi, James > > >I still think that you can do it without a crystal or other external > > oscillator. You are going to have to use 2 pins for serial communication > > in > > any case. I assume you want to talk to it in some way. Wake up your unit > > with a few characters that you can measure the bit length like 5s or As or > > whatever you pick, then set you bit time at what you find. Maybe that > > little > > processor doesn't have enough memory for that sort of thing. But it is > > totally doable to have a self adapting serial bit-bang type comm IO. You > > can > > get it real close and each time it will figure out itself what is accurate > > based on the input. > > Usually you do not even need to measure a character time... The start > bit is enough. You are absolutely right about memory... The program to adapt > the timing and that stuff will eat precious program and storage memory. It > all depends on the constraints of the projetct. If memory is not a problem > that is the way to go, if it is a cheap external oscillator may be a better > option. You also need to have the IO pins available.. Like most of the > problems that we deal, there's always many ways that are better at each > project. The best thing is to have the basics well solved in the "bag of > tricks" and ready to work when the next project arrives :-) > > > If you must have an external oscillator, I'd take Dave's advice. That > > oscillator will probably work fine just as it is. The sine wave will also > > most likely run the processor very well or as suggested you can square it > > up > > but it may not be required. Important this is to try it and see what > > happens. > > I am a little worried about getting a sine wave in the clock input.. > There is no detailed especification and I am not even sure if that input has > a schhmit trigger.. It may work erractly.. I am not sure.. I will try it out > anyway and let the list know if it works... > > Best regards, > Alexandre Guimaraes > > > > Good luck, > > > > Jim > > > > ----- Original Message ----- > > From: "Alexandre Guimaraes" <listas@logikos.com.br> > > To: <AVR-Chat@yahoogroups.com> > > Sent: Tuesday, July 05, 2005 1:07 PM > > Subject: Re: [AVR-Chat] External oscillator for the Tiny13. > > > > > >> Hi, James > >> > >> The OSCCAL calibration works really very well if you can guarante the > >> operating temperature.. If temperature varies too much it will not be > > enough > >> for reliable communications.. What makes the Tiny13 even more interesting > > is > >> that the voltage reference is much better than in the Atmega8, for > >> example > >> and the price tag is great for simple applications. It is small but for > > some > >> applications sparing a pin is possible.. > >> > >> The only other way that I can see to make reliable serial comms at > > some > >> speed with it is if we calibrate the timing using the timing of the start > >> bit from the other serial device.. That works great but just under some > >> protocols and it also makes software much more complicated.. > >> > >> If the external oscillator can be made cheaply enough it is a great > >> option for many applications... The sub-dollar price tag with a nice AD > >> converter and voltage reference that works makes the Tiny13 a very, very > >> nice beast to be explored.... > >> > >> Best regards, > >> Alexandre Guimaraes > >> > >> ----- Original Message ----- > >> From: "James Hatley" <james.hatley@comcast.net> > >> To: <AVR-Chat@yahoogroups.com> > >> Sent: Monday, July 04, 2005 11:47 PM > >> Subject: Re: [AVR-Chat] External oscillator for the Tiny13. > >> > >> > >> > Hello, > >> > > >> > Reviewing your original note ... you want to do serial communication > >> > and > >> > you > >> > think you need a crystal oscillator to clock the mpu. > >> > > >> > It seems to me that there is no reason that the internal oscillator and > > a > >> > bit-bang serial comm solution won't work just fine. These type of > > routines > >> > have been through here a number of times and I'm sure that there are a > >> > number of examples around. The internal oscillator, at least in the > > Atmel > >> > mpus that I've used, can be tweeked with OSCCAL to get pretty close, > > like > >> > 2% > >> > or better. That should be quite sufficient to do serial communication. > >> > > >> > That part, the ATtiny13 doesn't have too many pins and we don't know > > what > >> > you want to do but you may want/need to use the pin for something else. > >> > > >> > Jim > >> > > >> > ----- Original Message ----- > >> > From: Alexandre Guimaraes > >> > To: AVR-Chat@yahoogroups.com > >> > Sent: Monday, July 04, 2005 5:21 PM > >> > Subject: [AVR-Chat] External oscillator for the Tiny13. > >> > > >> > > >> > Hi, > >> > > >> > All this talk about crystals got me thinking about a cheap way to > > make > >> > a > >> > external oscillator for the Tiny13.... The only thing bad about this > > part > >> > is > >> > that it can not drive a crystal to make serial comms possible :-( > > Nothing > >> > can be perfect.... > >> > > >> > Does anyone have a handy, small and cheap crystal oscillator circuit
> >> > that is reliable and uses low power ??? If it could use a resonator > >> > even > >> > better.... It gets cheaper and is good enough for serial > > communications... > >> > > >> > Best regards, > >> > Alexandre Guimaraes > >> > > >> > > >> > > >> > > >> > YAHOO! GROUPS LINKS > >> > > >> > Visit your group "AVR-Chat" on the web. > >> > > >> > To unsubscribe from this group, send an email to: > >> > AVR-Chat-unsubscribe@yahoogroups.com > >> > > >> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > >> > > >> > > >> > > >> > > >> > > >> > Yahoo! Groups Links > >> > > >> > > >> > > >> > > >> > > >> > > >> > >> > >> > >> > >> Yahoo! Groups Links > >> > >> > >> > >> > >> > >> > >> > > > > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > Yahoo! Groups Links > > > > > > >