Author Topic: HELP! Atmel 328p Burning question  (Read 1854 times)

0 Members and 1 Guest are viewing this topic.

Offline blakliteTopic starter

  • Newbie
  • Posts: 8
HELP! Atmel 328p Burning question
« on: September 06, 2014, 10:44:51 am »
When I ordered an Arduino I was waiting so long for the package to arrive fro China that I ended up ordering another. As it was they both ended up appearing on the same day. That is a long winded way to say that I now have a spare 328p IC, and I was looking to put it straight on a breadboard to play around with.

Not having any other way, I loaded the ArduinoISP sketch, wanting to use that to "burn" the chip. I hooked it all up and sort of got things working, however...

When I ran the "Burn Bootloader" in the Arduino IDE, I could write to the chip ok, then if I switched directly to Atmel studio, I could then load in a program without issue, but if I disconnected the power and tried to do the same again, I would get "verification error, first mismatch at byte 0x000000xx" errors.
 Thinking that the problem was due to the clunky setup I had of using an Arduino as a programmer, I got myself a el cheapo USBAsp device, hoping that would fix the issue. Nope, I still get errors when I try and program the IC directly, but if I use the "Burn Bootloader", and then write my program onto the IC, it works like a charm.

I am thinking that I have a problem with the RESET line, but nothing I do seems to make a difference. I have tried putting 1K, 10K, 47K resistors to both +5V and Ground, with no noticeable difference. When I use the IDE to "Burn Bootloader" first, it works every time.

Please can some clever person help ?

 |O
 

Offline blakliteTopic starter

  • Newbie
  • Posts: 8
Re: HELP! Atmel 328p Burning question
« Reply #1 on: September 06, 2014, 01:40:23 pm »
Ok so problem solved... but can anyone tell me why ?

I noticed that I could use the Arduino IDE to use the USBAsp to upload a sketch without issue (I had thought that the IDE could only use the "normal" usb connection for sketches, but then spotted the "Upload with Programmer, under the file menu)

So in Atmel Studio, I specified that same .conf file under the Arduino directory.

 Also trying to use the arvdude.exe under Arduino results in errors about the entry point in the dll, so I am using my own build of avrdude, from the latest sources, and the Arduino config file, which usually results in other errors. Go figure.

Why on earth should this make a difference?   :palm:
 

Offline Rigby

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: HELP! Atmel 328p Burning question
« Reply #2 on: September 12, 2014, 12:23:19 pm »
You want this book.

http://shop.oreilly.com/product/0636920028161.do

It has all the information you're asking about and a hell of a lot more.  This book is amazing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf