I need help programming an ATMEGA48A

As the title says I need some help programming the ATMEGA48A as used in this mod:
http://nfggames.com/forum2/index.php?topic=5744.0

I've got all the boards assembled but I completely missed the part about you having to use an external programmer to flash the ATMEGA chip. I wish this would have been clearer in the guide... I thought it could all be handled through the USB :(

I need a cheap method to program this using the 6-Pin ISP pinout on the board. USB connection is required, I really don't want to mess with COM or Parallel-ports (which my PC doesn't have) :)

Not sure if alternatives are available, but I do own an Arduino Uno dev board, Raspberry Pi 2 and a Xilinx Platform Cable USB. But I'm not sure if any of these could be used for the job, instead of buying another programmer.

Any help would be greatly appreciated :)
If you're not going to buy an EPROM programmer, pay someone to program a chip for you.

@Bad_Ad84 actually lists a blank chip programming service in his sales thread.
There is a way to do it using an USB hub... Not really recommended though.

Here is a description for programming an AVR using the Raspi's GPIO pins
Thank you for your suggestions, but like I said, I need to program this using the ISP pins on the board :)

IMG_0209.JPG

EDIT: Unseen, completely missed your second suggestion. Will take a look at that. Thank you :)
You can program a flashing sketch to the arduino too IIRC.

Or you can just buy one of the many cheap USB flashers - they are literally all over ebay for like £2
Sorry to be the bearer of bad news, but the hardware you need is really friggin expensive. Better put a second mortgage on the dog.
Id recommend the USBtinyISP over the USBasp.

Purely because all the USBasp's I have gotten off ebay have needed to be updated (with a programmer that works!) before being able to use them with all chips.

Edit:
Issue described here:
http://www.rogerclark.net/updating-firmware-on-usbasp-bought-from-ebay/
I haven't had that issue with my 2 USBasp's. They worked out of the box. Probably depends on source/batch??
That guide for programming using a Pi seems pretty long-winded - if I were you I'd just buy Adafruit's USBtinyISP programmer or you can get a cheap one from China. I'd recommend AVRDUDESS for programming it; it's a straightforward GUI.
Maybe. But if you don't have any other means to update it, not worth the risk over $1-2 that you still wont be able to use it.

Once you have a working programmer, updating the usbasp is just plugging them into each other
Since you already have an Arduino, that would seem the simplest approach. Just load up the "ArduinoISP" sample and program it to the board then use adrdude with -c avrisp -P <COM port it's connected to>
I should say that I have barely had time to play with the Arduino Uno starter kit I got. I have hooked it up, managed to get a light flashing at various speeds and that's about that :D

That being said I think I'll try this approach first, since having to install Raspbian on the Pi will take some time in itself.

If I undersand correctly I just need to copy the ArduinoISP, which as far as I can see is already in the Arduino-software. And then connect it to a Windows PC and run the adrdude-program, which I should then point to the file I want flashed to the ATMEGA?

Not entirely sure how to check which COM port is being used, as I'm really rusty in Windows, but I assume the hardware information in Windows can tell me this, when I've got the flashed Arduino connected by USB?
yes to all of that
I get the following error. Perhaps someone can help me figure out what is wrong.

Code:
C:\Users\Konsolkongen\Desktop\CDCE9XX_PROGRAMMER_FW_v1>avrdude -c avrisp -p m48 -P COM5 -U flash:w:CDCE9XX_PROGRAMMER_FW_v1.hex
avrdude: stk500_getsync(): not in sync: resp=0xe0
I've got the ISP pins of the target device hooked up to the ICSP pins of the Arduino. I've connected the 3 LEDs to pins 7, 8 and 9.
I don't know if it's necessary but I've wired Reset from the ISP pins on the target device to pin 10 on the Arduino, as this apparently isn't connected on the ICSP pins.

When I try flashing the error light immediately turns red. The COM port is correct according to the Device Manager.
I'm probably doing something stupid :)
That all looks correct - and the connection to the reset pin is necessary.- try rechecking the connections between the Arduino and your target board.
The connections are good. I've got two of these boards with the ATMEGA48, but none of them works.

EDIT: Is the Arduino not able to power the target board using the ICSP pins?

EDIT2: Tried using the offset pinheaders (pins 10-13) on the Arduino just to rule that out. Also powered the target board using it's USB input. But still getting the same error :(
Have you put a capacitor between reset and gnd on the arduino? (10uf or similar)

I remember doing this once and running into loads of problems as well, said capacitor ended up helping. Keeps the uno from resetting itself at the wrong time.
Regardless you should invest a few bucks in one of those cheap USBasp clones off ebay, works every time.
I always use the Arduino as ISP programmer like this:
Code:
"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe" -C "C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf" -c arduino -P COM5 -b 19200 -p m48 -U flash:w:"CDCE9XX_PROGRAMMER_FW_v1.hex"
pause
Just change the paths so they match your Arduino folder and copy paste everything into a flash.bat and be sure that you're using the right COM port. You can find it out using the Arduino IDE.
Never needed any capacitors. Make sure you have an Arduino Uno following the original design. There are some clones with different usb serial chips, they might act differently.
I have tried with the capacitor as well but that didn't help.

Not sure I understand Sanni, what do you mean when you say flash.bat?

The Arduino is an original.
Open Notepad then:
- Copy&paste the two lines into it
- File->Save As...
- File name: flash.bat
- Save as type: All Files (*.*)
You can save it to the desktop and then just double click on it.

Original thread: https://assemblergames.com/threads/i-need-help-programming-an-atmega48a.63566/