How to build?

Talk about (almost) anything

Re: How to build?

Postby aderp1 » Wed Dec 17, 2014 10:43 pm

The ATmega328P-PU arrived and it only has 28 pins. I'm assuming that it won't work?
aderp1
 
Posts: 21
Joined: Sun Apr 27, 2014 7:24 pm

Re: How to build?

Postby Myndale » Thu Dec 18, 2014 9:49 pm

aderp1 wrote:The ATmega328P-PU arrived and it only has 28 pins. I'm assuming that it won't work?


It will work fine if you modify the Gamebuino library to ignore those A6/A7 analog pins and recompile any games you want to play on it.

One problem you will encounter is uploading the Gamebuino bootloader. When the Arduino IDE uploads the bootloader it checks the chip ID to safeguard against the user accidentally bricking whatever device they've plugged in. If the chip doesn't report the exact IDE it's expecting then this step will fail. Unfortunately the tool that the IDE uses (avrdude) doesn't take into account all the 328p variants, including the PU, even though it's basically the same chip. There are 2 ways around this:

1) Modify the IDE's version of avrdude to fool it into thinking your PU has the signature it's expecting. To do this simply open up arduino-1.0.5\hardware\tools\avr\etc\avrdude.conf with notepad and search for the "ATmega328P" section, you'll find a line containing the text "signature = 0x1e 0x95 0x0F;" Change those bytes to whatever the IDE tells you the chip is identifying itself as (been a while since I've done this but for the PU I think it was "0x1e 0x95 0x14"). Restart the IDE and try again, you should be able to now burn the bootloader on your PU (don't forget to change those bytes back again).

2) Alternatively just call the avrdude utility yourself and pass in the parameter to ignore the signature, something like this:

C:\arduino-1.0.5\hardware/tools/avr/bin/avrdude -CC:\arduino-1.0.5\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\\.\COM15 -b19200 -e -F -Uflash:w:"somepath\gamebuino_boot.hex":i

If that doesn't work then enable verbose output in the IDE, try to burn the bootloader and copy whatever it's trying to do but add the -F flag to disable the signature check.

Once the bootloader is uploaded you don't have to worry about any of this because you can upload via USB, which doesn't do any signature checking.
Myndale
 
Posts: 507
Joined: Sat Mar 01, 2014 1:25 am

Previous

Return to General forum

Who is online

Users browsing this forum: No registered users and 16 guests

cron