Can anyone recommend a good AVR book...
|
|
Thread rating:  |
mrdarrett@gmail.com - 26 Sep 2006 16:30 GMT ... for a beginner?
And what's the difference, anyway, between the AVR and the ATxxxxxxxx series of chips?
TIA
Michael
linnix - 26 Sep 2006 16:36 GMT mrdarr...@gmail.com wrote:
> ... for a beginner? AVR is so simple, you don't need a book. Just get a development kit and go through some examples on line and off line.
> And what's the difference, anyway, between the AVR and the ATxxxxxxxx > series of chips? Which AT? Generally speaking, ATtiny, ATmega and AT90 are similiar AVRs.
> TIA > > Michael mrdarrett@gmail.com - 26 Sep 2006 16:38 GMT > mrdarr...@gmail.com wrote: > > ... for a beginner? [quoted text clipped - 7 lines] > Which AT? Generally speaking, ATtiny, ATmega and AT90 are similiar > AVRs. Ah, so the AT90Sxxxx series is also an AVR... thought it was something completely different.
So, about that book... ;-)
Michael
Joerg - 26 Sep 2006 18:30 GMT Hello Michael,
>>>... for a beginner? >> [quoted text clipped - 11 lines] > > So, about that book... ;-) Seriously, as Linnix wrote, you may not need one. I started with the TI MSP430, thought about buying a book but after taking a look at one I realized how fast some of the contents become obsolete. By the time it's printed there is a slew of new uC variations that are now used by everyone.
Main things to get started: Learn the design environment, play around, try to make the blinky-LED work, try to change blink rates or pattern, load again and so on. Then study the family guide and the data sheet for a long, long time. After that you know all the assembler words the uC of choice understands and what they mean. Even if you never do assembler you need to become familiar with the peripherals on board and how they can affect or impair each other.
If you really want a book recommendation I'd post again at comp.arch.embedded where among many uC experts there is also Ulf Samuelsson from Atmel. I am sure he'd know which books are good. Ulf is very responsive, I wish TI and others would participate as well.
 Signature Regards, Joerg
http://www.analogconsultants.com
mrdarrett@gmail.com - 26 Sep 2006 18:35 GMT > Hello Michael, > [quoted text clipped - 36 lines] > > http://www.analogconsultants.com Ah ok. (Actually until you mentioned it I didn't even notice linnix had replied inline to my first question. Sorry 'bout that, linnix.
:-) Was browsing over at amazon.com and was getting worried about some of the comments the users said...
Michael
Rich Webb - 27 Sep 2006 00:18 GMT >> Hello Michael, [snip...snip...]
>> Seriously, as Linnix wrote, you may not need one. I started with the TI >> MSP430, thought about buying a book but after taking a look at one I [quoted text clipped - 25 lines] >Was browsing over at amazon.com and was getting worried about some of >the comments the users said... The AT90-series were the (AFAIK) "original" processors in the AVR family. That family recently split into the ATmega-series with an enhanced instruction set (and, generally, larger processors) and the ATtiny family that is, well, tiny by comparison.
There is some slop-over, with the relatively new AT90CAN128 chip being an almost identical twin to the ATmega128.
All you really need to get started is, say, an ATmega8, an AVRISP programmer or the STK500 (if you don't have breadboards and bench power supplies handy), a copy of the free AVR Studio, and the device manual. The individual chapters in the manual do a good job of explaining how to tickle the various peripherals. The on-line help in AVR Studio handles the assembler and instruction set.
Like Joerg, I typically approach a new processor with the embedded equivalent of "Hello, world!": get one pin to toggle at an intended rate using one of the chip's timers and an interrupt service routine. That's enough to validate that I grok the toolchain, can create a runnable image and get it loaded, and can sling around the necessary bits to handle ISRs and I/O. From there, the rest is just coding ...
 Signature Rich Webb Norfolk, VA
John B - 27 Sep 2006 09:53 GMT On 27/09/2006 the venerable Rich Webb etched in runes:
> >> Hello Michael, > [snip...snip...] [quoted text clipped - 52 lines] > runnable image and get it loaded, and can sling around the necessary > bits to handle ISRs and I/O. From there, the rest is just coding ... You can also download a demo version of a C compiler from the Imagecraft website. It's free for 45 days and then becomes code limited to 8K which is still fine for the mega8.
 Signature John B
martin.shoebridge - 26 Sep 2006 22:57 GMT Try avrfreaks.net I think there is a tutorial on there.......
> ... for a beginner? > [quoted text clipped - 4 lines] > > Michael jrwalliker@gmail.com - 27 Sep 2006 10:34 GMT The latest version of Atmel's AVR development environment works together with winavr. This means that you can write a C program and single-step it in the simulator, watching register, memory and i/o port values.
One thing to watch out for if you use a serial in-circuit programmer - it is easy to lock yourself out of the device by setting the fuses incorrectly.
In particular, setting the watchdog timer to "continuous" prevents reprogramming of the device or even the watchdog fuse!
John
pbdelete@spamnuke.ludd.luthdelete.se.invalid - 28 Sep 2006 12:30 GMT In sci.electronics.design jrwalliker@gmail.com wrote:
>The latest version of Atmel's AVR development environment works >together with winavr. This means that you can write a C program and >single-step it in the simulator, watching register, memory and i/o port >values.
>One thing to watch out for if you use a serial in-circuit programmer - >it is easy to lock yourself out of the device by setting the fuses >incorrectly.
>In particular, setting the watchdog timer to "continuous" prevents >reprogramming of the device or even the watchdog fuse! What's the remedy for such situation ..?
martin.shoebridge - 28 Sep 2006 14:25 GMT > In sci.electronics.design jrwalliker@gmail.com wrote: >>The latest version of Atmel's AVR development environment works [quoted text clipped - 10 lines] > > What's the remedy for such situation ..? You have to use a parallel programmer to effect an "all fuses" reset........
Simon Dice - 27 Sep 2006 17:53 GMT I Agree with the others, but If you still want a reference book for programming in C the AVRs, I can recomend you this one: Embedded C Programming and the Atmel AVR Authors are Barnett, Cox &Ocull you can get it from B&N
mrdarrett@gmail.com - 27 Sep 2006 18:12 GMT > I Agree with the others, but If you still want a reference book for > programming in C the AVRs, I can recomend you this one: > Embedded C Programming and the Atmel AVR > Authors are Barnett, Cox &Ocull > you can get it from B&N Ok, thanks for the reference.
I think I'll try and build my own programmer. I'll try the ATTINY11-6PC: $0.53 each at Mouser. What a deal! At this rate I can buy more than one, in case I burn it out.
I've found some schematics for a programmer out here: http://www.serasidis.gr/circuits/avrprog/avrprog.htm
I think the pinout is compatible with the AT90S2323, but I'll check the data sheets on the ATTINY11 to make sure...
Questions:
1) For the parallel port, is Pin 1 the pin on the upper-left looking at the Printer Port on the PC, or the upper-left looking at the Printer Cable (IOW, upper-right looking at the PC)?
2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC range), and interface it to the PC via serial port. I know I'll need an ADC, and I can probably get away with using the one on the chip (comparator, right?). Anyone have any schematic for building such an AVR-to-Serial interface?
fwiw, I went over to Borders last night, and even the PIC books didn't discuss in much detail how to interface with the PC. Just only how to interface the programmer with the PC. Sheesh.
Thanks!
Michael
linnix - 27 Sep 2006 18:57 GMT > 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC > range), and interface it to the PC via serial port. I know I'll need > an ADC, and I can probably get away with using the one on the chip > (comparator, right?). Anyone have any schematic for building such an > AVR-to-Serial interface? Yes, a Max232
Here is a battery charger with RS232 and LED read out. The LEDs are time multiplexed and maintain a rather constant brightness across voltage range of 2.4V to 2.8V (two NiMH cells). It's using the Atmega169, but should work with 165 (cheaper) as well. The basic components are:
165/169 Max232 w/ 5 Cs Analog power filter (L, C and 2 R) LM317
SMPS is optional Analog multiplexer is not needed.
http://linnix.com/proto
mrdarrett@gmail.com - 27 Sep 2006 19:06 GMT > > 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC > > range), and interface it to the PC via serial port. I know I'll need [quoted text clipped - 3 lines] > > Yes, a Max232 A Maxim part? From previous threads, I think I should stay away from those...
> Here is a battery charger with RS232 and LED read out. The LEDs are > time multiplexed and maintain a rather constant brightness across [quoted text clipped - 11 lines] > > http://linnix.com/proto Pretty neat! You used a drive bay, huh. I couldn't find the schematics on your site though. I'm mostly interested in the serial output circuitry. Is yours a bit-banger?
Michael
mrdarrett@gmail.com - 27 Sep 2006 19:12 GMT mrdarr...@gmail.com wrote:
> > > 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC > > > range), and interface it to the PC via serial port. I know I'll need [quoted text clipped - 3 lines] > > > > Yes, a Max232 Ah, I think I'm starting to get it. Use a dedicated RS-232 chip. And here I was banging my head against a wall trying to figure out how to build my own.
Well, surprisingly, Mouser actually seems to have a few MAXIM 232s in stock...
Hmm... if I'm going to use an output chip to control my computer interfaces, maybe I should just bite the bullet and look for a USB output chip... any suggestions? ;-)
Thanks!
Michael
linnix - 27 Sep 2006 19:33 GMT > mrdarr...@gmail.com wrote: > > > > 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC [quoted text clipped - 15 lines] > interfaces, maybe I should just bite the bullet and look for a USB > output chip... any suggestions? ;-) The AT90USB128 is almost pin compatible with the 165/169/329/649. Unfortunately, you have to rewire pin 2 to 5 for USB and RS232 to other pins. Actually, we simply bring out the pins to vias and wire them for either chip. This is a lousy design by Atmel. I wish there is a AT90USB128/Atmega649 combo.
> Thanks! > > Michael mrdarrett@gmail.com - 27 Sep 2006 19:59 GMT > > mrdarr...@gmail.com wrote: > > > > > 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC [quoted text clipped - 25 lines] > > > > Michael Looks like the AT90USB128 is about $14 from Digikey. A (Texas Instruments!) MAX232 is about $0.90. For a beginner, I think I'll stick with RS-232. (Should be easier to write the software for the PC side too.)
Thanks a bunch.
Michael
linnix - 27 Sep 2006 20:16 GMT > > > mrdarr...@gmail.com wrote: > > > > > > 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC [quoted text clipped - 30 lines] > stick with RS-232. (Should be easier to write the software for the PC > side too.) We won't be buying that much, but the qty 10K price is $2 to $3.
> Thanks a bunch. > > Michael mrdarrett@gmail.com - 28 Sep 2006 07:57 GMT -=snip=-
> > Looks like the AT90USB128 is about $14 from Digikey. A (Texas > > Instruments!) MAX232 is about $0.90. For a beginner, I think I'll > > stick with RS-232. (Should be easier to write the software for the PC > > side too.) > > We won't be buying that much, but the qty 10K price is $2 to $3. Just curious, where? Digikey wants $9.55 ea, qty 100.
mrdarrett@gmail.com - 28 Sep 2006 08:15 GMT -=snip=-
> > Looks like the AT90USB128 is about $14 from Digikey. A (Texas > > Instruments!) MAX232 is about $0.90. For a beginner, I think I'll > > stick with RS-232. (Should be easier to write the software for the PC > > side too.) > > We won't be buying that much, but the qty 10K price is $2 to $3. Just curious, where? Digikey wants $9.55 ea, qty 100.
linnix - 27 Sep 2006 19:21 GMT mrdarr...@gmail.com wrote:
> > > 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC > > > range), and interface it to the PC via serial port. I know I'll need [quoted text clipped - 6 lines] > A Maxim part? From previous threads, I think I should stay away from > those... OK, I should say TI, ST or Sipex RS232 driver chip.
> > Here is a battery charger with RS232 and LED read out. The LEDs are > > time multiplexed and maintain a rather constant brightness across [quoted text clipped - 13 lines] > > Pretty neat! You used a drive bay, huh. Yes, charging batteries while working on the PC, and logging the charge/discharge behaviours of the cells.
> I couldn't find the schematics on your site though. I don't have one either. I went directly to layout from specs.
> I'm mostly interested in the serial > output circuitry. Is yours a bit-banger? No, the 165/169 has hardware UART on pin 2 (RX) and 3 (TX).
AVR pin 2 to 232 pin 10 and AVR pin 3 to 232 pin 11
> Michael Tim Auton - 27 Sep 2006 22:45 GMT In sci.electronics.design mrdarrett@gmail.com wrote: [snip]
> I think I'll try and build my own programmer. I'll try the > ATTINY11-6PC: $0.53 each at Mouser. What a deal! At this rate I can > buy more than one, in case I burn it out. The ATtiny11 has no RAM, only registers. C really needs some RAM for its stack, or you have to do some funky things to make it work at all. You can't have much fun with just 32 registers to store all your data (this paragraph contains more than 8x that much data). The small ones really are incredibly limited.
Best advice for a hobbyist: Buy big. Considering the cost of shipping, it's a false economy to buy the really low-end chips. You'll end up making another order very soon when you find your first project is larger than you expect. What you though was a saving ends up as being more profit for FexEx.
I'd suggest an ATmega8 (or two) and a few matching sockets - you can then swap the chip from project to project (no need for the sockets if you don't plan to solder stuff together yet, a breadboard is one big socket!). The ATmega8 has a UART, which means it has hardware to make talking to a PC's serial port easier[1]. It has a good amount of RAM and flash, which means you can use things like C's printf function to make life easier (printf and associated gubbins takes up around 2.5K of flash). It has multiple timers, plenty of pins, PWM and a bunch of other stuff you'll soon find you want.
[snipped a question]
> 2) Let's say I want to make a simple AA battery tester (0 to 1.5 VDC > range), and interface it to the PC via serial port. I know I'll need > an ADC, and I can probably get away with using the one on the chip > (comparator, right?). [...] You can use a comparator (gives a signal when one input has a higher voltage than the other) as an ADC, but you have to use it to measure the time it takes for the voltage you are measuring to charge up a capacitor to some reference voltage. You have to provide the capacitor, reference voltage, code to time it accurately, coded to turn that exponentially varying number into a linear voltage and make sure the current you take charging the capacitor doesn't affect what you're trying to measure (this method has a low input impedance - it puts a significant load on what you're measuring, changing it in the process). It takes two pins and you can only measure one voltage with your one comparator. This is not much fun, though it can shave a few cents of the price of your device, which might be worth it if you want to make a million of them. I doubt you want to make a million of them. Buy a chip with a proper ADC built-in; no external components, very little code, more accurate results, multiple inputs which take just 1 pin each and you can connect the pins directly to virtually anything without it affecting what you connect to (the ADC inputs have very high impedance). Don't connect the inputs to anything outside the AVR's supply range (0-5V probably, but you have some choice in the matter) though, or you'll fry it.
For the battery, connect - to circuit ground, + to an ADC input on the AVR. The AVR's ADC can then measure the voltage with half a dozen lines of code. That wouldn't actually make for a great battery tester; there's more to testing batteries than just measuring the voltage, but that's another subject.
> [...] Anyone have any schematic for building such an > AVR-to-Serial interface?
> fwiw, I went over to Borders last night, and even the PIC books didn't > discuss in much detail how to interface with the PC. Just only how to > interface the programmer with the PC. Sheesh. Best to use the serial port, as that's by far the easiest. You might need a USB-serial converter if your PC doesn't have serial ports. Sending raw bytes is most efficient, but you'd then have to write software for the PC to decode those bytes. Much easier to just buy a nice big AVR and use printf to send ASCII text, at least at first. You can then use something like Hyperterminal on the PC and get text output on screen with minimum hassle. You can do clever, efficient protocols and squeeze them into the really cheap AVRs when you've learnt some more.
[1] You will need a MAX232 or equivalent chip to convert the AVR's 0-5V serial port (UART) signals to the +/- 15V RS-232 signals a PC serial port expects - remember to buy the 4 capacitors such chips require too, if you don't have that kind of thing lying around. You need to think about the cable from the chip to the PC as well.
If you haven't already, check out AVRFreaks. There is a lot more there than there may appear to be at first.
http://avrfreaks.net/
Tim
mrdarrett@gmail.com - 27 Sep 2006 23:16 GMT > In sci.electronics.design mrdarrett@gmail.com wrote: -=snip=-
> Best advice for a hobbyist: Buy big. Considering the cost of shipping, > it's a false economy to buy the really low-end chips. You'll end up [quoted text clipped - 11 lines] > flash). It has multiple timers, plenty of pins, PWM and a bunch of other > stuff you'll soon find you want. -=snip=-
Thank you for taking the time to give very good advice to us newbies. I appreciate it.
I think you're right. ATmega8. For about the price of a Six Dollar Burger at Carl's.
Michael
Rich Webb - 27 Sep 2006 23:51 GMT >I think you're right. ATmega8. For about the price of a Six Dollar >Burger at Carl's. Also strongly recommend that you consider getting Atmel's AVRISP programmer. When you're just starting out there are SO many things that could go wrong it's comforting to have confidence that the programmer and its driver (AVR Studio) are off-the-shelf parts and are blessed by the manufacturer, and so therefore slightly less likely to be the source of whichever problem is occurring.
For example, new ATmega8 chips come from the factory set to use the internal RC oscillator. Odds are pretty good that you'll forget to burn the fuse that switches the clock to use an external crystal or clock generator [not that *I* have EVER forgotten to do that <grumble>] and end up with a chip that kinda-sorta works but that won't talk to the PC. Lots of other things can go wrong that cause similar symptoms. Do yourself a favor and start off with one fewer ...
 Signature Rich Webb Norfolk, VA
Michael A. Terrell - 27 Sep 2006 23:57 GMT > I think you're right. ATmega8. For about the price of a Six Dollar > Burger at Carl's. Where?
 Signature Service to my country? Been there, Done that, and I've got my DD214 to prove it. Member of DAV #85.
Michael A. Terrell Central Florida
mrdarrett@gmail.com - 28 Sep 2006 00:36 GMT > > I think you're right. ATmega8. For about the price of a Six Dollar > > Burger at Carl's. > > Where? Where? Wha'dya mean?
If you meant Carl's... Carl's Jr. Hamburger joint. Burgers start at about $3.99 (at least in California).
If you meant the chip...
Digikey: ATMEGA8-16PC: $3.66 Jameco: ATMEGA8-16PI: $5.05 (ok, maybe that's a burger with fries and the Coke :)
Michael
Michael A. Terrell - 28 Sep 2006 03:52 GMT > > > I think you're right. ATmega8. For about the price of a Six Dollar > > > Burger at Carl's. [quoted text clipped - 5 lines] > If you meant Carl's... Carl's Jr. Hamburger joint. Burgers start at > about $3.99 (at least in California). Must be a regional chain. None around here.
 Signature Service to my country? Been there, Done that, and I've got my DD214 to prove it. Member of DAV #85.
Michael A. Terrell Central Florida
mrdarrett@gmail.com - 28 Sep 2006 08:13 GMT > > > > I think you're right. ATmega8. For about the price of a Six Dollar > > > > Burger at Carl's. [quoted text clipped - 7 lines] > > Must be a regional chain. None around here. Wow, you're right!
http://cke.know-where.com/carlsjr/
Well, here's their website: http://www.carlsjr.com/info/map (their main site has a whole lot of Flash, just a heads-up.)
Michael
Michael A. Terrell - 28 Sep 2006 14:19 GMT > Wow, you're right! > [quoted text clipped - 4 lines] > > Michael Around here you get hammered with ads for the two biggies, McDonald's, and Burger King, along with VERY annoying commercials from Checkers. http://www.checkers.com/find.html They are so annoying I either hit the mute button, or turn the TV off.
 Signature Service to my country? Been there, Done that, and I've got my DD214 to prove it. Member of DAV #85.
Michael A. Terrell Central Florida
mrdarrett@gmail.com - 28 Sep 2006 20:47 GMT > > Wow, you're right! > > [quoted text clipped - 9 lines] > Checkers. http://www.checkers.com/find.html They are so annoying I > either hit the mute button, or turn the TV off. Checkers, huh? Don't have those over here. Your Checkers seems really similar to our In-N-Outs over here. (In the Los Angeles area, the In-N-Outs are mostly drive-thru, no dine-in; in Northern California, there's usually a dine-in area like McDonalds, Burger King, etc.)
Any Wendy's, In-N-Out, or Jack-In-The Box over there?
Michael
Michael A. Terrell - 28 Sep 2006 21:39 GMT > > > Wow, you're right! > > > [quoted text clipped - 18 lines] > > Michael Some Wendy's. It started in Ohio, and we get a lot of Ohio snowbirds, so...
BTW, one of the young men who volunteers for my "Computers for Disabled Veterans" project works at a Wendy's restaurant. He does the heavy lifting, and I'm teaching him to repair computers.
 Signature Service to my country? Been there, Done that, and I've got my DD214 to prove it. Member of DAV #85.
Michael A. Terrell Central Florida
mrdarrett@gmail.com - 28 Sep 2006 08:17 GMT > > > > I think you're right. ATmega8. For about the price of a Six Dollar > > > > Burger at Carl's. [quoted text clipped - 7 lines] > > Must be a regional chain. None around here. Wow, you're right!
http://cke.know-where.com/carlsjr/
Well, here's their website: http://www.carlsjr.com/info/map (their main site has a whole lot of Flash, just a heads-up.)
Michael
JeffM - 29 Sep 2006 02:31 GMT mrdarrett@ gmail.com wrote:
>>Carl's Jr. Hamburger joint. Michael A. Terrell
>Must be a regional chain. Chain: yup. Parent corp: Nope.
>None around here. They don't want to be in competition with themselves: http://www.google.com/search?q=Carl-Karcher-Enterprises+including+Hardee's+Green -Burrito+chains
Michael A. Terrell - 29 Sep 2006 03:07 GMT > mrdarrett@ gmail.com wrote: > >>Carl's Jr. Hamburger joint. [quoted text clipped - 8 lines] > They don't want to be in competition with themselves: > http://www.google.com/search?q=Carl-Karcher-Enterprises+including+Hardee's+Green -Burrito+chains The only Hardee's around here closed without notice several years ago. The employees arrived for work to find the locks changed, and the place is still sitting empty. I haven't seen an ad on TV for them for years, either.
 Signature Service to my country? Been there, Done that, and I've got my DD214 to prove it. Member of DAV #85.
Michael A. Terrell Central Florida
BobG - 28 Sep 2006 01:03 GMT Read the forum at avrfreaks.net for an hour. There is an online book at smileymicros.com that describes using the winavr gcc c compiler (free!) and the atmel butterfly eval board (about $20)
jasen - 28 Sep 2006 09:19 GMT > And what's the difference, anyway, between the AVR and the ATxxxxxxxx > series of chips? AVR is a subset of the AT- series
(AT- indicates ATMEL, AVR is some of their products)
AT90- ATTiny- and ATMega- are the AVR parts,
Bye. Jasen
Adrian Jansen - 28 Sep 2006 23:15 GMT > ... for a beginner? > [quoted text clipped - 4 lines] > > Michael Have a look at
http://www.avr-asm-tutorial.net/avr_en/beginner/index.html
That give most of the startup details.
 Signature Regards,
Adrian Jansen adrianjansen at internode dot on dot net Design Engineer J & K Micro Systems Microcomputer solutions for industrial control Note reply address is invalid, convert address above to machine form.
electronic-eng.com - 29 Sep 2006 11:18 GMT I have a list of Atmel AVR books on my website amongst other useful AVR and electronics related information: http://www.electronic-eng.com/books/avrbooks.html
Alan www.electronic-eng.com
mrdarrett@gmail.com - 29 Sep 2006 16:11 GMT > I have a list of Atmel AVR books on my website amongst other useful AVR > and electronics related information: > http://www.electronic-eng.com/books/avrbooks.html > > Alan > www.electronic-eng.com Thanks a bunch!
And thanks to all who replied...
Michael
|
|
|