atmega 1284 bricked by osc speed change - incorrect fuse selection?

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

I've been using a 328 which I had switched up to use an external 20Mhz xtal, no problem with that change.

Then I moved the project to a atmega 1284 PU (not 1284P PU).

Doc says max speed 20 Mhz.

Changed the div8 to get to 8 Mhz, no issue.

Then tried to change to the 20Mhz xtal as I need 115.2K serial speed, 8 is too slow for that.

 

The options were a little different than the 328 -

I set the clk option (I use a Atmel-ICE programmer) to - EXTOSC_8MHX_XX_16KCK_65MS, to get the longest start up time.

Should this be correct? I'm using the same 2 pin crystal with two 22pf caps that I used on the 328.

 

Wanted to figure out what I have wrong before I destroy another one.

 

The low byte is FF all unprogrammed - this is what I got from a fuse calculator online for 1284P (didn't list a 1284 - no P) and from the list in the ICE -

The Atmel ICE also said the part was a 1284 and not a 1284P - (but I can't find any differences between them online)

 

EXTXtal - which I used for the 328, wasn't listed, so I used EXTOSC.

Can I hook some other type of clock up (and how) to recover this chip? I have 8 and 16 4 pin can oscillators and other xtals.

At this point I'm not sure what it is expecting.

Or do I need to buy the 1284P?

 

Thanks,

David

This topic has a solution.

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

After checking all the connections and the fuse bits for the umpteenth time. I removed the xtal, checked the caps for shorts and put in a new xtal.

After changing the speed definition, my program is running with the midi ports working correctly adjusted for the new speed, but three times out of four the ICE programmer fails to programmer the chip - mostly dies on verify,

though the program is running. And can only read the chip to get the info about half the time.

Is this running to close to the limit?

But it seems to be more of an issue with the programmer, the program in the chip keeps humming right along. (It is putting out a note sequence as a midi out test at the moment.)

Is  the full 20 Mhz too much?

 

Thanks,

David

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

There is a problem with the 1284 which seems to manifest itself when using serial ports and a low-swing clock, an external crystal, and high speeds. Have a search here and you'll find previous discussions. The solution is to use the full-swing mode.

 

I use the 1284 in a commercial product, at 20MHz, and as long as I go full-swing I get no problems.

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

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

The difference being CKSEL3? Being 0 instead of 1 as I have it?

I couldn't tell from the datasheet if 'full swing' referred to xtal type or using an external oscillator. What makes a crystal full swing or low??

Full swing :        cksel 0111 sut 11

Ext Crystal osc:  cksel 1111 sut 11 (what I programmed)

 

Either can be used with 2 pin external crystal?

 

Thanks!

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

grnbriar wrote:

The difference being CKSEL3? Being 0 instead of 1 as I have it?

 

Yes.

 

grnbriar wrote:

I couldn't tell from the datasheet if 'full swing' referred to xtal type or using an external oscillator. What makes a crystal full swing or low??

 

Full swing refer to the amount of 'drive' given the external (2-pin, passive) crystal. Full swing as opposed to low power.

 

It's section 9.4 in the datasheet.

'This forum helps those who help themselves.'

 

pragmatic  adjective dealing with things sensibly and realistically in a way that is based on practical rather than theoretical consideration.

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

There is an issue of noise on the RXD pin(s) with the 1284P running at 20 MHz.

A resolution seems to be placing a low pass filter on the RXD line.

 

atmega1284p UART Rx glitch http://www.avrfreaks.net/forum/atmega1284p-uart-rx-glitch

ATmega1284P memory problem/fix http://www.seanet.com/~karllunt/1284pmemprob.html

 

This may not apply to the 1284 (non-P).

 

Stan

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

After replacing the crystal and using the full swing setting it is up and running fine. Thanks everyone!

And I've had no problem using the 115.2K baud to the serial LCD touchscreen at 20 MHz, even though there is a small error at 20 Mhz.

Once I set up two pins to do the hardware handshaling it requires, it runs fine and I don't loose any of the flood of Moved messages from the touchscreen.

 

So I'm constantly running both usarts - one at 31K and one at 115K with no problem so far.

 

David

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

...using the 115.2K baud to the serial LCD touchscreen at 20 MHz, even though there is a small error at 20 Mhz...

  I need 115.2K serial speed, 8 is too slow for that.

Tell more about this "serial LCD touchscreen" that requires 20MHz.  And why "8MHz is too slow".  Does that mean that my apps with twin 115.2 USART streams running full-tilt-boogie ModbusRTU stacks at 7.3728MHz and are more-or-less loafing -- doesn't really work?!?  Isn't 7.3728 less than 8?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Sorry, it was too slow for me.

 

8 Mhz divides out to have a 7.8 % err for 115.2K baud, so was not useable.

And I needed more speed for my app, but I had to either go slower - 7.3728 divides down to 115.2K with 0% error - it's ideal for the baud rate, or faster.

The max speed recommended is 20 Mhz for the 1284, which gives a 1.4 % error for that baud rate, which SHOULD work, so I tried it and it has worked fine.

 

The touchscreen requires 115.2K baud rate (its start up default), not 20 Mhz.

My comment was meant to be that I was getting the 115.2K baud working correctly with the atmega running at 20 Mhz in spite of the small error it caused in the baud rate.

I just needed the max speed from the 1284 to allow me to handle more voices in my processing loop.

 

I'll see how much I can do per loop as I go.

Both the Touchscreen and Midi serial ports are running fine, no problems, even with the known baud rate error, which is in range, but you never know until you try. :)