Pull down resistors??
2005-08-30 by jdelgadillo66
Yahoo Groups archive
Index last updated: 2026-04-28 22:41 UTC
Thread
2005-08-30 by jdelgadillo66
Hi Sorry but Im a microcontroller beginner and I have a lot of questions, Its necesary put in my circuits pull down resistors, I have a low input pin (atmega8) and expect receive a 1 logic, Is it posible have trouble (noise) if I havent a resistor pull down?, Is best practice put a resistor pull down? Thanks a lot
2005-08-31 by John Samperi
At 05:48 AM 31/08/2005, you wrote:
>Is it posible have trouble
>(noise) if I havent a resistor pull down?, Is best practice put a
>resistor pull down?
Yes you are asking for trouble as you input will float.
Less of a problem if you enable the internal pull up
resistors but then you will need a logic 0 to activate
the input. Make the resistor as small as possible
provided your input source can handle it, 2K-10K
are a good guide. Also if your environment is noisy
you may want to put a 100nF cap in parallel.
A small resistor in series with your input can be
helpful but you may want to limit it to about 10%
of your input resistor.
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-08-31 by Don Kinzer
--- In AVR-Chat@yahoogroups.com, Thomas Keller <tkeller1@n...> wrote: > > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a > > logic one. > > Not according to AVR data sheets, it's not. Every AVR datasheet that I've seen describes a positive logic system for the I/O pins where the most positive voltage is a logic one. What datasheet are you looking at? Don
2005-08-31 by Thomas Keller
On Tue, 2005-08-30 at 19:48 +0000, jdelgadillo66 wrote: > Hi > Sorry but Im a microcontroller beginner and I have a lot of > questions, > Its necesary put in my circuits pull down resistors, I have a low > input pin (atmega8) and expect receive a 1 logic, Is it posible have > trouble (noise) if I havent a resistor pull down?, Is best practice > put a resistor pull down? > Thanks a lot Perhaps I am missing something, here. AVR processors have selectable pull UP resisotrs on each and every digital I/O pin. Since a low voltage is a logic 1, you don't need "pull down" resistors on AVR inputs. If you mean pu;l;l-up resisots, that's different, but they're selectable in software, and do not require any external components. Tom
2005-08-31 by David Kelly
On Wed, Aug 31, 2005 at 12:22:16PM -0500, Thomas Keller wrote: > > Perhaps I am missing something, here. AVR processors have > selectable pull UP resisotrs on each and every digital I/O pin. > Since a low voltage is a logic 1, you don't need "pull down" > resistors on AVR inputs. Uh, "low voltage is a logic 1"? Maybe low is 1 if none is 0. If the external source requires a load to drain its charge (and therefore voltage) then you need a pull-down resistor. When the external source is a current source. If the external source isn't really a source but a switch or open collector output then you need a pull up resistor to feed it, that one can detect when it closes its circuit. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.
2005-08-31 by Dave Hylands
> Perhaps I am missing something, here. AVR processors have selectable > pull UP resisotrs on each and every digital I/O pin. Since a low > voltage is a logic 1, you don't need "pull down" resistors on AVR > inputs. Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a logic one. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/
2005-08-31 by Thomas Keller
On Wed, 2005-08-31 at 10:36 -0700, Dave Hylands wrote: > > Perhaps I am missing something, here. AVR processors have > selectable > > pull UP resisotrs on each and every digital I/O pin. Since a low > > voltage is a logic 1, you don't need "pull down" resistors on AVR > > inputs. > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a > logic one. Not according to AVR data sheets, it's not.
2005-08-31 by Dave Hylands
Hi Thomas, On 8/31/05, Thomas Keller <tkeller1@neb.rr.com> wrote: > On Wed, 2005-08-31 at 10:36 -0700, Dave Hylands wrote: > > > Perhaps I am missing something, here. AVR processors have > > selectable > > > pull UP resisotrs on each and every digital I/O pin. Since a low > > > voltage is a logic 1, you don't need "pull down" resistors on AVR > > > inputs. > > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a > > logic one. > > Not according to AVR data sheets, it's not. And where exactly are you referring to? Page 239 of tha ATmega8 data sheet (Electrical Characteristics) says that the output low voltage for Ports A, B, C, and D is at most 0.7v for a 5v device and that the output high voltage is at least 4.2v. The table on page 51 that shows the functionality of the PORT pins shows that a 1 written into a PORT pin is Output High (assuming DDR is set for output) and 0 is Output Low. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/
2005-08-31 by James Washer
Perhaps the original poster is confusing 1=output 0=input for DDR On Wed, 31 Aug 2005 11:35:08 -0700 Dave Hylands <dhylands@gmail.com> wrote:
> Hi Thomas, > > On 8/31/05, Thomas Keller <tkeller1@neb.rr.com> wrote: > > On Wed, 2005-08-31 at 10:36 -0700, Dave Hylands wrote: > > > > Perhaps I am missing something, here. AVR processors have > > > selectable > > > > pull UP resisotrs on each and every digital I/O pin. Since a low > > > > voltage is a logic 1, you don't need "pull down" resistors on AVR > > > > inputs. > > > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a > > > logic one. > > > > Not according to AVR data sheets, it's not. > > And where exactly are you referring to? > > Page 239 of tha ATmega8 data sheet (Electrical Characteristics) says > that the output low voltage for Ports A, B, C, and D is at most 0.7v > for a 5v device and that the output high voltage is at least 4.2v. > > The table on page 51 that shows the functionality of the PORT pins > shows that a 1 written into a PORT pin is Output High (assuming DDR is > set for output) and 0 is Output Low. > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > > > > Yahoo! Groups Links > > > > > >
2005-08-31 by Don Kinzer
> The convention of using logic 0 for 0 volts and logic 1 for a high... Actually, there are several nested conventions. One is positive logic vs negative logic. In the former, the most positive voltage is a logic 1 while in the latter the most negative voltage is a logic 1. Once you adopt one of those major conventions you move on to establishing what voltage ranges will be recognized for each level as well as possibly an "indeterminate" region. One logic family that used positive logic but negative voltages was ECL. The thresholds were something like -0.9V for a logic 1 and - 2.75V for a logic 0. I have a faint recollection of some Digital Equipment Corp. logic cards that were implemented using DTL or RTL technology that were negative logic but I can't recall the details. Don
2005-08-31 by John Samperi
At 04:15 AM 1/09/2005, you wrote:
> > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a
> > logic one.
>
> Not according to AVR data sheets, it's not.
The convention of using logic 0 for 0 volts
and logic 1 for a high (be it 5, 1, 3 12 or 100V)
was established before micro controller were thought
of and therefore it has nothing to do with Atmel.
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-08-31 by Dennis
Data sheet definitions are sometimes wrong as are manuals. I found that out the hard way with the mega168. However, a logic 1 is presumed to be the "high" logic 1 and a logic 0 the "low". Remember ECL. Bassackwards. I'm working on a system where the ground is -5v dc generated by a hybrid PS and the positive supply is AC neutral. D ----- Original Message -----
From: "John Samperi" <samperi@ampertronics.com.au> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 4:45 PM Subject: Re: [AVR-Chat] Pull down resistors?? > At 04:15 AM 1/09/2005, you wrote: >> > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a >> > logic one. >> >> Not according to AVR data sheets, it's not. > > The convention of using logic 0 for 0 volts > and logic 1 for a high (be it 5, 1, 3 12 or 100V) > was established before micro controller were thought > of and therefore it has nothing to do with Atmel. > > 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 > ****************************************************** > > > > > > > Yahoo! Groups Links > > > > > > >
2005-08-31 by Chuck Hackett
> From: Dennis > > Data sheet definitions are sometimes wrong as are manuals. I found that out > the hard way with the mega168. > .... Hmm, I'm a newbie and I'm starting a project on an mega169 (Butterfly). Does the 169 have the same problems? I'd hate to spend hours assuming I'm wrong and it's correct ... Cheers, Chuck Hackett "Good judgment comes from experience, experience comes from bad judgment" 7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck
2005-08-31 by Dennis
Usually rely on the AVRFreaks or go to avr@atmel.com to ask a question. I was out of the processor realm for about 15 years and had to re-wet my feet. AVRFreaks tend to be a bit contentious at times but there is a wealth of knowledge and experience. No personal experience with the 169 but every project has it's kicks to the groin. D ----- Original Message -----
From: "Chuck Hackett" <egroupscdh@WhiteTrout.net> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 5:56 PM Subject: [AVR-Chat] Errors in manuals ... >> From: Dennis >> >> Data sheet definitions are sometimes wrong as are manuals. I found that >> out >> the hard way with the mega168. >> .... > > Hmm, I'm a newbie and I'm starting a project on an mega169 (Butterfly). > Does > the 169 have the same problems? I'd hate to spend hours assuming I'm > wrong and > it's correct ... > > Cheers, > > Chuck Hackett > "Good judgment comes from experience, experience comes from bad judgment" > 7.5" gauge Union Pacific Northern (4-8-4) 844 > http://www.whitetrout.net/Chuck > > > > > > > > Yahoo! Groups Links > > > > > > >
2005-08-31 by Dennis
ECL was the high speed emitter coupled logic. Great speed, great amounts of heat. It was used quite a bit in military equipment for a period of time and supercomputers. Fell out of vogue. D ----- Original Message -----
From: "Don Kinzer" <dkinzer@easystreet.com> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 6:29 PM Subject: [AVR-Chat] Re: Pull down resistors?? >> The convention of using logic 0 for 0 volts and logic 1 for a high... > > Actually, there are several nested conventions. One is positive logic > vs negative logic. In the former, the most positive voltage is a > logic 1 while in the latter the most negative voltage is a logic 1. > > Once you adopt one of those major conventions you move on to > establishing what voltage ranges will be recognized for each level as > well as possibly an "indeterminate" region. > > One logic family that used positive logic but negative voltages was > ECL. The thresholds were something like -0.9V for a logic 1 and - > 2.75V for a logic 0. I have a faint recollection of some Digital > Equipment Corp. logic cards that were implemented using DTL or RTL > technology that were negative logic but I can't recall the details. > > Don > > > > > > > Yahoo! Groups Links > > > > > > > >
2005-09-01 by Don Jackson
Dennis wrote: >>>Data sheet definitions are sometimes wrong as are manuals. I found that >>>out >>>the hard way with the mega168. >>>.... Would you be so kind as to let us know what is wrong in the mega168 data sheet? I'm about to use this one... Thanks, Don
2005-09-01 by Roy E. Burrage
At 04:15 AM 1/09/2005, you wrote:Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a logic one.Not according to AVR data sheets, it's not.The convention of using logic 0 for 0 volts and logic 1 for a high (be it 5, 1, 3 12 or 100V) was established before micro controller were thought of and therefore it has nothing to do with Atmel. Regards John Samperi
2005-09-01 by Dennis
The GPIOR0, 1 & 2 do not all respond to the instructions specified. Only GPIOr0 does. I use the LDS and STS with all 3. If you look at the RET and RETI instructions, the stack operations are the same, according to the manual. However, the RET does return to the instruction following the CALL whereas the RETI returns to the instruction at point of interrupt. In the case of the RETI, after much debate and RTFM bull, you have to use a polled type of interrupt. D ----- Original Message -----
From: "Don Jackson" <ae5k.radio@gmail.com> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 8:51 PM Subject: Re: Re: [AVR-Chat] Errors in manuals ... > Dennis wrote: > >>>>Data sheet definitions are sometimes wrong as are manuals. I found that >>>>out >>>>the hard way with the mega168. >>>>.... > > Would you be so kind as to let us know what is wrong in the mega168 data > sheet? I'm about to use this one... > > Thanks, > Don > > > > > Yahoo! Groups Links > > > > > > >
2005-09-01 by Mark Jordan
On 31 Aug 2005 at 21:26, Dennis wrote: > The GPIOR0, 1 & 2 do not all respond to the instructions specified. Only > GPIOr0 does. I use the LDS and STS with all 3. Can you use the OUT/IN instruction with them? Mark
2005-09-01 by John Samperi
At 12:26 PM 1/09/2005, you wrote:
>If you look at the RET and RETI instructions, the stack operations are the
>same, according to the manual.
Which they are.
>However, the RET does return to the
>instruction following the CALL
Which is correct.
>whereas the RETI returns to the instruction
>at point of interrupt.
Which is incorrect. If I well remember you had
a RJMP LOOP so the next instruction is always
RJMP LOOP...as many of us pointed out...so it
will NEVER go past that point as you expected :-)
>In the case of the RETI, after much debate and RTFM
>bull, you have to use a polled type of interrupt.
You didn't have to. You would only have to change your
code at the RJMP LOOP to do some simple test and then exit
the loop. Again as some of us pointed out :-)
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-09-01 by Dennis
No. D ----- Original Message -----
From: "Mark Jordan" <mark@cpovo.net> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 10:00 PM Subject: Re: Re: [AVR-Chat] Errors in manuals ... > On 31 Aug 2005 at 21:26, Dennis wrote: > >> The GPIOR0, 1 & 2 do not all respond to the instructions specified. Only >> GPIOr0 does. I use the LDS and STS with all 3. > > Can you use the OUT/IN instruction with them? > > Mark > > > > > > > Yahoo! Groups Links > > > > > > > >
2005-09-01 by Dennis
Changed it to a loop with test of a flag. Works fine. D ----- Original Message -----
From: "John Samperi" <samperi@ampertronics.com.au> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 10:25 PM Subject: Re: Re: [AVR-Chat] Errors in manuals ... > At 12:26 PM 1/09/2005, you wrote: >>If you look at the RET and RETI instructions, the stack operations are the >>same, according to the manual. > > Which they are. > >>However, the RET does return to the >>instruction following the CALL > > Which is correct. > >>whereas the RETI returns to the instruction >>at point of interrupt. > > Which is incorrect. If I well remember you had > a RJMP LOOP so the next instruction is always > RJMP LOOP...as many of us pointed out...so it > will NEVER go past that point as you expected :-) > >>In the case of the RETI, after much debate and RTFM >>bull, you have to use a polled type of interrupt. > > You didn't have to. You would only have to change your > code at the RJMP LOOP to do some simple test and then exit > the loop. Again as some of us pointed out :-) > > > 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 > ****************************************************** > > > > > > > Yahoo! Groups Links > > > > > > > >
2005-09-01 by Dennis
Clarify. The GPIOR0 is in a different address space from the other 2 GP registers. Why? Haven't a clue. They are not in the I/O space like ports. However, the manual leads you to believe that the SBI, CBI etc instructions work on all 3 registers. Not so. The EIMSK is kind of sort of the same. Works with SBI and CBI but not the LDS or STS. D ----- Original Message -----
From: "Mark Jordan" <mark@cpovo.net> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 10:00 PM Subject: Re: Re: [AVR-Chat] Errors in manuals ... > On 31 Aug 2005 at 21:26, Dennis wrote: > >> The GPIOR0, 1 & 2 do not all respond to the instructions specified. Only >> GPIOr0 does. I use the LDS and STS with all 3. > > Can you use the OUT/IN instruction with them? > > Mark > > > > > > > Yahoo! Groups Links > > > > > > > >
2005-09-01 by Don Jackson
Hi Dennis, Thanks for the reply to my query. I do not wish to revisit the debate on the RET and RETI stuff, and also do not wish to provoke a lot of debate on the GPIORx either, but in my copy of the Atmel Data Sheet (just updated my copy tonight), 2545F dated 06/05 (and it said the same thing in my older year old version): page 24: General Purpose I/O Registers within the address range 0x00 - 0x1F are directly bit-accessible using the SBI, CBI, SBIS, and SBIC instructions. page 337: shows GPIOR0 at 0x1E (which implies it IS bit-accessible using SBI, etc.) and it shows GPIOR1 at 0x2A and GPIOR2 at 0x2B (which implies is IS NOT bit-accessible using SBI, etc.). I believe this is what you found, isn't it? Don PS - as a side note, it is interesting that at least my PDF reader program will not allow "copy & paste" of text in this datasheet ;-) Dennis wrote:
> The GPIOR0, 1 & 2 do not all respond to the instructions specified. Only > GPIOr0 does. I use the LDS and STS with all 3. > If you look at the RET and RETI instructions, the stack operations are the > same, according to the manual. However, the RET does return to the > instruction following the CALL whereas the RETI returns to the instruction > at point of interrupt. In the case of the RETI, after much debate and RTFM > bull, you have to use a polled type of interrupt. > D > ----- Original Message ----- > From: "Don Jackson" <ae5k.radio@gmail.com> > To: <AVR-Chat@yahoogroups.com> > Sent: Wednesday, August 31, 2005 8:51 PM > Subject: Re: Re: [AVR-Chat] Errors in manuals ... > > > >>Dennis wrote: >> >> >>>>>Data sheet definitions are sometimes wrong as are manuals. I found that >>>>>out >>>>>the hard way with the mega168. >>>>>.... >> >>Would you be so kind as to let us know what is wrong in the mega168 data >>sheet? I'm about to use this one... >> >>Thanks, >>Don
2005-09-01 by Dennis
You have to "build" the code. I use the SDK500 and Studio4.x. The build will generate the object code. If an error occurs, it will flag it. Try using the GPIOR0, 1, 2 registers with the instructions given in the manual. Only GRIOR0 will work. D ----- Original Message -----
From: "Don Jackson" <ae5k.radio@gmail.com> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 10:46 PM Subject: Re: Re: Re: [AVR-Chat] Errors in manuals ... > Hi Dennis, > > Thanks for the reply to my query. > > I do not wish to revisit the debate on the RET and RETI stuff, and also > do not wish to provoke a lot of debate on the GPIORx either, but in my > copy of the Atmel Data Sheet (just updated my copy tonight), 2545F dated > 06/05 (and it said the same thing in my older year old version): > > page 24: General Purpose I/O Registers within the address range 0x00 - > 0x1F are directly bit-accessible using the SBI, CBI, SBIS, and SBIC > instructions. > > page 337: shows GPIOR0 at 0x1E (which implies it IS bit-accessible using > SBI, etc.) and it shows GPIOR1 at 0x2A and GPIOR2 at 0x2B (which implies > is IS NOT bit-accessible using SBI, etc.). I believe this is what you > found, isn't it? > > Don > > PS - as a side note, it is interesting that at least my PDF reader > program will not allow "copy & paste" of text in this datasheet ;-) > > Dennis wrote: >> The GPIOR0, 1 & 2 do not all respond to the instructions specified. Only >> GPIOr0 does. I use the LDS and STS with all 3. >> If you look at the RET and RETI instructions, the stack operations are >> the >> same, according to the manual. However, the RET does return to the >> instruction following the CALL whereas the RETI returns to the >> instruction >> at point of interrupt. In the case of the RETI, after much debate and >> RTFM >> bull, you have to use a polled type of interrupt. >> D >> ----- Original Message ----- >> From: "Don Jackson" <ae5k.radio@gmail.com> >> To: <AVR-Chat@yahoogroups.com> >> Sent: Wednesday, August 31, 2005 8:51 PM >> Subject: Re: Re: [AVR-Chat] Errors in manuals ... >> >> >> >>>Dennis wrote: >>> >>> >>>>>>Data sheet definitions are sometimes wrong as are manuals. I found >>>>>>that >>>>>>out >>>>>>the hard way with the mega168. >>>>>>.... >>> >>>Would you be so kind as to let us know what is wrong in the mega168 data >>>sheet? I'm about to use this one... >>> >>>Thanks, >>>Don > > > > > > Yahoo! Groups Links > > > > > > > >
2005-09-01 by Don Jackson
Dennis, I don't believe you read what I wrote. In my quotes from the "manual", it very clearly states exactly what you are finding on those three registers. Please re-read very carefully my two quotes from pages 24 and 237. The manual is very clear and correct on this, although admittedly, one would need to check on the addresses of each register to ascertain if those special bit instructions could be used. I can see why you may have assumed that all three could use the SBI, CBI, SBIS, and SBIC instructions...and I would have probably fallen in the same trap. It would have been better for the datasheet to say it differently, but as it stands, the datasheet is correct as far as I can see. I do agree with you that many datasheets contain errors (just like the code we write ;-) as they are most often written by people who do not have complete knowledge of the chip. The problem is not just with Atmel, but with all. In a former life, I worked for Motorola Semiconductor back in the days of the 6800 and later; when I went to use a MC68331 in an application, I got burned more than once with datasheet errors. The same is true when I used the PIC some years later. Too bad the manufacturers don't use the same system some college profs have used to get their students to proofread their textbooks they've written ... offer some reward for the first person to find a particular error. Sounds like you're making progress at least... Regards, Don Dennis wrote:
> You have to "build" the code. I use the SDK500 and Studio4.x. The build will > generate the object code. If an error occurs, it will flag it. > Try using the GPIOR0, 1, 2 registers with the instructions given in the > manual. Only GRIOR0 will work. > D > ----- Original Message ----- > From: "Don Jackson" <ae5k.radio@gmail.com> > To: <AVR-Chat@yahoogroups.com> > Sent: Wednesday, August 31, 2005 10:46 PM > Subject: Re: Re: Re: [AVR-Chat] Errors in manuals ... > > > >>Hi Dennis, >> >>Thanks for the reply to my query. >> >>I do not wish to revisit the debate on the RET and RETI stuff, and also >>do not wish to provoke a lot of debate on the GPIORx either, but in my >>copy of the Atmel Data Sheet (just updated my copy tonight), 2545F dated >>06/05 (and it said the same thing in my older year old version): >> >>page 24: General Purpose I/O Registers within the address range 0x00 - >>0x1F are directly bit-accessible using the SBI, CBI, SBIS, and SBIC >>instructions. >> >>page 337: shows GPIOR0 at 0x1E (which implies it IS bit-accessible using >>SBI, etc.) and it shows GPIOR1 at 0x2A and GPIOR2 at 0x2B (which implies >>is IS NOT bit-accessible using SBI, etc.). I believe this is what you >>found, isn't it? >> >>Don >> >>PS - as a side note, it is interesting that at least my PDF reader >>program will not allow "copy & paste" of text in this datasheet ;-) >> >>Dennis wrote: >> >>>The GPIOR0, 1 & 2 do not all respond to the instructions specified. Only >>>GPIOr0 does. I use the LDS and STS with all 3. >>>If you look at the RET and RETI instructions, the stack operations are >>>the >>>same, according to the manual. However, the RET does return to the >>>instruction following the CALL whereas the RETI returns to the >>>instruction >>>at point of interrupt. In the case of the RETI, after much debate and >>>RTFM >>>bull, you have to use a polled type of interrupt. >>>D >>>----- Original Message ----- >>>From: "Don Jackson" <ae5k.radio@gmail.com> >>>To: <AVR-Chat@yahoogroups.com> >>>Sent: Wednesday, August 31, 2005 8:51 PM >>>Subject: Re: Re: [AVR-Chat] Errors in manuals ... >>> >>> >>> >>> >>>>Dennis wrote: >>>> >>>> >>>> >>>>>>>Data sheet definitions are sometimes wrong as are manuals. I found >>>>>>>that >>>>>>>out >>>>>>>the hard way with the mega168. >>>>>>>.... >>>> >>>>Would you be so kind as to let us know what is wrong in the mega168 data >>>>sheet? I'm about to use this one... >>>> >>>>Thanks, >>>>Don
2005-09-01 by John Samperi
At 02:44 PM 1/09/2005, you wrote:
>In a former life, I worked for Motorola Semiconductor
NO SWEARING PLEASE!! :-)
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-09-01 by Ralph Hilton
On Wed, 31 Aug 2005 18:34:49 -0000 you wrote: >--- In AVR-Chat@yahoogroups.com, Thomas Keller <tkeller1@n...> wrote: >> > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is a >> > logic one. >> >> Not according to AVR data sheets, it's not. > >Every AVR datasheet that I've seen describes a positive logic system >for the I/O pins where the most positive voltage is a logic one. What >datasheet are you looking at? > >Don Possibly the confusion arises from a section on fuse bits where the logic is inverted, i.e. set=0. -- Ralph Hilton http://www.ralphhilton.org C-Meter: http://www.cmeter.org FZAOINT http://www.fzaoint.net
2005-09-01 by Dennis
I worked for them from '77-'83. Give me a priortized, vectored interrupt system and I'm a happy camper: :->) D ----- Original Message -----
From: "John Samperi" <samperi@ampertronics.com.au> To: <AVR-Chat@yahoogroups.com> Sent: Wednesday, August 31, 2005 11:51 PM Subject: Re: Re: Re: Re: [AVR-Chat] Errors in manuals ... > At 02:44 PM 1/09/2005, you wrote: >>In a former life, I worked for Motorola Semiconductor > > NO SWEARING PLEASE!! :-) > > > 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 > ****************************************************** > > > > > > > Yahoo! Groups Links > > > > > > >
2005-09-01 by Thomas Keller
On Wed, 2005-08-31 at 22:45 -0500, Dennis wrote: > Clarify. The GPIOR0 is in a different address space from the other 2 > GP > registers. Why? Haven't a clue. Simple. In the original design specifications for the AVR processors, only 64 sequential bytes in the address spacer were allocated for the necessary I/I and control registers. As the architecture matured, and more features (read: gegisters) were added, the register set outgrew the alloted 64 bytes. Atmel decided to implement an extended I/O address space, and, in what I considser to a smart move, opted NOT to change the existing register addressing assignments. Tihs would have led to incredible confusions. Now, perhaps itmight be argued that thery could have considered modifying the I/O addressing instructiosn to also access this extended I/O space, but if I read the data sheet correctly, this would have involved making them take longer to execute (having to read an additional byte to obtain the longer addresses). So, in the intererst of speed and simplicity, they simply did not do this. You address those registers using standard memory access instrcutionsand addressing modes. Some potential for confusion, but NOTHING like what the situation would have been if they had chnaged the register addressing assignments. Compatibility is a good thing, even it if sometimes leads to minor confusions such as this one. Tom
2005-09-01 by David Kelly
On Thu, Sep 01, 2005 at 09:03:53AM -0500, Thomas Keller wrote: > > Now, perhaps itmight be argued that thery could have considered > modifying the I/O addressing instructiosn to also access this extended > I/O space, but if I read the data sheet correctly, this would have > involved making them take longer to execute (having to read an > additional byte to obtain the longer addresses). To do so Atmel would have had to modify the instruction set. An opcode on the AVR is 16 bits. The "argument" is embedded within those 16 bits for SFR codes. Its not just a matter of an additional byte, all instructions are multiples of 16 bits. Flash is actually 16 bits wide (page 16 of ATmega64), but byte addressable. The program counter counts 16 bit words, not bytes. If you look at a disassembly such as generated by avr-objdump byte addresses are listed. But look into the opcodes and one has to double the value to find the disassembled listed value. The 64 address range for SFRs is more heavily ingrained than you suspected. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.
2005-09-01 by Thomas Keller
On Wed, 2005-08-31 at 20:51 -0500, Don Jackson wrote: > Dennis wrote: > >>>Data sheet definitions are sometimes wrong as are manuals. I found > >>>that out the hard way with the mega168. > Would you be so kind as to let us know what is wrong in the mega168 > data sheet? I'm about to use this one... Indeed. I lost an entire potential second career developing micrcontroller-based applications for musem displays as a result of such bad data sheets. In my case, it was Philips. The designer and the veidographer had discovered a commercial DVD player from Philips that included an RS-232 port on the back panel, which coul dbe used to "control" the deck. Then, they found some sweet industrial 3" trackballs from Happ Controls (check them out through Google if you get a chance, some wonderful products), with serial and USB cables. Thought they could just plug the trackballs into the DVD deck abnd have a shole new approach to interactive kiosk control. Didn't work. Why? Well, primarily because the morons at Philips chose to implement an obscure, antiquated mouse protocol known s a"microsoft Mouse Protocol." Bizarre peice of crud, with 7 bits per byte, and bits from different control fields allmixed up throughout the multiple byte control sequences. A real mess. Suffice to sy that thre trackballs were incapable of sending this mess, so they wouldn;t alk tot he DVD decks Enter: me. I spent a few weeks trying to make the trackballs talk to the DVD deck, and quickly realized that without some very expensive diagnostics equipment (which I do not own) and some very expensive engineering time (which they couldn't afford) this was NOT gogin to happen. So, I redesigned their entire Kiosk control system, and used some 8515s to provide an interface. First cointroller worked fine. It simply selected one of 5 menu items and executed it. The other two (three kiosks in all) would NOT work. As the interface on the DVD player was "dumb," (e.g., no acklnowledgemane of data received. If you sent it somehting it didn't understand or like, it simply ignored you) I had no way of knowing WHY it wasn;t working. When I hoooked the controllers up to my PC, and sent the controller output directly to the screen, the "correct" sequence of ASCII characters appeared on the screen. Yet, no response from the DVD decks. Finally, after several months of calling NA Philips and talking to clueless "support techs," I ***FINALLY*** got bumped up a grade, and spoke with a support engineer. I descibed my problem. His response: "OK, so you're sending the ctornl header, then you're sending it a three byte control code, right?" ***HOLD THE PHONE*** ***STOP THE PRESSES*** "THREE byte contorl codes?" "What three buyte control codes?" says I to the engineer. "*DOH* <sounf of forehead being slapped> They still haven't fixed that in the manual, have they?" It turns out that the manual does not specific three bytes ANYWHEER, and worse yet, the example they show in the manual is WRONG< as it shows a command being sent explicitly with a TWO BYTE control code. "I have been pestering them for over a year to change that error" he tells me. Now mind you, we're not talkign abiout expensive printed manuals that would be a bloody hassle and huge expense to change. NO, there manuals are ONLY available as PDF files, downloaded from the NA Philips web site. Cut the chase: as a result of this misinformation, I was unable to meet deadline, despite several 60-90 hour marathons in the museeum overnight, trying desperately to get something to work. and the museum display was forced to open with only two out of three kiosks funcitoning. I managed to think of a workaround the day AFTER the display opened, which helped, but even so. (the workaround was rather clever, once it occured to me. I had to let go of my focus on getting MY controller working, and focus on getting the DISPLAY working. I took the handheld remotes for the DVD players, opend them up, and surgically modified the,m bringing out wires fromthe buttons on their keypads that performed the desired functions. I then wired these buttons to the industrial strength buttons on the consoles of the kiosks, and duct taped (OH, NO! It's another duct tape story!!!!!) the damend remotes down on the shelf in front of thre DVD player, inside the kiosk. Kludgy, but it worked, kept them running for the several more weeks it took me to find the solution and get the working correctly. MY only embarassment at this point is that I should have let go of my ego earlier in the game, and looked for the workaround so that the displays were functioning on opening night. *sigh* I embarassed myself, my friend the videographer, who had brought me in to the project,and worse yet, the professional museum display designer, who had a valuable reputation to uphold. Suffice to say that he won't even talk to me, much less use my services again. And we had been talking about work worth upwards of $65,000/year, prior to this. The response from NA Philips? They have a disclaimer printed in the front of their manuals which disclaims any responsibility for errors, so I can just go fish. Oh...and not too long ago, a 4th version of that DVD deck was released. I went and looked and guess what? **STILL**, over 3 years later, that damned manual has not been corrected! tom Sometimes, even RTFM *AIN'T* enough!!!! )-:
2005-09-01 by Thomas Keller
Chuck Hackett!!!! *WOW* How is your steam locomotive doing!!!!????? Still workgin o n the automatic tmaper project? I'm stil linterested in workig on the controlelr for thast, if you are Tom Keller
On Wed, 2005-08-31 at 17:56 -0500, Chuck Hackett wrote: > > From: Dennis > > > > Data sheet definitions are sometimes wrong as are manuals. I found > that out > > the hard way with the mega168. > > .... > > Hmm, I'm a newbie and I'm starting a project on an mega169 > (Butterfly). Does > the 169 have the same problems? I'd hate to spend hours assuming I'm > wrong and > it's correct ... > > Cheers, > > Chuck Hackett > "Good judgment comes from experience, experience comes from bad > judgment" > 7.5" gauge Union Pacific Northern (4-8-4) 844 > http://www.whitetrout.net/Chuck > > > > > > ______________________________________________________________________ > YAHOO! GROUPS LINKS > > 1. Visit your group "AVR-Chat" on the web. > > 2. To unsubscribe from this group, send an email to: > AVR-Chat-unsubscribe@yahoogroups.com > > 3. Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service. > > > ______________________________________________________________________ >
2005-09-01 by Thomas Keller
On Thu, 2005-09-01 at 07:45 +1000, John Samperi wrote: > At 04:15 AM 1/09/2005, you wrote: > > > Ummm - a low voltage (0v) is a logic zero. A high voltage (5v) is > > > a logic one. > > Not according to AVR data sheets, it's not. > The convention of using logic 0 for 0 volts > and logic 1 for a high (be it 5, 1, 3 12 or 100V) > was established before micro controller were thought > of and therefore it has nothing to do with Atmel. And, like all standards and convetions, it is subject to being abused and/or ignored by any compnay at any time. Witness RS-232-C and IBM, for example. Assuming that a zero volatge is a logical zero will get you into trouble in some systems. I *MAY* be mistaken abut the AVR, but I don't think so. When I was programming the kiosk project I refer to in another (rather long winded) posting I made earlier, I made that error. Couldn't figure out why my controller wasnt doing ewhat I thought it shoudl be, until I realzied I needed to change the sense of my logic. Switched to having ground potential read as a logic one,and Vcc as a logic zero, and everything ran perfectly. tom
2005-09-01 by Thomas Keller
On Thu, 2005-09-01 at 09:28 -0500, David Kelly wrote: > On Thu, Sep 01, 2005 at 09:03:53AM -0500, Thomas Keller wrote: > > > > Now, perhaps itmight be argued that thery could have considered > > modifying the I/O addressing instructiosn to also access this > extended > > I/O space, but if I read the data sheet correctly, this would have > > involved making them take longer to execute (having to read an > > additional byte to obtain the longer addresses). > > To do so Atmel would have had to modify the instruction set. An opcode > on the AVR is 16 bits. The "argument" is embedded within those 16 bits > for SFR codes. > > Its not just a matter of an additional byte, all instructions are > multiples of 16 bits. Flash is actually 16 bits wide (page 16 of > ATmega64), but byte addressable. The program counter counts 16 bit > words, not bytes. If you look at a disassembly such as generated by > avr-objdump byte addresses are listed. But look into the opcodes and > one > has to double the value to find the disassembled listed value. > > The 64 address range for SFRs is more heavily ingrained than you > suspected. Quite. I misspoke when I said additional byte. I should have said "additonal word." My bad, as the script kidiots would say. I do know this. As for your comment, yes, I agree. The 64 byte address range of the SFR instructions is heavily ingrained, and explains why, once Atmel realized the need for additional I/O registers, they opted for the mildly confusing solution they di. Much better than making all previously written code obsolete. One of the (many) joys of programming on AVRs is that, for the most part, code written on one AVR will run with few, if any, modification on ANY AVR (letting aside such things as the various ?MUL* instructions, which not all AVRs support, of course). Minor issues such as 16 bit as opposed to 8 bit interrupt vector tables are the "biggest" hurdle, and that is relatively easy to fix (indeed, it is even possible to easily use a tool like awk to automatically fix it). Tom Viva le AVR!
2005-09-01 by Thomas Keller
On Thu, 2005-09-01 at 09:28 -0500, David Kelly wrote: > On Thu, Sep 01, 2005 at 09:03:53AM -0500, Thomas Keller wrote: > > Now, perhaps itmight be argued that thery could have considered > > modifying the I/O addressing instructiosn to also access this > extended I/O space, but if I read the data sheet correctly, this would > have involved making them take longer to execute (having to read an > > additional byte to obtain the longer addresses). > To do so Atmel would have had to modify the instruction set. An opcode > on the AVR is 16 bits. The "argument" is embedded within those 16 bits > for SFR codes. Yes, that was part of my point. > Its not just a matter of an additional byte, all instructions are > multiples of 16 bits. Flash is actually 16 bits wide (page 16 of > ATmega64), but byte addressable. The program counter counts 16 bit > words, not bytes. If you look at a disassembly such as generated by > avr-objdump byte addresses are listed. But look into the opcodes and > one has to double the value to find the disassembled listed value. Yup. I misspoke, I did know this. You are quite right. > The 64 address range for SFRs is more heavily ingrained than you > suspected. I dunno abou tthat, but it is certtainly heavily ingrained, anmd as I pointed out, I think that ultimately, the Atmel decision on how to handle it was the correct one. Tom
2005-09-02 by John Samperi
At 12:47 AM 2/09/2005, you wrote:
>Witness RS-232-C and IBM,for example.
...................
>shoudl be, until I realzied I needed to change the sense of my logic.
>Switched to having ground potential read as a logic one,and Vcc as a
>logic zero, and everything ran perfectly.
Do you mean that you didn't have an RS232 chip connect to the
AVR? =-O
EVERYBODY :-) knows that the RS232 standard uses -12V for a one
and +12V for a zero ;-) but if you do the right thing and use
the correct interface then 0V is logic 0 again in your system
and don't have to worry what happens outside. Many people make
the mistake of hooking up the RS232 of a computer directly to
the micro's UART pins :-(
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-09-02 by Thomas Keller
On Fri, 2005-09-02 at 10:33 +1000, John Samperi wrote: > At 12:47 AM 2/09/2005, you wrote: > >Witness RS-232-C and IBM,for example. > ................... > >shoudl be, until I realzied I needed to change the sense of my logic. > >Switched to having ground potential read as a logic one,and Vcc as a > >logic zero, and everything ran perfectly. > Do you mean that you didn't have an RS232 chip connect to the > AVR? =-O Why would I have had an RS-232 intercae connected? I was reading a bank of pushbutton switches. > EVERYBODY :-) knows that the RS232 standard uses -12V for a one > and +12V for a zero ;-) but if you do the right thing and use > the correct interface then 0V is logic 0 again in your system > and don't have to worry what happens outside. Many people make > the mistake of hooking up the RS232 of a computer directly to > the micro's UART pins :-( Hooking up a 13 volt bipolar communications line to a 5 volt general I/O pin on a microcontroller would be downright stupid to begin with. But thanks for pointng out, and saving me having to, that there is a erfect example of where a positive voltage is *NOT* a one in standard computing. I defy ANYONE to show me where it is codified that a positive voltage is a logical ONE anywhere in the literature. That is a device specific issue. Tom
2005-09-02 by Chuck Hackett
> From: Thomas Keller > > Chuck Hackett!!!! *WOW* How is your steam locomotive doing!!!!????? Hi Tom, Fine except for the normal repairs, etc. associated with a steam locomotive. We have a meet coming up on the 17th and 18th of this month if you're in the area. > Still workgin o n the automatic tmaper project? I'm stil linterested > in workig on the controlelr for thast, if you are Yes, but, unfortunately, the project isn't ready for microcontrollers (AVRs) yet. I'm still constructing the machinery that they will control. Too many other projects, etc. (life) have conspired against me :-) Cheers, Chuck Hackett "Good judgment comes from experience, experience comes from bad judgment" 7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck
2005-09-02 by John Samperi
At 12:59 PM 2/09/2005, you wrote:
> > >Witness RS-232-C and IBM,for example.
.......................
> Why would I have had an RS-232 intercae connected? I was reading a
>bank of pushbutton switches.
Thousand apologies :-[
You did mention RS232 and having to reverse the logic...
so I ASS U MEd (mainly me in this case :-) )....but you will
be surprised how many people connect RS232 DIRECTLY to the
UART and wonder why is doesn't work. This comes in a way
from some micro controllers that allows you to reverse
the polarity of the signal from the UART giving you in
effect a 5V RS232 port which does work in many modern
PCs but would create smoke in an older RS232 link
which IIRC may go as far as +-25V.
As far as polarity convention I always ASS U ME (that
word again) that we talk about positive logic UNLESS
the manual refers to negative logic. i.e. in/out of
the UART is positive logic whilst the physical RS232
link is in fact negative logic where a positive logic
signal represents a 0.
Have we strayed enough away from the original topic
yet or shall we do a bit more? :-)
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-09-02 by Don Kinzer
--- In AVR-Chat@yahoogroups.com, John Samperi <samperi@a...> wrote: > Have we strayed enough away from the original topic > yet or shall we do a bit more? :-) A topic that is at least tangentially related to the concepts of logic polarity and logic thresholds is that of "active level". A signal can be "active high" or "active low". The usual assumption is that a signal, when asserted, goes to the logic 1 level - that is the meaning of active high. In some cases, it is more convenient to design a circuit so that the signal goes to logic 0 when asserted, i.e. it is active low. It is usually a good idea to denote on a schematic that a signal is active low by adding a slash at the beginning or end of its name. A trailing asterisk is also used for this purpose sometimes. An example of a signal that is typically active low is RESET/.
2005-09-02 by Ken Holt
John - To go one step further OT, I like your word use "ASS U ME" , and would like to contribute " EM BARE ASS". ( "em" meaning "to cause") Ken John Samperi wrote:
>At 12:59 PM 2/09/2005, you wrote: > > >>>>Witness RS-232-C and IBM,for example. >>>> >>>> >....................... > > >> Why would I have had an RS-232 intercae connected? I was reading a >>bank of pushbutton switches. >> >> > >Thousand apologies :-[ > >You did mention RS232 and having to reverse the logic... >so I ASS U MEd (mainly me in this case :-) )....but you will >be surprised how many people connect RS232 DIRECTLY to the >UART and wonder why is doesn't work. This comes in a way >from some micro controllers that allows you to reverse >the polarity of the signal from the UART giving you in >effect a 5V RS232 port which does work in many modern >PCs but would create smoke in an older RS232 link >which IIRC may go as far as +-25V. > >As far as polarity convention I always ASS U ME (that >word again) that we talk about positive logic UNLESS >the manual refers to negative logic. i.e. in/out of >the UART is positive logic whilst the physical RS232 >link is in fact negative logic where a positive logic >signal represents a 0. > >Have we strayed enough away from the original topic >yet or shall we do a bit more? :-) > > >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 >****************************************************** > > > > > > >Yahoo! Groups Links > > > > > > > > >