Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: niemiro on April 26, 2009, 12:34:37 PM

Title: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: niemiro on April 26, 2009, 12:34:37 PM
I recently asked whether if I connected the MOSI pin from an AVR ISP MKII programmer directly to the MOSI pin on an Atmel ATmega328P, did the same for the MISO, SCK and Reset pins, and connected all GNDs and VCCs to a 5V power source, this arrangement would work.

The answer I got back was that it would but it would be a good idea to put resistors and capacitors on the Reset pin and decoupling capacitors on all the GND and VCC pins.

1)   Are all these extras necessary and if so could you please link me to some schematics so that I know how to link the components together and could you please provide exact values of each of the components required i.e. “a 150ohm resistor”?

2)   How far apart are the pins on the AVR ISP MKII programmer? I was looking through my rapid catalogue for DIL headers to slot the target cable from the programmer onto, and Rapid sell two different pitches, 2mm and 2.54mm. Which size shall I buy?

Thanks in advance for any help anyone can provide.

Richard
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: SmAsH on April 26, 2009, 03:38:27 PM
yes, in the last answer i forgot about it but it is somethings good to have a .1uf capacitor across the +5V and gnd lines near the microcontroller V and gnd pins. ive never heard of the one about caps on the reset...
the pins on the avr programmer are 2.54mm or .1". and to the resistors, i cant remember using any resistors unless its a home made programmer which in this case it is not. i really don't think they're necessary.
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: sonictj on April 26, 2009, 10:46:02 PM
a cap (.1uf) between gnd and 5+ is a good idea.  I see it in every $50 robot-esk schematic I've seen.  I also would recommend a 10k resistor connected to reset and 5+.  This is what is called a pull up resistor.  A pull up resistor is used on input pins of a device to set it high by default, and prevent the input from floating.  A pull up is used on the reset pin because reset is a low true input, meaning a reset is triggered when reset is set to ground. 
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: SmAsH on April 26, 2009, 11:54:46 PM
isn't there an internal pup resistor? or is that only for I/O pins?
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: superchiku on April 27, 2009, 12:16:04 AM
eee...betn the 5v and grnd try to use a bigger cap..a cap has many advantages...may be a 100 uf or 200 uf..ur choice...it helps a lot...
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: frank26080115 on April 27, 2009, 08:41:23 PM
isn't there an internal pup resistor? or is that only for I/O pins?

There is
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: airman00 on April 27, 2009, 10:25:06 PM
isn't there an internal pup resistor? or is that only for I/O pins?
There is
so the RESET pin of an AVR microcontroller has an internal pullup?
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: SmAsH on April 27, 2009, 10:55:30 PM
thats what im trying to find out (too lazy to look up datasheet :P)
and superchiku, isnt a big cap only to help with managing the servo noise?
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: Webbot on April 28, 2009, 01:57:58 PM
My understanding is that pullups are only available on IO pins that are configured as inputs. Since the RESET needs to work at all times then I doubt it has one.

Some designs use an external pullup on the RESET pin and others (like $50 robot) don't bother. However: if you have a switch for the power then it is sometimes good to use a resistor and a cap on the reset pin so that contact bounce on the switch doesn't reboot your processor several times when power is turned on. ie have

----5v----------
           |
           |
         Resistor
           |
           |-------------> Reset pin
           |
          Capacitor
           |
           |
--- 0V -----------

So that the cap charges quickly and can still apply power to RESET during the brief moments when contact bounce would otherwise remove it.

As for other caps they are more to do with removing any high frequency spikes, or brief high current draws, on the supply. They don't have anything to do with the programmer connections.
Title: Re: AVR ATmega328P and AVR ISP MKII - Different and last question!
Post by: frank26080115 on April 28, 2009, 04:47:46 PM
page 304 of atmega168 datasheet (under DC characteristics), reset pull-up resistor, minimum 30 kohm, maximum 60 kohm