Amtel studio 7 setting external crystal to 20Mhz on atmega324PB

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Guys,

 

I'm transitioning from Arduino IDE to studio 7 and trying to set the fuses for an Atmega324PB so that it will use a 20Mhz external crystal.  I've spent the last 2 days trying to figure it out with no success.

 

The PCB works with the mightycore set at 20Mhz and I've now added a JTAG interface for better debugging which I also understand will prevent me 'bricking' the chip if I get the clock settings wrong.

 

For the life of me, I can't figure out how to set the chip clock speed within Studio 7 (tools/device programming/Fuses).

 

Can some kind soul give me some pointers?  The data sheet for the 324PB is not helpful

 

Regards

 

This topic has a solution.

 

 

Last Edited: Thu. May 16, 2019 - 04:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Post the fuses windows so that we can see what you have now. Usually uncheck the CKDIV8 fuse and set for external CRYSTAL and NOT OSCILLATOR.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Atmega324PB  can't run  @20MHz with a crystal, it's one of the chips where high power crystal osc. don't work.

 

Either run up to 16 MHz, or feed it with 20MHz, or buy a Atmega324P  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ooops din't see the PB bit...blush

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, don't follow.  As mentioned, I'm already running the chip with a 20Mhz crystal but using the arduino mightycore and it's running just fine, so I'm a little confused.

 I need 32 GPIO + TWI + SPI so don't think the 324P will work.

 

I guess I could put a chip into one of my test sockets and load the mightycore fuses, the connect to studio 7 and read the fuse settings there.

 

regards

 

 

 

Last Edited: Sun. Apr 28, 2019 - 09:24 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are running the chip with a 20MHz crystal then it is out of spec because it doesn't have full swing mode oscillator like previous models. See 10.4 Low Power Crystal Oscillator

 

Also Table 10-7. Low Power Crystal Oscillator Operating where it shows a maximum of 16MHz, you can run at 20MHz but you must have a full external clock generator and not just the crystal.
 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, I just saw the specs that it ran at 20Mhz and assumed all was well. indecision   I'll change the crystal.  That still leaves me stumped as to how to set the clock speed from with Studio 7 though

 

regards

 

 

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Do you know how to get toe the programming window? I know, silly question but one never knows. smiley

 

I don't have that chip so I use the simulator.

 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, yes familiar with that screen.  My confusion is what to select for 16Mhz.  That's showing only 8Mhz.  Presumably  there's another setting to consider?

 

regards

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Read it again. It doesn't say "8.0", it says "8.0-". The '-' is significant - it means 8MHz "and above"

 

When you set the fuses (apart form the internal oscillator) you aren't saying "go at this very specific speed". You are only saying "use this as a clock source". It's what the actual speed of "this" (ie crystal or whatever) is that really determines the speed. So if you set the fuses here to "8.0-" and then attach a 9MHz crystal it will run at 9MHz. If you attach a 13MHz crystal it will run at 13MHz and so on.

 

In most traditional AVRs there is a switchover point between 0..8 and 8..N above which the crystal is driven in "full swing" mode (more power to "swing the pendulum"!) but some of these newer PBs ones seem to have a cost cut in their design or something which removes that facility.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gotcha,  Many thanks

 

regards