having problems uploading with new MC

Hi Professionals,

I am a total beginner, but I am proud to say I recently, thanks to this Forum, got a standalone Atmega 168PA going, everything worked perfectly.

Now I accidentally ordered a bunch of Atmega168PB 's and I can't even get to boot-loader nor upload with an external uploader. I attached the error message at the bottom.

It says I didn't select the right micro controller. (I tried and selected other ones, just to see but no luck)

I am sure it's just a simple thing, that I am missing.

Thank you guys for your help

ERROR MESSAGE:

Arduino: 1.6.1 (Windows 7), Board: "Arduino Mini, ATmega168"

Build options changed, rebuilding all

Sketch uses 1,030 bytes (7%) of program storage space. Maximum is 14,336 bytes.

Global variables use 9 bytes (0%) of dynamic memory, leaving 1,015 bytes for local variables. Maximum is 1,024 bytes.

avrdude: Expected signature for ATmega168 is 1E 94 06

Double check chip, or use -F to override this check.

Wrong microcontroller found. Did you select the right board from the Tools > Board menu?

This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.

The 168PB is not a direct replacement for the 168PA. They are not pin compatible. You will probably need to do some board modifications for this.

See the Atmel document, http://www.atmel.com/Images/Atmel-42374-Differences-between-ATmega48_88_168-variants-and-the-new%20ATmega48_88_168PB_APNote_AT06609.pdf

Oh dang, I want a 328PB drool

168pb at mouser http://www.mouser.com/ProductDetail/Atmel/ATMEGA168PB-AU/?qs=%2fha2pyFadugRfkp7lkJNLcdh4BypYuX8rs6cF%252bIsNoOB0yzsW6iROQ%3d%3d and digikey for more http://www.digikey.com/product-search/en/integrated-circuits-ics/embedded-microcontrollers/2556109?k=atmega168pb

No DIPs. No 328PB yet.

The 168PB is not a direct replacement for the 168PA. They are not pin compatible.

It's not that bad. It looks to me like you should be able to put a PB onto a PCB designed for a PA; a couple of the newly-available IOport bits will end up connected to supply voltages, but that should be OK. (OTOH, putting a PA on a PCB designed for a PB (without power on those IO pin locations) is much less likely to work.)

Thanks for your help, hiduino, DrAzzy, CrossRoads and westfw. I really appreciate you guys!!!

so I desoldered and bendup Pin 3 and 6 (GND, VCC) and tried it again. Unfortunately, I got the same error message (see bottom)

any suggestions I could try?

Thank you so much

Error Message

Arduino: 1.6.2 (Windows 7), Board: "Arduino Mini, ATmega328"

avrdude: Expected signature for ATmega328P is 1E 95 0F

Double check chip, or use -F to override this check.

Wrong microcontroller found. Did you select the right board from the Tools > Board menu?

This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.

The mega168pb is a different mcu so it has a different device signature, 0x1e9415.

You will need to update avrdude.conf to include a definition for this.

You will also need to update the AVRtoolchain to the latest version, avr-gcc v4.8.1. Which added support for the mega168PB.

It's the same principle as using an ATmega328 instead of an ATmega328p, except in that case there are fewer actual differences. If I was not using the new features, I might: 1) modify the avrdude config file to think the new signature belonged to the 168A. 2) upload a 168A bootloader 3) tell the IDE I had a 168A.

(Note that if you don't do this, you'll also need a new bootloader.) (OTOH, I think IDE 1.6.x already has gcc4.8.1+)

Thanks Hiduino and Westfw, I think it is working now. Have to do a little more testing to see if stable. Your help was awesome, I really appreciate you. Have a fantastic weekend

daflogotit: I think it is working now. Have to do a little more testing to see if stable.

Did it all work out well? These 168PB are so much cheaper than the 168A, and from that differences document they're code compatible (backwards, not forwards). Was there any downside to the plan outlined by westfw now you've tried it?

Thanks, Geoff

Hi Geoff,

I'm just a newbe, so my codes are very simple. for that it works good. I can't say if it will work for more complex codes. The only thing I have noticed sometimes it takes a couple tries to upload. hope that helps you

I bought a 328 instead of 328p by accident. For avrdude I just use the -F option so it will ignore what it thinks is the wrong signature. For the IDE I edited avrdude.conf. It's annoying though since I go back and forth between this part and an Uno, so I'm constantly editing avrdude.conf.

Next time I put in an order I'm going to include a 328p and put the 328 in the back of the drawer.

You can currently buy the 168PB cheaper than an ATtiny85 and in that 32pin SMD package takes up very similar real estate. I can see this as being a very useful option. Will have to get a pack and check them out.

Geoff

Can you not simply copy/ adjust an entry in boards.txt to readily select for the IDE which chip you happen to be using at a given moment?

mrburnette:
But the 168PB @ 1.41 each + shipping is just silly when one can buy a 328P 16MHz board for $2.09 USD - delivered.

Hi Ray,I get what you’re suggesting and would agree with you for the most part. But in this case our oversized prototype is based around one of those, and now we need to get the size down further and reduce it to just one PCB. The end result will be about that size all up. And until I found this uC we were considering moving to SMD ATtiny84 but this is even smaller, and as a bonus, cheaper and more capable too.

The ATmega168PB would be delivered $1.81 AUD ($1.38 USD according to google currently) including our local 10% GST. That maths is looking very good from where I’m sitting, even after adding a few sub-1cent passives to make the thing fully functional.

Cheers!
Geoff

Hi guys

I've received my first few 168pb, and about to finalise a test PCB to order for this.

Is it this part of the avrdude.conf (for 168p rather than 168a as noted above) where I change the signature for this magic to occur?

#------------------------------------------------------------
# ATmega168P
#------------------------------------------------------------

part parent "m168"
    id              = "m168p";
    desc            = "ATmega168P";
    signature       = 0x1e 0x94 0x0b;

    ocdrev              = 1;
;

Or is it in the signature of the parent ATmega168 block?

Thanks Geoff

I would copy that whole 168P section, give it a new name, and update the signature byte:

ATmega168PB 0x1E 0x94 0x15

So:

part "m168pb" id = "m168pb"; desc = "ATmega168PB"; signature = 0x1e 0x94 0x15; and call out the m168pb into a new board type so you can have both.

Thanks Bob - on the board I want to use the internal 8MHz clock, so making it another CPU menu option of lillypad was my thought for this. Am I on the right track?

Geoff

Lilypad as a starting point, sure if they use internal 8 MHz. Or just go here and determine what you need directly. www.engbedded.com/fusecalc/

And, 168PB is not on the list. 168P should work.