Yahoo Groups archive

AVR-Chat

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

Thread

Mega2560 chips - using for first time and am looking for coaching :-)

Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-14 by lcdpublishing

Hi guys,

I have been working a bit with BASCOM, STK500, and the mega48,88,168 
chips.  Having good results with all that.  Now I am moving up to a 
whopper - the mega2560 chip which is a whole different world for me 
on a number of fronts.

For mounting, I purchased a Schmartboard which allows me to work 
with the thing (I hope) mechanically.  These are the issues I am 
mostly concerned with....


1) ISP, I have never used ISP yet. It appears as though I just place 
a 6 pin header on my board - wire that to the correct pins (SPI) and 
plug the cable in for programming.  I will NOT be using SPI on my 
project so it looks like those pins will only be used on my project 
as PCINT input pins.  Any comments or suggestions about ISP for a 
first-timer?

2) Coupling, someone suggested there could be coupling problems with 
this chip and the mounting method. I don't know much about 
electronics so I have no idea.  Should I just add some 1 uF caps at 
every power entry point to prevent this problem?

3) Is there anything "Different" to watch out for when using this 
chip as compared to the mega48,88,168 chips that I am familiar with?

Thanks for any and all comments and suggestions!

Chris

Re: [AVR-Chat] Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-15 by David VanHorn

>
>
> 1) ISP, I have never used ISP yet. It appears as though I just place
> a 6 pin header on my board - wire that to the correct pins (SPI) and
> plug the cable in for programming.  I will NOT be using SPI on my
> project so it looks like those pins will only be used on my project
> as PCINT input pins.  Any comments or suggestions about ISP for a
> first-timer?


You can use the pins, just put your programming connector so that it's
directly connected to the chip, and resistors in the signals that feed other
devices.  You need to make sure that the programmer "wins" any contention,
easily.   Also watch that activity on those pins won't do anything bad in
your hardware, like activate motors or something hazardous.


2) Coupling, someone suggested there could be coupling problems with this
> chip and the mounting method. I don't know much about
> electronics so I have no idea.  Should I just add some 1 uF caps at
> every power entry point to prevent this problem?


Oh boy.. Power Decoupling is something you need to take seriously, and 1uF
caps are not a good choice.  This depends on your frequency of operation,
and the actual caps you use, but generally 0.047 at 8 mhz is about right.
If you have any choices, locate the caps at the ground pins on the chip, and
take VCC to the cap, and from there to the chip. (forms an L/C "tee" filter
using the track inductances)

3) Is there anything "Different" to watch out for when using this
> chip as compared to the mega48,88,168 chips that I am familiar with?


Something you might not be aware of, I mention it a lot because the
consequences are SO nasty.. The CKOPT fuse has a default state that enables
a "vittoz mode" oscillator.  You definitely do NOT want this fuse in the
default state!   If you scope the crystal with it in "vittoz mode", you'll
see that the amplitude is about 0.5 VCC.   The chip will skip cycles, baud
rates will be a bit off (always slow) and sometimes the chip will execute
instructions wrong.  Or, if you got "lucky", you'll have just enough
amplitude that everything will work.  Until you get a new batch of chips, or
crystals, or have 10,000 units in production.

Also, crystal caps are determined by the crystal, NOT the chip, and a 22pF
crystal does NOT use 22pF caps.  (2C)-5pF is a good starting point, see the
app notes at Fox for details and a more rigorous treatment.


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

Re: Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-15 by lcdpublishing

David,

Thanks so much for the information.  I believe I am going to be able 
to dedicate the SPI soley for programming - no other functions that 
I need will use those pins.

Uh-oh on the crystals and caps!!! I have always been using the cap 
rating as speced by the Xtal.  For instance if it says 18pF that is 
what I use - I don't know enough to know otherwise.  I would like to 
learn more about that but don't know what "the Fox site" is?


Can you clarify what this means " (2C)-5pF is a good starting "

Sorry, I am pretty much new to electronics and such and have only 
been stumbling my way through some relatively complex projects.  I 
have made some good progress, but electronics is far more complex 
than I ever imagined :-(

Thanks again!

Chris




--- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...> 
wrote:
>
> >
> >
> > 1) ISP, I have never used ISP yet. It appears as though I just 
place
> > a 6 pin header on my board - wire that to the correct pins (SPI) 
and
> > plug the cable in for programming.  I will NOT be using SPI on my
> > project so it looks like those pins will only be used on my 
project
> > as PCINT input pins.  Any comments or suggestions about ISP for a
> > first-timer?
> 
> 
> You can use the pins, just put your programming connector so that 
it's
> directly connected to the chip, and resistors in the signals that 
feed other
> devices.  You need to make sure that the programmer "wins" any 
contention,
> easily.   Also watch that activity on those pins won't do anything 
bad in
> your hardware, like activate motors or something hazardous.
> 
> 
> 2) Coupling, someone suggested there could be coupling problems 
with this
> > chip and the mounting method. I don't know much about
> > electronics so I have no idea.  Should I just add some 1 uF caps 
at
> > every power entry point to prevent this problem?
> 
> 
> Oh boy.. Power Decoupling is something you need to take seriously, 
and 1uF
> caps are not a good choice.  This depends on your frequency of 
operation,
> and the actual caps you use, but generally 0.047 at 8 mhz is about 
right.
> If you have any choices, locate the caps at the ground pins on the 
chip, and
> take VCC to the cap, and from there to the chip. (forms an 
L/C "tee" filter
> using the track inductances)
> 
> 3) Is there anything "Different" to watch out for when using this
> > chip as compared to the mega48,88,168 chips that I am familiar 
with?
> 
> 
> Something you might not be aware of, I mention it a lot because the
> consequences are SO nasty.. The CKOPT fuse has a default state 
that enables
> a "vittoz mode" oscillator.  You definitely do NOT want this fuse 
in the
> default state!   If you scope the crystal with it in "vittoz 
mode", you'll
> see that the amplitude is about 0.5 VCC.   The chip will skip 
cycles, baud
> rates will be a bit off (always slow) and sometimes the chip will 
execute
> instructions wrong.  Or, if you got "lucky", you'll have just 
enough
> amplitude that everything will work.  Until you get a new batch of 
chips, or
> crystals, or have 10,000 units in production.
> 
> Also, crystal caps are determined by the crystal, NOT the chip, 
and a 22pF
> crystal does NOT use 22pF caps.  (2C)-5pF is a good starting 
point, see the
Show quoted textHide quoted text
> app notes at Fox for details and a more rigorous treatment.
> 
> 
> [Non-text portions of this message have been removed]
>

Re: [AVR-Chat] Re: Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-15 by Ken Arck

At 02:25 PM 9/15/2006, you wrote:

>David,
>
>Thanks so much for the information. I believe I am going to be able
>to dedicate the SPI soley for programming - no other functions that
>I need will use those pins.

<---Actually, for ISP programming in the 2560 (and 2561 and 128 for 
that matter), you don't use the MOSI & MISO lines for programming but 
rather UART0's RxD & TxD. But it doesn't matter anyway as most pins 
in the Mega series AVRs, can be used multiple ways - it's just a 
matter of register settings.

Ken

------------------------------------------------------------------------------
President and CTO - Arcom Communications
Makers of the world famous RC210 Repeater Controller and accessories.
http://www.ah6le.net/arcom/index.html
Authorized Dealers for Kenwood and Telewave and
we offer complete repeater packages!
AH6LE/R - IRLP Node 3000
http://www.irlp.net

Re: [AVR-Chat] Re: Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-15 by Leon Heller

----- Original Message ----- 
Show quoted textHide quoted text
From: "lcdpublishing" <lcdpublishing@yahoo.com>
To: <AVR-Chat@yahoogroups.com>
Sent: Friday, September 15, 2006 10:25 PM
Subject: [AVR-Chat] Re: Mega2560 chips - using for first time and am looking 
for coaching :-)


> David,
>
> Thanks so much for the information.  I believe I am going to be able
> to dedicate the SPI soley for programming - no other functions that
> I need will use those pins.
>
> Uh-oh on the crystals and caps!!! I have always been using the cap
> rating as speced by the Xtal.  For instance if it says 18pF that is
> what I use - I don't know enough to know otherwise.  I would like to
> learn more about that but don't know what "the Fox site" is?

Fox makes crystals.

>
>
> Can you clarify what this means " (2C)-5pF is a good starting "

The capacitor value depends on the crystal load capacitance specification.

Leon
--
Leon Heller, G1HSM
Suzuki SV1000S motorcycle
leon.heller@bulldoghome.com
http://www.geocities.com/leon_heller

Re: [AVR-Chat] Re: Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-15 by David VanHorn

>
> Uh-oh on the crystals and caps!!! I have always been using the cap
> rating as speced by the Xtal.  For instance if it says 18pF that is
> what I use - I don't know enough to know otherwise.  I would like to
> learn more about that but don't know what "the Fox site" is?


The Cl spec is NOT the value of the caps to use.
The fox electronics site has some good engineering info, like this file:
http://foxonline.com/pdfs/xtaldesignnotes.pdf



Can you clarify what this means " (2C)-5pF is a good starting "


See "Calculation of load capacitance"  In the case where the caps are equal,
the left term simplifies to 2*Cl

Sorry, I am pretty much new to electronics and such and have only
> been stumbling my way through some relatively complex projects.  I
> have made some good progress, but electronics is far more complex
> than I ever imagined :-(
>
> Thanks again!
>
> Chris
>
>
>
>
> --- In AVR-Chat@yahoogroups.com, "David VanHorn" <microbrix@...>
> wrote:
> >
> > >
> > >
> > > 1) ISP, I have never used ISP yet. It appears as though I just
> place
> > > a 6 pin header on my board - wire that to the correct pins (SPI)
> and
> > > plug the cable in for programming.  I will NOT be using SPI on my
> > > project so it looks like those pins will only be used on my
> project
> > > as PCINT input pins.  Any comments or suggestions about ISP for a
> > > first-timer?
> >
> >
> > You can use the pins, just put your programming connector so that
> it's
> > directly connected to the chip, and resistors in the signals that
> feed other
> > devices.  You need to make sure that the programmer "wins" any
> contention,
> > easily.   Also watch that activity on those pins won't do anything
> bad in
> > your hardware, like activate motors or something hazardous.
> >
> >
> > 2) Coupling, someone suggested there could be coupling problems
> with this
> > > chip and the mounting method. I don't know much about
> > > electronics so I have no idea.  Should I just add some 1 uF caps
> at
> > > every power entry point to prevent this problem?
> >
> >
> > Oh boy.. Power Decoupling is something you need to take seriously,
> and 1uF
> > caps are not a good choice.  This depends on your frequency of
> operation,
> > and the actual caps you use, but generally 0.047 at 8 mhz is about
> right.
> > If you have any choices, locate the caps at the ground pins on the
> chip, and
> > take VCC to the cap, and from there to the chip. (forms an
> L/C "tee" filter
> > using the track inductances)
> >
> > 3) Is there anything "Different" to watch out for when using this
> > > chip as compared to the mega48,88,168 chips that I am familiar
> with?
> >
> >
> > Something you might not be aware of, I mention it a lot because the
> > consequences are SO nasty.. The CKOPT fuse has a default state
> that enables
> > a "vittoz mode" oscillator.  You definitely do NOT want this fuse
> in the
> > default state!   If you scope the crystal with it in "vittoz
> mode", you'll
> > see that the amplitude is about 0.5 VCC.   The chip will skip
> cycles, baud
> > rates will be a bit off (always slow) and sometimes the chip will
> execute
> > instructions wrong.  Or, if you got "lucky", you'll have just
> enough
> > amplitude that everything will work.  Until you get a new batch of
> chips, or
> > crystals, or have 10,000 units in production.
> >
> > Also, crystal caps are determined by the crystal, NOT the chip,
> and a 22pF
> > crystal does NOT use 22pF caps.  (2C)-5pF is a good starting
> point, see the
> > app notes at Fox for details and a more rigorous treatment.
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>


-- 
Feel the power of the dark side!  Atmel AVR


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

Re: [AVR-Chat] Re: Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-15 by Jim Wagner

David -

Crystals and capacitors work this way:

The two caps appear in series ACROSS the cap, and two equal
caps in series have a net value that is one-half either.
But, looking into the IC, there is a stray capacitance of
about 5pf.

So, if the crystal wants a load capacitance of 18pf (this
is the desired cap ACROSS the crystal) of 18pf, therre is
already 5pf there from the chip. That leaves 13pf to be
made up. To have a net 13pf  from the two caps, each needs
to be 26pf (27pf is closest standard value). 

I think (2*C)-5pf is an error and should be 2*(C-5pf).

Jim

On Fri, 15 Sep 2006 18:31:30 -0400
 "David VanHorn" <microbrix@gmail.com> wrote:
> >
> > Uh-oh on the crystals and caps!!! I have always been
> using the cap
> > rating as speced by the Xtal.  For instance if it says
> 18pF that is
> > what I use - I don't know enough to know otherwise.  I
> would like to
> > learn more about that but don't know what "the Fox
> site" is?
> 
> 
> The Cl spec is NOT the value of the caps to use.
> The fox electronics site has some good engineering info,
> like this file:
> http://foxonline.com/pdfs/xtaldesignnotes.pdf
> 
> 
> 
> Can you clarify what this means " (2C)-5pF is a good
> starting "
> 
> 
> See "Calculation of load capacitance"  In the case where
> the caps are equal,
> the left term simplifies to 2*Cl
> 
> Sorry, I am pretty much new to electronics and such and
> have only
> > been stumbling my way through some relatively complex
> projects.  I
> > have made some good progress, but electronics is far
> more complex
> > than I ever imagined :-(
> >
> > Thanks again!
> >
> > Chris
> >
> >
> >
> >
> > --- In AVR-Chat@yahoogroups.com, "David VanHorn"
> <microbrix@...>
> > wrote:
> > >
> > > >
> > > >
> > > > 1) ISP, I have never used ISP yet. It appears as
> though I just
> > place
> > > > a 6 pin header on my board - wire that to the
> correct pins (SPI)
> > and
> > > > plug the cable in for programming.  I will NOT be
> using SPI on my
> > > > project so it looks like those pins will only be
> used on my
> > project
> > > > as PCINT input pins.  Any comments or suggestions
> about ISP for a
> > > > first-timer?
> > >
> > >
> > > You can use the pins, just put your programming
> connector so that
> > it's
> > > directly connected to the chip, and resistors in the
> signals that
> > feed other
> > > devices.  You need to make sure that the programmer
> "wins" any
> > contention,
> > > easily.   Also watch that activity on those pins
> won't do anything
> > bad in
> > > your hardware, like activate motors or something
> hazardous.
> > >
> > >
> > > 2) Coupling, someone suggested there could be
> coupling problems
> > with this
> > > > chip and the mounting method. I don't know much
> about
> > > > electronics so I have no idea.  Should I just add
> some 1 uF caps
> > at
> > > > every power entry point to prevent this problem?
> > >
> > >
> > > Oh boy.. Power Decoupling is something you need to
> take seriously,
> > and 1uF
> > > caps are not a good choice.  This depends on your
> frequency of
> > operation,
> > > and the actual caps you use, but generally 0.047 at 8
> mhz is about
> > right.
> > > If you have any choices, locate the caps at the
> ground pins on the
> > chip, and
> > > take VCC to the cap, and from there to the chip.
> (forms an
> > L/C "tee" filter
> > > using the track inductances)
> > >
> > > 3) Is there anything "Different" to watch out for
> when using this
> > > > chip as compared to the mega48,88,168 chips that I
> am familiar
> > with?
> > >
> > >
> > > Something you might not be aware of, I mention it a
> lot because the
> > > consequences are SO nasty.. The CKOPT fuse has a
> default state
> > that enables
> > > a "vittoz mode" oscillator.  You definitely do NOT
> want this fuse
> > in the
> > > default state!   If you scope the crystal with it in
> "vittoz
> > mode", you'll
> > > see that the amplitude is about 0.5 VCC.   The chip
> will skip
> > cycles, baud
> > > rates will be a bit off (always slow) and sometimes
> the chip will
> > execute
> > > instructions wrong.  Or, if you got "lucky", you'll
> have just
> > enough
> > > amplitude that everything will work.  Until you get a
> new batch of
> > chips, or
> > > crystals, or have 10,000 units in production.
> > >
> > > Also, crystal caps are determined by the crystal, NOT
> the chip,
> > and a 22pF
> > > crystal does NOT use 22pF caps.  (2C)-5pF is a good
> starting
> > point, see the
> > > app notes at Fox for details and a more rigorous
> treatment.
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> 
> 
> -- 
> Feel the power of the dark side!  Atmel AVR
> 
> 
> [Non-text portions of this message have been removed]
> 

---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

Re: [AVR-Chat] Re: Mega2560 chips - using for first time and am looking for coaching :-)

2006-09-16 by Jim Wagner

Agreed.,

Jim

On Fri, 15 Sep 2006 20:46:31 -0400
 "David VanHorn" <microbrix@gmail.com> wrote:
> On 9/15/06, Jim Wagner <jim_d_wagner@applelinks.net>
> wrote:
> >
> > David -
> >
> > Crystals and capacitors work this way:
> 
> 
> I know this.  I think you meant to direct this to
> "lcdpublishing"?
> 
> 
> [Non-text portions of this message have been removed]
> 

---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.