Programming ATmega328PB ispEnterProgMode fail

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

I know i now.. there's a lot of other similar topics and I have searched everything but my problem persists.. and is very strange.

 

I'm trying to program the 328Pon my custom board with ATMEL ICE and AVR MKII, without success. I've tried 3 chips, the problem is exactly the same and more interesting is that I can read the chip and set fuses on first time on every chip but it fails after that. Basically my objective is only to upload the arduino compatible bootloader the first and my board have serial programming after.

 

This were my steps for the first chip

1- Attached the MKII to 328PB chip

2- Went to Atmel Studio -> Device Programming - It reads the device signature and everything seems ok

3- Went to arduino to upload the custom bootloader using that Arduino's feature -> It fails

4- Went again to Atmel Studio and I can't read the device signature anymore.

 

Second try

I thought I fried the chip with some short so I changed the chip and I made exactly the same steps as previous. Same exactly results.

 

Third try

Changed the chip again

1- Attached the  MKII and chip

2- Went to Atmel Studio -> Device Programming - It reads the device signature and everything seems ok

3- Programmed the LOW.SUT_CKSEL fuse to activate my external 8Mhz crystal. -> verified with oscilloscope.

4- Went to arduino to upload the custom bootloader using that Arduino's feature -> It fails

5- Went again to Atmel Studio and I can't read the device signature anymore.

 

I don't understand what may be the problem. What is going on? i'm totally lost on this one..

 

 

Last Edited: Fri. Jul 20, 2018 - 11:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you read the fuses, again, after you have set them?

 

Odds are, one of the fuses you changed did something to "kill" it. So, what are the fuses before you change anything and what are they changed TO. Don't change them, just give us the list of what the AFTER is supposed to be.

 

For example, you COULD have changed the oscillator to External Oscillator when you really intend to have a crystal (which is something like "Ext. Crystal or Resonator"). Doing that will kill it, for sure. If this is it, you can recover them by supplying an external clock signal (just long enough to change the fuses) and set the fuses to what they need to be. There ARE other possible booboos. One is to turn on RSTDISBL; that will also kill it.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Fri. Jul 20, 2018 - 11:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes I can read after setting them. And I only changed to external crystal on third try. It activated it and confirmed with the oscilloscope.

 

It only stops working after trying to upload the arduino bootloader with Arduino IDE. Even the crystal stopped working after this step.

 

It seems that somehow when I've tried to upload the bootloader it changed some fuses or something like that. By default this chip is using a 1Mhz RC internal oscillator.

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

Are you unable to read the fuses after trying to upload the bootloader?  I can easily imagine that Arduino may include fuse changes in the bootloader operation. And, they may well set it to External Resonator (I think most Arduinos do have a crystal). That would kill it unless you have a crystal and a pair of 22pf capacitors connected on the board.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

After trying to upload the bootloader, the chip acts as dead. But this process is never finished, the arduino IDE (avrdude) trows an upload error at the beginning (can't remember what error).

I have the crystal and the small capacitors placed.

 

I think I will change this chip to the normal (old) 328P. I've done it successfully on previous projects.  

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

I too am having problems programming the 328PB.

Interestingly when I change device from the 328P to 328PB in the programming tools it changes the ISP clock to 458KHz..  I can't get it to  'stick' to 125KHz.

I don't think this is the actual problem but I'm trying to bring 3 new boards all with the 328PB and the ICE wont connect..  yet I do have a board that does work.

There's nothing connected to the  ISP port except my programming header and the reset has a 27k pull up as I normally do.

I have two ICEs both behave the same.

Anyone else suffering with 328PB?

 

 

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

rowifi wrote:
I can't get it to  'stick' to 125KHz.
A work-around is atprogram.exe

Atmel Studio 7 - Command Line Utility (CLI)

 

"Dare to be naïve." - Buckminster Fuller

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

Try programming something simple in studio, like blinking an led or just toggling a pin...can you down load THAT properly & see it working?  If so, then you know the problem is on the Arduino side of the equation.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!