Author Topic: how can I cheat (and use arduino micro knockoff)  (Read 6163 times)

0 Members and 1 Guest are viewing this topic.

Offline AKmalamute

  • HHKB Scrub
  • Thread Starter
  • Posts: 837
  • Location: Western WA, USA
how can I cheat (and use arduino micro knockoff)
« on: Thu, 25 September 2014, 22:04:15 »
So, I'm using the enabler to build a 60% alps (might take a dremel to the aluminum plate so the stabilized switches can have cherry, and everyone is happy with cherry ...) and I also want to use my $5 microcontroller. But this keyboard has just a few too many row/column combinations ... I can support up to an 8x8 grid of keys, and that's enough keys ... If I pretend that's how they're laid out.

But I'm having a heck of a time visualizing the routing of the rows if I start playing with the columns.

What does it look like when you make several of the columns double back?

HHKB-lite2, Dvorak user

Offline dorkvader

  • Posts: 6284
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: how can I cheat (and use arduino micro knockoff)
« Reply #1 on: Thu, 25 September 2014, 22:58:56 »
bpiphany uses an atmega (32u2 i think) without enough pins and two chips to get the rows colums. Soarer's firmware supports multiplexed output like that, as the ibm pingmaster keyboard uses something of that nature.

the costar replacement controllers are 74HC42.
www.ti.com/lit/ds/symlink/sn54hc42.pdf

reading the datasheet, it takes 4 inputs to directly drive 10 logic outputs, so you would hook these up to the colums to drive a strobe, then hook the rows up to the controller directly. I think you get about 18 pins on the arduino pro micro, so with two of those you'd get 8 pins driving 2 of those chips for 20 colums and the rest of the controller pins hooked up to the rows for a max of 10 there.

if just one chip, you get 4 pins driving 10 colums through the chip, and if you used 5 more pins to get 5 colums past that, you would have 9 left for the rows.

soarer's controller firmware:
http://geekhack.org/index.php?topic=50437.msg1100589#msg1100589

I would hope someone else can weigh in on this is this topic is not a strong suit of mine.

pin names on the arduino pro micro:
« Last Edit: Thu, 25 September 2014, 23:13:06 by dorkvader »

Offline berserkfan

  • Posts: 2136
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
Re: how can I cheat (and use arduino micro knockoff)
« Reply #2 on: Fri, 26 September 2014, 04:32:40 »
Do beware, these are very difficult to put into bootloader mode. Dorkvader's instructions work great on unflashed arduinos, but after the first time they're stuck. I have problems with two chips and am still stuck with them.
Most of the modding can be done on your own once you break through the psychological barriers.

Offline dorkvader

  • Posts: 6284
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: how can I cheat (and use arduino micro knockoff)
« Reply #3 on: Fri, 26 September 2014, 11:21:59 »
Do beware, these are very difficult to put into bootloader mode. Dorkvader's instructions work great on unflashed arduinos, but after the first time they're stuck. I have problems with two chips and am still stuck with them.

I had problems as well until I got the hang of it. I think jdcarpe said the trick: touch the rst pin to the usb housing (gnd) twice about 1 second apart (but no more than three) and then be ready on your computer to quickly press enter on the command to flash them.

I recommend soarer's firmware, as you can reprogram it without flashing. Saves a lot of trouble on these.

Offline berserkfan

  • Posts: 2136
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
Re: how can I cheat (and use arduino micro knockoff)
« Reply #4 on: Fri, 26 September 2014, 14:48:10 »
Do beware, these are very difficult to put into bootloader mode. Dorkvader's instructions work great on unflashed arduinos, but after the first time they're stuck. I have problems with two chips and am still stuck with them.

I had problems as well until I got the hang of it. I think jdcarpe said the trick: touch the rst pin to the usb housing (gnd) twice about 1 second apart (but no more than three) and then be ready on your computer to quickly press enter on the command to flash them.

I recommend soarer's firmware, as you can reprogram it without flashing. Saves a lot of trouble on these.

My problem is, I can't reflash that firmware. Accidentally put v1.20 beta on my 3 arduinos, and after that I could not get two of them into bootloader mode to reflash. And I can't get any version of Soarer to work on my v1.20 beta.
Most of the modding can be done on your own once you break through the psychological barriers.

Offline JPG

  • Posts: 1124
  • Location: Canada (Beloeil, near Montreal)
  • Model F is my new passion!
Re: how can I cheat (and use arduino micro knockoff)
« Reply #5 on: Fri, 26 September 2014, 15:01:32 »
Do beware, these are very difficult to put into bootloader mode. Dorkvader's instructions work great on unflashed arduinos, but after the first time they're stuck. I have problems with two chips and am still stuck with them.

I had problems as well until I got the hang of it. I think jdcarpe said the trick: touch the rst pin to the usb housing (gnd) twice about 1 second apart (but no more than three) and then be ready on your computer to quickly press enter on the command to flash them.

I recommend soarer's firmware, as you can reprogram it without flashing. Saves a lot of trouble on these.

My problem is, I can't reflash that firmware. Accidentally put v1.20 beta on my 3 arduinos, and after that I could not get two of them into bootloader mode to reflash. And I can't get any version of Soarer to work on my v1.20 beta.


Well, the first time I tried to load one of there with Soarer code it took me about an hour or maybe 2 to figure out everything, but since that it takes me max 5 minutes and I did 4 total up to now.


For the Soarer code, I prepare my command to be sent to the COMX port. Then I reset the pro-micro buy putting a male/male cable in the rst slot and touching the small hole in the usb plug (once plugged). You need to have the windows device page opened and watch for COM ports used. When you manage to reset it, instead of seeing the normal leonardo thing, you will see Bootloader thing on a different COM port. You look at which port it's using and replace it in your command line. Since the reset last a few seconds, you need to take the time to change your command line, then reset it again, make sure the bootloader thing is on the same COM that you noted (always is for me but I double check) and press enter. This load the Soarer code on it since that's what I try to do, but I expect that a similar command line for other code would work the same.


The most hard part is that when you do it the first time, finding how to reset it and know what to watch might be tricky, but it's really not very hard. You might also need a tool to load the code itself, I don't remember exactly, but I think for me it either came with the Soarer or it was found on the arduino website.


Enjoy!


Note: this was typed on a model F with a pro-micro with Soarer code, so yea it works!
IBM F122, IBM XT F X2, IBM AT F (all Soarer converted), Filco Camo TKL Browns

Offline AKmalamute

  • HHKB Scrub
  • Thread Starter
  • Posts: 837
  • Location: Western WA, USA
Re: how can I cheat (and use arduino micro knockoff)
« Reply #6 on: Fri, 26 September 2014, 15:24:22 »
Oddly, that picture doesn't resemble exactly what I have. Mine has a reset button, like a teensy; up near the RST pin. The rest looks about right.

Anyway, yes I plan on using soarer's code -- I think picking up a serial expander is the way to go; an extra MCP23018 for my next 'dox was only $2 or so (plus shipping! ouch!) so I'm sure I can pick up something suitable.

I haven't flashed it with anything, so I can't say yet whether this particular knockoff is easier, the same or worse than the official boards. Will report back when I have a chance, I guess ...

HHKB-lite2, Dvorak user

Offline jdcarpe

  • * Curator
  • Posts: 8854
  • Location: Odessa, TX
  • Live long, and prosper.
Re: how can I cheat (and use arduino micro knockoff)
« Reply #7 on: Fri, 26 September 2014, 15:44:18 »
Support local business! Use a Teensy instead!

#TeamTeensy #PJRC

http://pjrc.com/teensy/index.html
KMAC :: LZ-GH :: WASD CODE :: WASD v2 :: GH60 :: Alps64 :: JD45 :: IBM Model M :: IBM 4704 "Pingmaster"

http://jd40.info :: http://jd45.info


in memoriam

"When I was a kid, I used to take things apart and never put them back together."

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Posts: 4388
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: how can I cheat (and use arduino micro knockoff)
« Reply #8 on: Fri, 26 September 2014, 15:46:01 »
Support local business! Use a Teensy instead!

#TeamTeensy #PJRC

http://pjrc.com/teensy/index.html

^^This.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich
Order Form for MDC Mouse Pad
Contact Form for questions

IBM F Revival Services Now with VIDEO

Offline berserkfan

  • Posts: 2136
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
Re: how can I cheat (and use arduino micro knockoff)
« Reply #9 on: Fri, 26 September 2014, 16:03:40 »
Do beware, these are very difficult to put into bootloader mode. Dorkvader's instructions work great on unflashed arduinos, but after the first time they're stuck. I have problems with two chips and am still stuck with them.

I had problems as well until I got the hang of it. I think jdcarpe said the trick: touch the rst pin to the usb housing (gnd) twice about 1 second apart (but no more than three) and then be ready on your computer to quickly press enter on the command to flash them.

I recommend soarer's firmware, as you can reprogram it without flashing. Saves a lot of trouble on these.

My problem is, I can't reflash that firmware. Accidentally put v1.20 beta on my 3 arduinos, and after that I could not get two of them into bootloader mode to reflash. And I can't get any version of Soarer to work on my v1.20 beta.


Well, the first time I tried to load one of there with Soarer code it took me about an hour or maybe 2 to figure out everything, but since that it takes me max 5 minutes and I did 4 total up to now.


For the Soarer code, I prepare my command to be sent to the COMX port. Then I reset the pro-micro buy putting a male/male cable in the rst slot and touching the small hole in the usb plug (once plugged). You need to have the windows device page opened and watch for COM ports used. When you manage to reset it, instead of seeing the normal leonardo thing, you will see Bootloader thing on a different COM port. You look at which port it's using and replace it in your command line. Since the reset last a few seconds, you need to take the time to change your command line, then reset it again, make sure the bootloader thing is on the same COM that you noted (always is for me but I double check) and press enter. This load the Soarer code on it since that's what I try to do, but I expect that a similar command line for other code would work the same.


The most hard part is that when you do it the first time, finding how to reset it and know what to watch might be tricky, but it's really not very hard. You might also need a tool to load the code itself, I don't remember exactly, but I think for me it either came with the Soarer or it was found on the arduino website.


Enjoy!


Note: this was typed on a model F with a pro-micro with Soarer code, so yea it works!

It seems most geekhackers are more keen to help than they actually read.

I have flashed successfully using the shorting with RST pin described. It is wanting to get rid of the firmware a second time that is impossible. Once there is firmware on the arduino it won't let you go back to bootloader mode. Why don't you try reflashing all your arduinos with another version of Soarer's firmware to see it you can put the arduino back into bootloader mode. It worked only for one of mine. I am on the verge of sending Dorkvader my arduinos to let him try and see for himself how hard REFLASHING is. NOT flashing for the first time when there is nothing on the arduino.
Most of the modding can be done on your own once you break through the psychological barriers.

Offline Igthorn

  • Posts: 34
Re: how can I cheat (and use arduino micro knockoff)
« Reply #10 on: Fri, 26 September 2014, 16:37:53 »
It seems most geekhackers are more keen to help than they actually read.

I have flashed successfully using the shorting with RST pin described. It is wanting to get rid of the firmware a second time that is impossible. Once there is firmware on the arduino it won't let you go back to bootloader mode. Why don't you try reflashing all your arduinos with another version of Soarer's firmware to see it you can put the arduino back into bootloader mode. It worked only for one of mine. I am on the verge of sending Dorkvader my arduinos to let him try and see for himself how hard REFLASHING is. NOT flashing for the first time when there is nothing on the arduino.

Dorkvader and JPG are right.  It is possible.  I have a blue pro micro clone.  I have flashed it over and over again, switching between TMK and Soarer's Controller firmware.  JPG's description of how to do it is correct.  The window to flash is short, you must have the command line ready and hit enter when the bootloader is active.  If you miss the window, it will just load whatever is programmed and you need to reset it again.  Soldering a switch between RST and GND makes it much easier.  I used one of these and cut it in half.  Then soldered the ends to the pro micro and just plugged a mouse style microswitch into the connector.

The best thing to do if you have 2 pro micros is burn a different bootloader.  LUFA HID or Grendel's boothid work great and make flashing much easier.  You short RST and GND then it goes to the bootloader and waits.

Offline dorkvader

  • Posts: 6284
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: how can I cheat (and use arduino micro knockoff)
« Reply #11 on: Fri, 26 September 2014, 22:05:16 »
The best thing to do if you have 2 pro micros is burn a different bootloader.  LUFA HID or Grendel's boothid work great and make flashing much easier.  You short RST and GND then it goes to the bootloader and waits.
I have like 5 of these back when they were on ebay for $5 shipped. Do you have a link to more info on how I can do this? I think it'd be useful.

Offline Igthorn

  • Posts: 34
Re: how can I cheat (and use arduino micro knockoff)
« Reply #12 on: Sat, 27 September 2014, 00:38:53 »
I have like 5 of these back when they were on ebay for $5 shipped. Do you have a link to more info on how I can do this? I think it'd be useful.

Teensy 2 as an ISP to program a Pro Micro

To use a Pro Micro as an ISP, I left the setup the same and just changed the pin for RESET to 19 (since I had a connector there) from SS.  I used these two images as a reference for the pin numbers; Teensy2 pins (C language) and Teensy2 pins (Arduino).

So I had PF4 on my Pro Micro that had a connector.  Looked up PF4 on the Teensy2 (C language) image and matched it with the Arduino number on Teensy2 pins (Arduino) image to get '19'.  Compiled it in ArduinoIDE then went to the location where it compiled it ("%LOCALAPPDATA%\Temp\build< whole bunch of numbers>.tmp\").  Copied 'ArduinoISP.cpp.hex' to where I had avrdude and flashed it the Pro Micro.  Once the Pro Micro is rebooted, it'll work as an ISP.  Since I used the Teensy 2 setup it appears as 'Teensy 2 USB Serial' in the device manager.

Connecting the Pro Micro ISP to the other Pro Micro is basically the same as Teensy2 as ISP.
PF4 (the pin I selected to act as SS, use whatever you chose) <> RST
SCLK <> SCLK (PB1)
MOSI <> MOSI (PB2)
MISO <> MISO (PB3)
VCC  <> VCC
GND <> GND

Then you can burn a bootloader and change fuses with avrdude.  You must change the fuses to match the size of the bootloader.  The stock bootloader for blue pro micro clones is 4k, LUFA HID is 2k and Grendel's is 1k.

http://www.sowbug.com/post/16644998284/rescue-guide-for-your-adafruit-atmega32u4-breakout
http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega32u4
I used those figure out what I need to change it to.

Notes: DON'T change the fuses to one that disables Serial program downloading (SPI) in the High Fuse presets in the Fuse Calculator.  And don't mess with the lockbit fuses.

Incomplete guide-ish notes to compiling, burning the bootloaders and fuses in the attached zip.  (Mostly so I can go back and remember what I did, but got lazy towards the end and just stopped)
* ProMicro-Bootloaders-WIP.zip (2.69 kB - downloaded 148 times.)
pro-micro.txt === my notes
lufa.txt  === LUFA HID
boothid.txt === BootHID

And that's how I did it.  I probably left out all sorts of info, it could probably be done without Teensyduino, and I really have no clue on what the fuses I set for HWBE and 'Boot Reset vector Enabled' really do  :eek:.  I just took the stock fuses and merged it with what Grendel used here, guessing which parts to keep.  Seemed to work out well, TMK jumps to bootloader when I hit "magic" + pause.

Offline berserkfan

  • Posts: 2136
  • Location: Not CONUS Not CONUS Not CONUS Not CONUS
  • changing diapers is more fun than model f assembly
Re: how can I cheat (and use arduino micro knockoff)
« Reply #13 on: Sat, 27 September 2014, 07:33:40 »
igthorn, I must thank you for your detailed and organized explanation. That said, I am technically untrained and this is truly beyond me. Don't even know there is a meaning to ISP apart from Internet Service Provider. I did notice the short reflashing window, but never got it in practice except once.

 I think we can sum it up as: noobs stay away but pros are ok.
Most of the modding can be done on your own once you break through the psychological barriers.

Offline jacobolus

  • Posts: 3661
  • Location: San Francisco, CA
Re: how can I cheat (and use arduino micro knockoff)
« Reply #14 on: Sat, 27 September 2014, 16:40:25 »
igthorn, I must thank you for your detailed and organized explanation. That said, I am technically untrained and this is truly beyond me. Don't even know there is a meaning to ISP apart from Internet Service Provider. I did notice the short reflashing window, but never got it in practice except once.

I think we can sum it up as: noobs stay away but pros are ok.
I think your summary is way too pessimistic. This stuff takes some effort, but it’s not rocket science. Hop down to your local public library and grab a basic electronics book (or browse around on the internet for resources if you prefer), and start trying to build some simple circuits. Then maybe try some of the various Arduino tutorials around the web. You’ll be a “pro” in no time.

If you google for “ISP microcontroller” you’ll see that ISP = “In System Programming” http://www.ikalogic.com/in-system-programming-isp-for-atmel-chips/