geekhack

geekhack Projects => Making Stuff Together! => Topic started by: WhiteFireDragon on Sat, 08 June 2013, 08:34:57

Title: Programming and flashing firmware (ps2avr)
Post by: WhiteFireDragon on Sat, 08 June 2013, 08:34:57
I already soldered on the main components needed, but I have no idea how to program and flash the firmware to this ps2avr. There is no idiot-proof button to press like phantom or GH60 to flash it. This uses the ATMEGA32A chip, and has ISP headers. I attached the precompiled firmware file at the bottom, but how do I flash it onto the MCU? A guide or step by step instructions would be much appreciated.

I'm the first to build this on GH, but several people just got this PCB as well, so this should help anyone else building one of these in the future.


[attach=1]
Title: Re: Programming and flashing firmware (ps2avr)
Post by: Soarer on Sat, 08 June 2013, 08:45:55
http://www.ladyada.net/learn/avr/programmers.html ;)

If you have a Teensy knocking around, you might be able to get it to do the programming using the LUFA based code - http://www.fourwalledcubicle.com/AVRISP.php

But far simpler to just buy one  :))
Title: Re: Programming and flashing firmware (ps2avr)
Post by: alaricljs on Sat, 08 June 2013, 09:46:59
Did this with the 456GT (http://geekhack.org/index.php?topic=38455.0), lots of fun...

Used this guide (http://dorkbotpdx.org/wiki/teensy_2_0_as_avr_isp_programmer) to get the teensy setup and able to run the Arduino ISP sketch.  An important item was apparently the fuse bit settings, hopefully they provided that info? 

avrdude flags to set fuses:  -U hfuse:w:0xD7:m -U lfuse:w:0x0E:m
Title: Re: Programming and flashing firmware (ps2avr)
Post by: WhiteFireDragon on Sat, 08 June 2013, 15:42:03
^ Thanks! I'll try that out. I already have a breadboard, jumpers, and a teensy to try what you did. Although, I only have a win7 PC so is this still possible? Not going to learn other OS just to do this.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: pasph on Sat, 08 June 2013, 16:03:51
just a question: the controller in the pcb that gon ship has a firmware pre-installed?
Title: Re: Programming and flashing firmware (ps2avr)
Post by: WhiteFireDragon on Sat, 08 June 2013, 16:07:56
No, it's blank, nothing preinstalled. All components and PCB were separate, I had to solder them on the PCB. That's all done, so now I'm stuck at figuring out how to flash the firmware onto the controller.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: pasph on Sat, 08 June 2013, 16:15:29
I think he should warn all his potential buyers about this little detail
Title: Re: Programming and flashing firmware (ps2avr)
Post by: Soarer on Sat, 08 June 2013, 16:17:49
I dunno if it was, but it could still have been programmed if you got it as a kit - it's easy enough for someone to program them while they're loose. Otherwise, what pasph said!

Hell, if all else fails remove the AVR chip and wire the Teensy in instead, for some USB goodness :p
Title: Re: Programming and flashing firmware (ps2avr)
Post by: WhiteFireDragon on Sat, 08 June 2013, 17:01:52
I think he should warn all his potential buyers about this little detail
I dunno if it was, but it could still have been programmed if you got it as a kit - it's easy enough for someone to program them while they're loose. Otherwise, what pasph said!

Hell, if all else fails remove the AVR chip and wire the Teensy in instead, for some USB goodness :p


It was not preprogrammed, I checked before making this thread. How do you program it when it's loose? the pins are too small, and they're also surface-mounted pins, so I can't plug it into prototyping breadboard or clamp a wire on it to flash before soldering.

I soldered one PCB, the other still has loose components. Here's also a size comparison of the pins between the atmega32A chip and teensy. How do I plug in those tiny pins somewhere to program it prior to soldering?

(http://i.imgur.com/Fb9VLqU.jpg?1)  (http://i.imgur.com/0DdF1NS.jpg)  (http://i.imgur.com/pPTNDs6.jpg)
Title: Re: Programming and flashing firmware (ps2avr)
Post by: codyeatworld on Sat, 08 June 2013, 17:04:27
I think he should warn all his potential buyers about this little detail

He told me my PCB will have firmware written.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: pasph on Sat, 08 June 2013, 17:15:04
I think he should warn all his potential buyers about this little detail

He told me my PCB will have firmware written.

Maybe if you buy from him also the soldering service (at least controller + diodes) he preflash it?
Title: Re: Programming and flashing firmware (ps2avr)
Post by: Soarer on Sat, 08 June 2013, 17:22:12
How do I plug in those tiny pins somewhere to program it prior to soldering?

For you, the easiest route now is to solder it and then program it.

For someone sending out kits, it wouldn't be unreasonable for them to buy one of these (http://www.adafruit.com/blog/2013/01/31/new-products-smt-test-sockets-tqfp-44-tqfp-32-and-tqfp-48-breakouts/) (or just the socket part without PCB) and split the cost across all kits.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: alaricljs on Sat, 08 June 2013, 17:37:16
... I only have a win7 PC so is this still possible? Not going to learn other OS just to do this.



Yes, mine is win7 x64.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: WhiteFireDragon on Sat, 08 June 2013, 20:31:40
For someone sending out kits, it wouldn't be unreasonable for them to buy one of these (http://www.adafruit.com/blog/2013/01/31/new-products-smt-test-sockets-tqfp-44-tqfp-32-and-tqfp-48-breakouts/) (or just the socket part without PCB) and split the cost across all kits.

I considered getting one until I saw the $100 price tag that can't be seen at first. That's a relatively simple device too, it's just a breakout board. The only expensive part looks like the bracket.

I'll play around with what alaricljs linked to see if I can get this thing working.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: alaricljs on Sat, 08 June 2013, 20:35:23
Made in Japan!!!!
Title: Re: Programming and flashing firmware (ps2avr)
Post by: mkawa on Sat, 08 June 2013, 20:42:43
there's always soldering it down to a brown dog, then desoldering it when you're done programming :D (lolz)

ps, i really really hate the a87
Title: Re: Programming and flashing firmware (ps2avr)
Post by: hasu on Sat, 08 June 2013, 22:20:52
Made in Japan!!!!

ha, at least Made in Japan usually works as spec they insist :)

This cheap breakout PCB will work instead.
Just push down the chip during programming, without soldering.
http://www.adafruit.com/products/1162
Title: Re: Programming and flashing firmware (ps2avr)
Post by: SmallFry on Sat, 08 June 2013, 22:22:31
You could also pickup a cheap ISP programmer. I don't know why that wouldn't work.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: ItsBc on Wed, 12 June 2013, 00:04:19
The pcb that I sent to WFD was from zenuty by the way, not GON. I don't know if GON's chips are flashed or not. Just wanted to clear that up.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: zenuty on Wed, 12 June 2013, 00:44:02
Basically A87 ps2avr Firmware is completed.

http://ps2avr.sourceforge.net/

firmware_MX_mini_ps2avr_V02.zip : FrimWare V0.2
http://www.kbdmania.net/xe/?module=file&act=procFileDownload&file_srl=6229615&sid=0f631ab9a759002c03b090f387b1fe87


Title: Re: Programming and flashing firmware (ps2avr)
Post by: The_Beast on Sun, 30 June 2013, 01:25:16
So any step by step guides?


My A.87 is just sitting here waiting to be programmed....
Title: Re: Programming and flashing firmware (ps2avr)
Post by: emptythecache on Wed, 03 July 2013, 05:38:14
I don't know if this is relevant to this topic, but how different is this task for the usb a.87 pcb? Is there a guide/firmware around anywhere for that?
Title: Re: Programming and flashing firmware (ps2avr)
Post by: domoaligato on Tue, 09 July 2013, 02:26:32
guys/gals I think maybe I found it. this might be a little late but have a look at this...
http://winkeyless.kr/entry/%EB%B6%80%ED%8A%B8%EB%A1%9C%EB%8D%94%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%9C-%ED%8E%8C%EC%9B%A8%EC%96%B4-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-%EB%B0%A9%EB%B2%95
Title: Re: Programming and flashing firmware (ps2avr)
Post by: alaricljs on Tue, 09 July 2013, 07:47:14
Basically A87 ps2avr Firmware is completed.

http://ps2avr.sourceforge.net/ (http://ps2avr.sourceforge.net/)

firmware_MX_mini_ps2avr_V02.zip : FrimWare V0.2
http://www.kbdmania.net/xe/?module=file&act=procFileDownload&file_srl=6229615&sid=0f631ab9a759002c03b090f387b1fe87 (http://www.kbdmania.net/xe/?module=file&act=procFileDownload&file_srl=6229615&sid=0f631ab9a759002c03b090f387b1fe87)

So an A87 is the same as an MX mini?  If this statement is true, then here's the directions:

DIY ISP (http://dorkbotpdx.org/wiki/teensy_2_0_as_avr_isp_programmer)

Install arduino software, load up the ISP sketch onto your teensy.

C:\arduino-1.0.3\hardware\tools\avr\bin>avrdude.exe -p m32 -c arduino -P com3 -U hfuse:w:0xD0:m -U lfuse:w:0xCF:m -C c:\arduino-1.0.3\hardware\tools\avr\etc\avrdude.conf

C:\arduino-1.0.3\hardware\tools\avr\bin>avrdude.exe -p m32 -c arduino -P com3 -C c:\arduino-1.0.3\hardware\tools\avr\etc\avrdude.conf -U flash:w:firmare.hex:a



Title: Re: Programming and flashing firmware (ps2avr)
Post by: domoaligato on Tue, 09 July 2013, 11:24:06
from what I have been reading you flash all ps2avr based boards the same.
A.87 ps2avr
MX-mini ps2avr
thumb

they just require different hex files.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: Sifo on Wed, 17 July 2013, 23:50:31
EDIT: well... wrong thread
Title: Re: Programming and flashing firmware (ps2avr)
Post by: WhiteFireDragon on Thu, 18 July 2013, 00:11:55
Ok I'm going to turn my teensy into an ISP programmer. Can someone verify my connections are correct to flash?


(http://i.imgur.com/7oVssR6.jpg) (http://i.imgur.com/7oVssR6.jpg)  (http://i.imgur.com/0ds8ZSX.png) (http://i.imgur.com/0ds8ZSX.png)
Title: Re: Programming and flashing firmware (ps2avr)
Post by: ItsBc on Fri, 19 July 2013, 05:28:01
zenuty said he sold this PCB to 20 other people on GH, and they had no problems.  :mad:
where are these 20 other people, did they get their firmware flashed; how?
Title: Re: Programming and flashing firmware (ps2avr)
Post by: Soarer on Fri, 19 July 2013, 06:00:37
Ok I'm going to turn my teensy into an ISP programmer. Can someone verify my connections are correct to flash?

I don't know, but it looks reasonable!
Title: Re: Programming and flashing firmware (ps2avr)
Post by: Kayliss on Fri, 19 July 2013, 07:40:53
zenuty said he sold this PCB to 20 other people on GH, and they had no problems.  :mad:
where are these 20 other people, did they get their firmware flashed; how?


USBtinyISP  :-* I built mine from Zenuty a few months ago.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: GON on Fri, 19 July 2013, 09:47:44
No, it's blank, nothing preinstalled. All components and PCB were separate, I had to solder them on the PCB. That's all done, so now I'm stuck at figuring out how to flash the firmware onto the controller.

just a question: the controller in the pcb that gon ship has a firmware pre-installed?

I think he should warn all his potential buyers about this little detail

PS2AVR's are designed by 괴수가면 of KBDMania.
He preflashed all the chips before he sells them.
I'm not sure what the problem is....

This is why I don't sell PCBs without soldering controller and writing firmware.
So, for my buyers this kind of problem will not happen.

BTW, I think the easiest way I can help WFD is to sell a completely flashed Atmega32A chip.
(Last time at some post, I told this... the problem is shipping. $24 for EMS taking 5-7 days.)
Title: Re: Programming and flashing firmware (ps2avr)
Post by: alaricljs on Fri, 19 July 2013, 09:57:38
Flashing is the easy part, it's getting the right firmware hex that seems to be the problem.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: GON on Fri, 19 July 2013, 10:11:29
This is the latest bootloader and firmware for PS2AVR's.

PS2AVRs now support bootloader that lets users upograde the firmware without an ISP loader, and USB/PS2 combo.

Now the firmware is being tested but almost complete.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: alaricljs on Fri, 19 July 2013, 10:18:25
Will that work on a PCB that didn't originally have the USB design, such as a 456GT?  I did notice a slight component difference.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: boost on Fri, 19 July 2013, 10:18:51
Got this thing...

Title: Re: Programming and flashing firmware (ps2avr)
Post by: WhiteFireDragon on Sat, 20 July 2013, 02:56:56
where are these 20 other people, did they get their firmware flashed; how?

I know a handful are watching this thread, waiting for a dumbed down guide  ;)


He preflashed all the chips before he sells them.
I'm not sure what the problem is....

I have a few of these PCBs from zenuty. As far as I know, the loose atmega chips are completely blank with nothing on them. If they're supposedly flashed, what is on there? Just a bootloader, or the final working firmware? The board is soldered already, and computer does not detect controller once plugged in.
Title: Re: Programming and flashing firmware (ps2avr)
Post by: GON on Sun, 21 July 2013, 03:20:52
where are these 20 other people, did they get their firmware flashed; how?

I know a handful are watching this thread, waiting for a dumbed down guide  ;)


He preflashed all the chips before he sells them.
I'm not sure what the problem is....

I have a few of these PCBs from zenuty. As far as I know, the loose atmega chips are completely blank with nothing on them. If they're supposedly flashed, what is on there? Just a bootloader, or the final working firmware? The board is soldered already, and computer does not detect controller once plugged in.



Most of those who bought PS2AVR PCBs would have had no problem with the PCB.
Just soldering the parts and connecting to PS/2 port is all that needed. The chip is already preflashed with firmware.


Did you connect the PCB to PS/2 port?
PS2AVR was designed to work with PS/2 connection.
(Of course, it works with USB with PS2AVR-EXT module and the latest firmware.)

Some of the PC M/Bs with a PS/2 combo port have compatibility issue with PS2AVR, 356 and 456 kbds.
In fact, my MSI B75-ITX M/B also has that problem.
(I myself didn't know it before making purchase. I will never buy a M/B with a PS/2 combo port again.)
So I connect my PS2AVR kbd through a PS2 hub in genovation 682.

PS2AVR - PS2 Hub - PS/2 Port of my PC

I haven't seen any PS2AVR PCBs with a blank MCU so far...
(I've soldered at least 30 PS2AVR PCBs...)
And never heard that in KBDmania, either.



**Important**
PS/2 itself does NOT support Plug and Play.
You should connect the KBD before you turn on the computer.
(Of course, if you have a PS/2 Hub, that supports Plug and Play.)

If you are to buy Korean custom PCBs and not fully experienced, plz ask the seller soldering and firmware upgrading.
Even in case the seller cannot do it, he can easily find skillful experts in Korea.

In Korean KBD market, who soldered/assembled the PCB/KBD is a very important factor when deciding a purchase.