Author Topic: Making a cheap Model M USB controller  (Read 100926 times)

0 Members and 1 Guest are viewing this topic.

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #150 on: Wed, 03 March 2010, 15:23:52 »
Sounds good. It should be just a different Keymap for a 122key then?

The boards will have a complete firmware on them, including a US ANSI map. It's easy enough for him to flash then before placement apparently. I am assuming he has an automated doohickey to do it.

When I said Manual finishing, I meant at time of manufacture. The boards should be ready to plug in and go, assuming a US ANSI layout.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #151 on: Wed, 03 March 2010, 17:19:45 »
100% of my needed parts are here now.

I'll be playing with laying out parts on the board (the stripboard I have has the copper strips going the 'wrong' direction) and perhaps coming up with photos showing a decent layout for a 122.

Keep in mind that, at least with the original 122-key terminal M design, the controller doesn't mount into a spot on the case...it's screwed onto the metal backplate, so there's some flexibility afforded by that.
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline sethstorm

  • Posts: 257
Making a cheap Model M USB controller
« Reply #152 on: Wed, 03 March 2010, 22:30:18 »
Quote from: kishy;161703
100% of my needed parts are here now.

I'll be playing with laying out parts on the board (the stripboard I have has the copper strips going the 'wrong' direction) and perhaps coming up with photos showing a decent layout for a 122.

Keep in mind that, at least with the original 122-key terminal M design, the controller doesn't mount into a spot on the case...it's screwed onto the metal backplate, so there's some flexibility afforded by that.

That's why I had reservations about going the stripboard route - it being too dependent on layout of the board as well as the wiring.
Current:
IBM: Model M: 1391401, 1386887 Terminal 122 Key 
IBM: Model F: 6110668 Terminal 122 key with Trackpoint and M13 blacks
IBM: Specialty: Wheelwriter 5, Boltmodded.  AT F layout, M technology. 
Lexmark/IBM: M13 Black Trackpoint
NCR:HO150-STD1-01-17 Decision Mate V - The other Gray NCR linear.


Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #153 on: Thu, 04 March 2010, 01:07:38 »
It's just a matter of component placement. The "wires" still go the same way, the schematic hasn't changed. My controller will be significantly smaller than the Prototype (That is why we have prototype's, make it, see it works, improve it. Without the initial prrof-of-soncept, there isn't a 2nd or 3rd revision etc).
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline sethstorm

  • Posts: 257
Making a cheap Model M USB controller
« Reply #154 on: Thu, 04 March 2010, 17:29:33 »
Quote from: InSanCen;161732
It's just a matter of component placement. The "wires" still go the same way, the schematic hasn't changed. My controller will be significantly smaller than the Prototype (That is why we have prototype's, make it, see it works, improve it. Without the initial prrof-of-soncept, there isn't a 2nd or 3rd revision etc).


Indeed.  I just dont like splitting up an already-fragile stripboard just for the alignment.  

Now if there was something a bit more reliable than compressed paper-board to solder onto, I'd be less likely to just skip to the finished boards.
Current:
IBM: Model M: 1391401, 1386887 Terminal 122 Key 
IBM: Model F: 6110668 Terminal 122 key with Trackpoint and M13 blacks
IBM: Specialty: Wheelwriter 5, Boltmodded.  AT F layout, M technology. 
Lexmark/IBM: M13 Black Trackpoint
NCR:HO150-STD1-01-17 Decision Mate V - The other Gray NCR linear.


Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #155 on: Fri, 05 March 2010, 14:32:55 »
Need insight from mnemonix...

When altering the firmware for 122-keys, did you take into account the fact that the ribbon connectors are backwards, with regards to physical connection?

(comparing the beginnings of mine to your finished product, the connectors are in backwards order and it seems to me that means the pins go "20 to 1" instead of "1 to 20" and "8 to 1" instead of "1 to 8")

The only possible fix would have to be in the firmware as it's not physically possible to arrange it any other way. Please investigate. I could be wrong here but before I go much further I want to make sure that's not going to be an issue.
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #156 on: Fri, 05 March 2010, 16:47:26 »
Quote from: sethstorm;161839
Indeed.  I just dont like splitting up an already-fragile stripboard just for the alignment.  

Now if there was something a bit more reliable than compressed paper-board to solder onto, I'd be less likely to just skip to the finished boards.


Fibreglass board.

If Kishy would be so kind as to post a picture...

It's much more substantial than the normal Veroboard. It also doesn't smell.

I'm fine with standard stuff. I built an Amp about 10 years ago on it, and it's still going strong. Hell, my Glass-density analyser for my A Level project (A looooong time ago) is still working perfectly on veroboard (The Final on PCB is still used in a factory today surprisingly enough!)
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #157 on: Fri, 05 March 2010, 16:55:48 »
Quote from: InSanCen;162041
Fibreglass board.

If Kishy would be so kind as to post a picture...

It's much more substantial than the normal Veroboard. It also doesn't smell.

I'm fine with standard stuff. I built an Amp about 10 years ago on it, and it's still going strong. Hell, my Glass-density analyser for my A Level project (A looooong time ago) is still working perfectly on veroboard (The Final on PCB is still used in a factory today surprisingly enough!)

Yes, what he sent me is awesome stuff...it's almost like plastic in the sense that it's got no smell, texture is smooth, thickness uniform, all that stuff.

I'd be happy to post a photo but I've hacked it apart into two pieces for my two controllers. Had been hoping to clean up the rough edge before showing it off...and ideally also finish the board...but oh well, I will anyway, you can all lawl at my bad construction techniques. Decided to go with 'simple' design for the first, LED design for the second.

I gradually realized more and more that I'd have to run a little wire lead for ALL of the FFC connector pins regardless of what I did, so I just threw em on there with no regard for pin alignment with the AVR socket. I highly recommend nobody do it the same way I have, it's going to be very messy with 28 little jump wires in the finished item.

Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline sethstorm

  • Posts: 257
Making a cheap Model M USB controller
« Reply #158 on: Sat, 06 March 2010, 02:39:54 »
Quote from: kishy;162044
Yes, what he sent me is awesome stuff...it's almost like plastic in the sense that it's got no smell, texture is smooth, thickness uniform, all that stuff.

I'd be happy to post a photo but I've hacked it apart into two pieces for my two controllers. Had been hoping to clean up the rough edge before showing it off...and ideally also finish the board...but oh well, I will anyway, you can all lawl at my bad construction techniques. Decided to go with 'simple' design for the first, LED design for the second.

I gradually realized more and more that I'd have to run a little wire lead for ALL of the FFC connector pins regardless of what I did, so I just threw em on there with no regard for pin alignment with the AVR socket. I highly recommend nobody do it the same way I have, it's going to be very messy with 28 little jump wires in the finished item.

Show Image


Looking good.  Is there a way to position things so that you can use ribbon cables to wire up the 'cardedge connector' to the ATMEGA?  It would seem a bit easier that way to keep things together.
Current:
IBM: Model M: 1391401, 1386887 Terminal 122 Key 
IBM: Model F: 6110668 Terminal 122 key with Trackpoint and M13 blacks
IBM: Specialty: Wheelwriter 5, Boltmodded.  AT F layout, M technology. 
Lexmark/IBM: M13 Black Trackpoint
NCR:HO150-STD1-01-17 Decision Mate V - The other Gray NCR linear.


Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #159 on: Sat, 06 March 2010, 08:56:40 »
Quote from: kishy;162015
Need insight from mnemonix...

When altering the firmware for 122-keys, did you take into account the fact that the ribbon connectors are backwards, with regards to physical connection?

(comparing the beginnings of mine to your finished product, the connectors are in backwards order and it seems to me that means the pins go "20 to 1" instead of "1 to 20" and "8 to 1" instead of "1 to 8")


I took the picture of your controller from #37 and the matrix info posted by Specter_57 as a reference. I've seen that, like on the Model M, the connectors are mounted in opposite directions, but the pins are numbered 20...1, 8...1 from left to right (both, on the controller and on the matrix info). So I used the numbering scheme suggested by the numbers on the controller to write down the matrix definition file.

You can check whether or not I messed this bit up by making sure that Left Control is attached to the right-most contacts on the two connectors (corresponding to column 1, row 1) when plugging the matrix sheets to the controller. Similarly, the left-most contacts (column 8, row 20) should go to the Enter key on the numpad. If not, there is some problem...

By the way, I took a closer look a Ripster's Boscom matrix images, and it seems like the Boscom matrix is a bit different from the 1390702 one... (or I got confused by all those labyrinthine lines on the pictures)

Quote from: kishy;162044
The only possible fix would have to be in the firmware as it's not physically possible to arrange it any other way. Please investigate. I could be wrong here but before I go much further I want to make sure that's not going to be an issue.


I've chosen the chip-pin-to-connector assignment so that eight contacts of the 20-pin connector can be attached directly to the pins on the MCU (either rows 20...13 to MCU pins 40...33, or rows 12...5 to MCU pins 29...22). This may or may not be of any help, but at least there are no crossing wires this way.

In case the connections are wrong and need to be rearranged, it is easy to juggle rows and columns around in the firmware. The boot loader may need to be fixed separately then, though; but you have a programmer, so that's not a problem.

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #160 on: Sat, 06 March 2010, 10:19:48 »
Quote from: sethstorm;162089
Looking good.  Is there a way to position things so that you can use ribbon cables to wire up the 'cardedge connector' to the ATMEGA?  It would seem a bit easier that way to keep things together.


Thanks...aside from the burn marks here and there, I think it's not TERRIBLE, just a little amateurish.

Yes, ribbon cables would be feasible, however in a couple segments. Carefully look at the schematics and you'll see not all of the pins are together in continuous blocks. On the overall it'd be possible and a cleaner way to do it, but since I've already prepared all the little jump wires I'll do this one that way. I'm learning from the first build so I can do the second one better.

Quote from: Mnemonix;162116
I took the picture of your controller from #37 and the matrix info posted by Specter_57 as a reference. I've seen that, like on the Model M, the connectors are mounted in opposite directions, but the pins are numbered 20...1, 8...1 from left to right (both, on the controller and on the matrix info). So I used the numbering scheme suggested by the numbers on the controller to write down the matrix definition file.


Looked at original controller again...yes, the silkscreening suggests 20-1 and 8-1. Just gotta hope that means the obvious meaning.

Quote from: Mnemonix;162116
You can check whether or not I messed this bit up by making sure that Left Control is attached to the right-most contacts on the two connectors (corresponding to column 1, row 1) when plugging the matrix sheets to the controller. Similarly, the left-most contacts (column 8, row 20) should go to the Enter key on the numpad. If not, there is some problem...


Alright, so what I'll do is follow the schematic (the later version of simple.pdf) the way I have been to connect those four pins, get some firmware on the bugger and see what happens. Won't be connecting any other wires if those keys don't function right...if they do I may just finish the thing up entirely.

Quote from: Mnemonix;162116
By the way, I took a closer look a Ripster's Boscom matrix images, and it seems like the Boscom matrix is a bit different from the 1390702 one... (or I got confused by all those labyrinthine lines on the pictures)


That could be a problem...though it doesn't make sense why it would change, I did say numerous times we should be ready for possible differences...was really hoping that by saying it I'd eliminate the possibility of it happening though. We'll see what happens I guess.

Quote from: Mnemonix;162116
I've chosen the chip-pin-to-connector assignment so that eight contacts of the 20-pin connector can be attached directly to the pins on the MCU (either rows 20...13 to MCU pins 40...33, or rows 12...5 to MCU pins 29...22). This may or may not be of any help, but at least there are no crossing wires this way.


I had noticed that and thought "AWESOME" but then looked at the size of the stripboard I have and said "DAMNIT". Doing that would have resulted in the 8 pin connector floating in the air beside the stripboard.

BTW the reason the AVR socket is in the middle instead of off to the right is because there will be DIP switches to the right of the socket...DIP switches are 1337, jumpers are for...people who aren't DIPswitchy. Let's just say you can't trust me with the engineering sample order form.

Quote from: Mnemonix;162116
In case the connections are wrong and need to be rearranged, it is easy to juggle rows and columns around in the firmware. The boot loader may need to be fixed separately then, though; but you have a programmer, so that's not a problem.


If fixes are necessary, well, that's the nature of the project I suppose. I'll report back my findings and we can go from there.
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #161 on: Sat, 06 March 2010, 11:17:55 »
Alright, so it's in a state I can program it in, but then I hit a roadblock. AVRDude isn't GUI?!?!

Need help understanding the switches. Windows port has following options:

Code: [Select]
C:\Documents and Settings\Kevin\Desktop\avrdude-5.4-win>avrdude.exe
Usage: avrdude.exe [options]
Options:
  -p <partno>                Required. Specify AVR device.
  -b <baudrate>              Override RS-232 baud rate.
  -B <bitclock>              Specify JTAG/STK500v2 bit clock period
  -C <config-file>           Specify location of configuration file
  -c <programmer>            Specify programmer type.
  -D                         Disable auto erase for flash memory
  -i <delay>                 ISP Clock Delay [in microseconds]
  -P <port>                  Specify connection port.
  -F                         Override invalid signature check.
  -e                         Perform a chip erase.
  -O                         Perform RC oscillator calibration (see
  -U <memtype>:r|w|v:<filename>[:format]
                             Memory operation specification.
                             Multiple -U options are allowed, each
                             is performed in the order specified.
  -n                         Do not write anything to the device.
  -V                         Do not verify.
  -u                         Disable safemode, default when running
t.
  -s                         Silent safemode operation, will not as
                             fuses should be changed back.
  -t                         Enter terminal mode.
  -E <exitspec>[,<exitspec>] List programmer exit specifications.
  -y                         Count # erase cycles in EEPROM.
  -Y <number>                Initialize erase cycle # in EEPROM.
  -v                         Verbose output. -v -v for more.
  -q                         Quell progress output. -q -q for less.
  -?                         Display this usage.

avrdude project: <URL:http://savannah.nongnu.org/projects/avrdude>

Programmer driver is installed and will be using the 1390702 no LEDs files for this. Would someone please give me the complete command (or set of them, I suppose) to go from "blank AVR" to "working 122-key AVR"? TIA!

Edit:
Obtained copy I have here: http://tinkerlog.com/2007/07/15/avrdude-54-for-windows/
If I should be looking elsewhere I'd appreciate the direction.
« Last Edit: Sat, 06 March 2010, 11:20:12 by kishy »
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #162 on: Sun, 07 March 2010, 08:14:37 »
Quote from: kishy;162154
Alright, so it's in a state I can program it in, but then I hit a roadblock. AVRDude isn't GUI?!?!

GUI? Fortunately not. How could you ever automate anything with a program that looks like a point-and-click adventure? :wink:

Anyway, here are the generated command lines for programming an ATMEGA32. The first command is used for programming the fuses (chip configuration), the second and third are used for writing the boot loader and main firmware, respectively, and the last command makes the boot loader section read-only.

Code: [Select]
$ avrdude -p atmega32 -c usbasp -U lfuse:w:0x1f:m -U hfuse:w:0xd2:m
$ avrdude -p atmega32 -c usbasp -U flash:w:boot.hex
$ avrdude -p atmega32 -c usbasp -U flash:w:main.hex
$ avrdude -p atmega32 -c usbasp -U lock:w:0x2f:m

Programming is a quite slow process, so I am usually omitting the third command and use bootloadHID (another command line tool) to flash the main.hex file over the keyboard controller's USB port. You'll need to attach the controller to the rest of the keyboard, however, in order to be able to hold down Escape to activate the boot loader... This is also the way to update the firmware later.

To read out the fuse settings (not required, just for checking if fuses are set up correctly), I use this one:

Code: [Select]
$ avrdude -p atmega32 -c usbasp -U lfuse:r:-:h -U hfuse:r:-:h -U lock:r:-:h
You may need to pass a different string with the -c option if your programmer is not USBasp compatible. The red stick-like programmer should work with exactly these commands.


I hope it works on Windows, too. I've only ever tested this on Linux. It is probably substantially easier to get everything working from scratch on Linux because the required software is either installed there by default or is just an apt-get away.

Note that it is definitely possible to make a working controller by programming the pre-compiled boot loader and firmware images to the MCU, but that there is no binary version of the kbuptool utility program for Windows at the moment. This means that there is no easy way to upload a key map to the controller on Windows, so only the standard QWERTY map will be usable. Someone will need to build the program for Windows to make the controller fully usable.

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #163 on: Sun, 07 March 2010, 11:20:25 »
Alrighty, thanks. I'll toy around with this a bit later (will wire up the FFC connectors first). Yeah, the red stick programmer is usbasp compatible.

Reference to GUI was because I thought I had seen, somewhere in the vast expanses of the internet, a screenshot of a GUI program and a reference to AVRdude together, suggesting the screenshot was of AVRdude. Apparently not.

Oh, a note I should make somewhere, I'm using a segment of twisted pair ethernet cable to give me the wires I'm using in this. It's nice and thin and a quality solid core copper wire. Only problem is the insulation heats up and melts REALLY quickly so you've gotta be quick with the iron.
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #164 on: Sun, 07 March 2010, 14:56:53 »
Quote from: kishy;162306
Reference to GUI was because I thought I had seen, somewhere in the vast expanses of the internet, a screenshot of a GUI program and a reference to AVRdude together, suggesting the screenshot was of AVRdude. Apparently not.


It is very well possible that someone has written a graphical frontend for AVRdude, but I don't know of any.

OK, now I know of one: Google pointed me at avrdude-gui, but obviously I've never tried it.

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #165 on: Sun, 07 March 2010, 15:03:42 »
First command worked like a charm. Second gave me an issue.

Code: [Select]

avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.



So I tried with the -F switch like it suggested (just to see what'd happen):

Code: [Select]
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9500
avrdude: Expected signature for ATMEGA32 is 1E 95 02
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: reading input file "boot.hex"
avrdude: input file boot.hex auto detected as Intel Hex
avrdude: writing flash (32632 bytes):

Writing | ################################################## | 100% 11.38s



avrdude: 32632 bytes of flash written
avrdude: verifying flash memory against boot.hex:
avrdude: load data flash data from input file boot.hex:
avrdude: input file boot.hex auto detected as Intel Hex
avrdude: input file boot.hex contains 32632 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 9.69s



avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0xff != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


???
What would cause this?


Edit: oh yeah, no longer using the version of avrdude I indicated earlier. It said no libusb or something like that so I went looking for a more functional version. WinAVR (as a suite) is what I downloaded, newest version, in it you can find the version of avrdude i'm using now
« Last Edit: Sun, 07 March 2010, 16:32:00 by kishy »
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline nowsharing

  • Posts: 247
  • Swoop
Making a cheap Model M USB controller
« Reply #166 on: Sun, 07 March 2010, 23:08:44 »
When does mass production start? I'd like to pre-order a couple :)

BTW this thread is blatant discrimination against those of us who are neither hardware nor software savvy.

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #167 on: Mon, 08 March 2010, 04:35:28 »
Quote from: kishy;162331
First command worked like a charm. Second gave me an issue.

Code: [Select]
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.



I get the same warning wrt. "sck period", but it doesn't cause problems here. The error could mean that you've wired up things incorrectly, but you wrote that the first command worked... When running the fifth command, does it report the fuse values that you've written with the first command? (The output is much too verbose, but it should mention the fuse values somewhere.)

Would it be possible that your USB port does not supply enough current? Usually my whole USB system goes down when I try to flash from one of my monitor's USB ports (even requires a reboot), but I've never had problems when using the mainboard's or card reader's USB ports.

Quote from: kishy;162331

Code: [Select]
avrdude: Device signature = 0x1e9500
avrdude: Expected signature for ATMEGA32 is 1E 95 02


This looks wrong. The device signature should match the expected value. Here is a list of AVR device signatures, but 1E 95 00 is not listed. A faulty chip maybe, even if unlikely, or a faulty programmer (also very unlikely).

Quote from: kishy;162331

Code: [Select]
Writing | ################################################## | 100% 11.38s


And this is much too fast. It takes my programmer a few minutes to write 32 kB, and yours is basically the same as mine. It seems like the programmer is writing to nothingness because you've forced it.

Quote from: kishy;162331

Edit: oh yeah, no longer using the version of avrdude I indicated earlier. It said no libusb or something like that so I went looking for a more functional version. WinAVR (as a suite) is what I downloaded, newest version, in it you can find the version of avrdude i'm using now


Yes, upgrading to a more recent version of AVRdude may help, too. My version is 5.8.

I still suspect it's the power supply, though. Try a different USB port or a powered USB hub. If then you're still encountering problems, you could try attaching the AVR to a good, stabilized external power supply and switch the programmer to unpowered mode (there's a jumper on my device to cut the power supply from the programmer to the AVR).

Quote from: nowsharing;162443
When does mass production start? I'd like to pre-order a couple :)


Let's see what InSanCen can arrange. Seems like there is indeed a market for these controllers.

Quote from: nowsharing;162443
BTW this thread is blatant discrimination against those of us who are neither hardware nor software savvy.


Is this a request for better documentation? :)

Offline sethstorm

  • Posts: 257
Making a cheap Model M USB controller
« Reply #168 on: Tue, 09 March 2010, 12:07:16 »
Quote from: Mnemonix;162490

Let's see what InSanCen can arrange. Seems like there is indeed a market for these controllers.

Is this a request for better documentation? :)

Board layouts for the Terminal 122 would be fine enough, if only regular keyboard controllers are being pre-made.
« Last Edit: Tue, 09 March 2010, 12:10:21 by sethstorm »
Current:
IBM: Model M: 1391401, 1386887 Terminal 122 Key 
IBM: Model F: 6110668 Terminal 122 key with Trackpoint and M13 blacks
IBM: Specialty: Wheelwriter 5, Boltmodded.  AT F layout, M technology. 
Lexmark/IBM: M13 Black Trackpoint
NCR:HO150-STD1-01-17 Decision Mate V - The other Gray NCR linear.


Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #169 on: Tue, 09 March 2010, 13:04:01 »
Thanks for the pointers, I'm letting my brain calm down for a couple days before I mess with it again. I do know the pinout I have is right, I checked it 3 times. Bad uC isn't impossible, it was a rather cheap eBay purchase. Haven't left feedback yet so I've still got my bargaining chip (heh, pun) for a replacement if needed.

I'll investigate late this week, maybe the weekend.
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #170 on: Thu, 11 March 2010, 14:30:03 »
Quote from: nowsharing;162443
When does mass production start? I'd like to pre-order a couple :)

BTW this thread is blatant discrimination against those of us who are neither hardware nor software savvy.


I am working on a PCB layout. Production will start when he get's a break in his orders. As this is a favour, I cannot ask him to break into profit-making production for this. As soon as they are available, you *will* know about it. I will guinea-pig my '89 board for testing. As an aside, he's loving the loaner M i let him have to evaluate the physical space we are working with. All we need is for him to make an account here... ;-P
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #171 on: Fri, 12 March 2010, 03:06:56 »
Quote from: InSanCen;163225
I am working on a PCB layout.


Cool, thanks for spending your time on this project! :) Can't wait to see the result.

Quote from: InSanCen;163225
As an aside, he's loving the loaner M i let him have to evaluate the physical space we are working with. All we need is for him to make an account here... ;-P


Would you care taking the dimensions of the smaller Model M Mini into account, too? There's less space in vertical direction in a Mini, so you'd need to be careful placing big parts not too far from the back of the case. I could take pictures and measure the available space for you.

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #172 on: Fri, 12 March 2010, 04:26:48 »
Quote from: Mnemonix;163395
Cool, thanks for spending your time on this project! :) Can't wait to see the result.



Would you care taking the dimensions of the smaller Model M Mini into account, too? There's less space in vertical direction in a Mini, so you'd need to be careful placing big parts not too far from the back of the case. I could take pictures and measure the available space for you.



If you can get me some Dimensions, I will make sure it fits. I will attempt to make sure that regular M and Mini have ready-to-go mounting holes. I will need the Width and height of the available space, and where the mounting holes/posts are located.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline trievalot

  • Posts: 246
Making a cheap Model M USB controller
« Reply #173 on: Fri, 12 March 2010, 06:02:57 »
Thank you.....i want 2 please :)
(then i wont NEED 2 X SDL cables)
[SIGPIC]

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #174 on: Fri, 12 March 2010, 16:27:38 »
Quote from: ripster;163445
OOOOooooo.  Model M Mini PCB - sign me up!

Here's the dimensions.

...Good Pictures and Metric Numbers...

USB Mini Layout would be great for me!  Let me know if you need any other measurements or bigger pics.


Perfect! I can see the only measurement I needed that you didn't include (3rd pic down, centers on mounting posts).

I think we can accomodate that. As long as component placement and traces do not interfere, I should be able to make a drop-in board that will fit in both the M and the Mini. I just need to open an M and see if a board that size can be securely mounted. If it can, the finished product will be the size of the Mini's board. This is assuming that the controller is identical, and will just not use the rows and columns for the Numpad. If these can be left floating, then no additional work is needed. If they need to be tied low, than I think a switch could toggle between M and Mini modes.

I also had a quick chat with the guy who will be making these. Having looked into it, he think's it would be more feasable to do a PCB only run for .1 components. Just sounding out for interest, as he will have spare capacity on that line before he does on lines handling components. We also chatted about timescale. Bad news. Assuming no order cancellations, he's flat-out busy for at least 3 months (PCB only) and 5 months (Full board, assuming he finds a suitable connector for the Membrane to PCB). As I have said previously, the first run will be done at cost to GH members (and only "real" GH members, not someone registering just to get hold of it). Because of this, I will *not* let him break production, he is after all, a friend of mine.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #175 on: Sat, 13 March 2010, 08:56:05 »
Quote from: ripster;163445
OOOOooooo.  Model M Mini PCB - sign me up!

Here's the dimensions.


Thank you Ripster. Here is something I'd like to add (I really can't compete with your pictures, but anyway):





You can see that the plastic part that supports the keyboard assembly is smaller and shorter in the Mini (top) than in the '401 (bottom), so that the metal plate sits significantly closer to the bottom of the case in a Mini.

There's only 6.5 mm between the plastic and the assembly at the inner-most edge, compared to more than 8.3 mm (maybe even more than 9 mm) in the '401. This leaves only about 4 mm or less for components in this area. The PCB is held in place by plastic clips in both keyboards; in the Mini, these clips are located right next to a plastic ridge, but in the '401 these clips are farther from that ridge, giving more than 8.3 mm in vertical direction:





Sorry for the dirty '401 case... ;)

Please also keep in mind that there is also some plastic from the rivets protruding into the case, further reducing the available space.

Otherwise, all other dimensions seem to be roughly the same in both keyboards. In fact, the PCB of the '401 does fit into the case of the Mini, but sits rather tightly. It would be perfect if the PCB was 0.5 mm shorter on the shorter side (so better make it 4.995 cm or 4.99 cm instead of 5.0 cm). I didn't check, however, if the keyboard assembly would fit without touching the PCB, but I guess it would.

Here is a picture of the two cases lying on top of each other (slightly misaligned), with the Mini case at the bottom of the picture lying on top of the '401.



Quote from: InSanCen;163481
If it can, the finished product will be the size of the Mini's board. This is assuming that the controller is identical, and will just not use the rows and columns for the Numpad. If these can be left floating, then no additional work is needed. If they need to be tied low, than I think a switch could toggle between M and Mini modes.


There is no switching required. The same controller can be used in both models, it's just a question of dimensions. My stripboard version can be used in both models, too, the membrane connectors are also in the correct locations in both models. And even though there is a special firmware for the Mini, a controller with the '401 firmware would also work in a Mini.

Quote from: InSanCen;163481
I also had a quick chat with the guy who will be making these. Having looked into it, he think's it would be more feasable to do a PCB only run for .1 components. Just sounding out for interest, as he will have spare capacity on that line before he does on lines handling components.


.1 components means 0.1 mm pitch? As long as the 2.54 mm pitch membrane connectors fit in there somehow, why not?

Quote from: InSanCen;163481
We also chatted about timescale. Bad news. Assuming no order cancellations, he's flat-out busy for at least 3 months (PCB only) and 5 months (Full board, assuming he finds a suitable connector for the Membrane to PCB).


Hm, better late than never. How many units would he want to produce?

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #176 on: Sat, 13 March 2010, 09:37:00 »
Quote from: Mnemonix;163666
.1 components means 0.1 mm pitch? As long as the 2.54 mm pitch membrane connectors fit in there somehow, why not?


.1", or 2.54mm

Quote from: Mnemonix;163666
Hm, better late than never. How many units would he want to produce?


He is producing, regardless. this is me calling in favours. If viable, he will produce more afterwards. The initial run will be ~100 units.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #177 on: Sat, 13 March 2010, 10:03:39 »
Quote from: InSanCen;163674
.1", or 2.54mm

He is producing, regardless. this is me calling in favours. If viable, he will produce more afterwards. The initial run will be ~100 units.


Um, right. Thinking again, 0.1 mm would be some very fine pitch...

100 units sounds reasonable.

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #178 on: Sun, 14 March 2010, 15:35:03 »
I hate FPC/FFC connectors.

Can I find a UK source? Can I hell as like. Digikey's UK site carries them, but judging from the shipping total (VAT to be added afterwards too), they are in the US.

Farnell and RS do not carry them either (and I know Maplin do not, as I work there).

On the upside (and someone queried this a while ago but I forgot to check), Maplin do a lucky bag of switches. In them are cherry whites. All the bag's I have checked have 3, but YMMV, it is a lucky bag after all.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline nowsharing

  • Posts: 247
  • Swoop
Making a cheap Model M USB controller
« Reply #179 on: Sun, 14 March 2010, 23:53:06 »
Once you guys get this working, would it be a big step to wireless bluetooth? I would guess that an internal AA battery or two could supply the current, and some kind of USB to Bluetooth keyboard adapter could also be built in? Those might not exist though, I really have no clue.

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #180 on: Mon, 15 March 2010, 05:50:09 »
Quote from: InSanCen;163980
I hate FPC/FFC connectors.

I feel your pain.

I've got my engineering samples from German W+P Products. They are asking for a minimum ordering quantity of ~100 per type, so if they are not charging too much for shipping, this could be an option. I don't know the price of the connectors, however, because they didn't tell me... Just sent me some free connectors that I needed.

Quote from: nowsharing;164097
Once you guys get this working, would it be a big step to wireless bluetooth? I would guess that an internal AA battery or two could supply the current, and some kind of USB to Bluetooth keyboard adapter could also be built in? Those might not exist though, I really have no clue.

I could imagine hacking a Bluetooth USB hub like this one, in the spirit of Ripster's Model M USB hack. Instead of using the Blue Cube to convert from PS/2 to USB, you would use the hub to convert from USB to Bluetooth (either by using the hub as intended, or by hacking it to fit into the keyboard case). Don't know about the power supply, though...

InSanCen, could you include four empty soldering pads to the USB lines on your design? This way one could connect the controller directly to some Bluetooth hub/converter without using USB plugs.

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #181 on: Mon, 15 March 2010, 15:01:30 »
Quote from: Mnemonix;164136
InSanCen, could you include four empty soldering pads to the USB lines on your design? This way one could connect the controller directly to some Bluetooth hub/converter without using USB plugs.


Yup. Four pads right behind the USB connector suitable, flylead them in?

i am going to get some cardedge connector in work, use some blank stripboard to pad out the membrane, and see what I can get with that. I refuse to pay £12 shipping, and VAT in top, on a £5 order. If it works, I will be sure to post.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #182 on: Tue, 16 March 2010, 17:59:02 »
This is VERY frustrating.

I checked my wiring, everything seems correct following the 'simple' schematic. I've retraced it 3 different times and find nothing different from the schematic. However I still get these weird errors.

Now I'm getting this on any command:

Code: [Select]

avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.


Considering that voltage supply may have been the issues, I tried without using the programmer jumper that supplies power. For voltage I tried using a powered USB hub, with no USB connection to computer, plugged into wall. Nothing changed at all regarding errors.

Tried with my second AVR, same crap.

Do we suspect faulty programmer, or what? I told eBay seller I suspected one or both chips may be faulty (to make sure they are aware of it before any deadlines come up) so they're waiting to hear from me if I think it's the chip(s) or not. I would like to know myself...
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #183 on: Thu, 18 March 2010, 05:42:50 »
Quote from: kishy;164604
This is VERY frustrating.

I checked my wiring, everything seems correct following the 'simple' schematic. I've retraced it 3 different times and find nothing different from the schematic. However I still get these weird errors.


Did you check for bad solder joints? Sometimes they look good, but make only a bad connection.

Quote from: kishy;164604
Now I'm getting this on any command:


On any command, even when trying to program or read out the fuses? If you've successfully programmed the fuses to the values I've posted here before, then you'll have to make sure that the crystal is hooked up correctly, even for programming. This is because the fuse settings instruct the AVR to use an external oscillator for its clock. The "target doesn't answer" error seems reasonable if there's no clock.

Quote from: kishy;164604
Considering that voltage supply may have been the issues, I tried without using the programmer jumper that supplies power. For voltage I tried using a powered USB hub, with no USB connection to computer, plugged into wall. Nothing changed at all regarding errors.

Tried with my second AVR, same crap.


So probably not a power problem, but if you have other USB ports, you could give them a try, too.

Is the second AVR pristine, i.e., with the fuses still in factory settings? If so, it should respond even with no external oscillator attached. We could rule out a bad crystal then.

Quote from: kishy;164604
Do we suspect faulty programmer, or what? I told eBay seller I suspected one or both chips may be faulty (to make sure they are aware of it before any deadlines come up) so they're waiting to hear from me if I think it's the chip(s) or not. I would like to know myself...


Hard to say what's the real problem. Could still be a pure software problem. Did you upgrade to a new version of avrdude already? Also try running avrdude more verbosely (like -vvvvv) to see what's going on. The example in the manual for the programmer sets option "-P usb"; I've never needed that one, but it could be a Windows thing (OTOH, it seemed to work for you w/o -P before).

Did you try Linux instead of Windows? A live CD like the Ubuntu installer should be enough for testing. Avrdude can be installed while running the live Ubuntu system, without touching your harddisks.
No, I don't trust Windows. ;)

If you have a breadboard, try setting up a minimal circuit just consisting of the AVR, the crystal oscillator, the three capacitors, and the 10k resistor. Leave out all the USB-related stuff. Then hook up your programmer and try again. If the minimal circuit works, then your bigger circuit must be wrong. Without a breadboard, you could still try this with wires, even if it's crude.

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #184 on: Thu, 18 March 2010, 10:40:56 »
Quote from: Mnemonix;165066
Did you check for bad solder joints? Sometimes they look good, but make only a bad connection.

Checked with multimeter, everything's got good continuity. Looking at the joints, many look 'cold jointed', but any that had continuity issues were reflowed immediately.

Quote from: Mnemonix;165066
On any command, even when trying to program or read out the fuses? If you've successfully programmed the fuses to the values I've posted here before, then you'll have to make sure that the crystal is hooked up correctly, even for programming. This is because the fuse settings instruct the AVR to use an external oscillator for its clock. The "target doesn't answer" error seems reasonable if there's no clock.

Yeah, any command...but only sometimes!

If I unplug the programmer from the computer I can get it to pretend to behave for one operation, then it starts acting dumb again. Whatever operation I can get it to do fails in some manner or another.

Crystal is hooked up in correct position. Dumb question: there is NO type of "polarity" on a crystal, correct?

At the advice of the seller of the programmer, I've started using -B # switch on the commands to slow it down. The device signature problems went away when I tried 0.1, and it appeared to successfully write the bootloader, but then the content didn't match when it was done. It took around 7-8 seconds to do it so it wasn't an "insta-fail".

Quote from: Mnemonix;165066
So probably not a power problem, but if you have other USB ports, you could give them a try, too.

Have tried the programmer on all 4 of my laptop's USB ports.

When getting alternate power for the ATmega32 being programmed, it's just connected to a powered hub with no USB connection out of the hub...just using it for power. Power at the hub ports is good.

Quote from: Mnemonix;165066
Is the second AVR pristine, i.e., with the fuses still in factory settings? If so, it should respond even with no external oscillator attached. We could rule out a bad crystal then.

Second one does not have fuses programmed.
Apparently, neither does the first. They keep changing themselves back to 0, as avrdude likes to inform me.

Quote from: Mnemonix;165066
Hard to say what's the real problem. Could still be a pure software problem. Did you upgrade to a new version of avrdude already? Also try running avrdude more verbosely (like -vvvvv) to see what's going on. The example in the manual for the programmer sets option "-P usb"; I've never needed that one, but it could be a Windows thing (OTOH, it seemed to work for you w/o -P before).

I can't upgrade to a newer version of avrdude because a newer version doesn't exist compiled and working and including USB support...for Windows.

Regarding -P, apparently "atmega32" is incorrect, BTW. It's "m32". I started making some progress after making that change, but it's back to how it was before. Will try -P usb (you're the second to mention it) on next attempt.

Verbose...if next attempt gives problems, I'll re-do it verbosely and throw the output here.

Quote from: Mnemonix;165066
Did you try Linux instead of Windows? A live CD like the Ubuntu installer should be enough for testing. Avrdude can be installed while running the live Ubuntu system, without touching your harddisks.
No, I don't trust Windows. ;)

Linux...do not want, but will try as a last resort. I don't believe the type of issues showing up here CAN result from an OS incompatibility...the inconsistent nature of the failures and the fact that they change somewhat from attempt to attempt tells me this. A pure OS incompatibility would hang up in the exact same way every time because the OS isn't allowing something to happen...

Quote from: Mnemonix;165066
If you have a breadboard, try setting up a minimal circuit just consisting of the AVR, the crystal oscillator, the three capacitors, and the 10k resistor. Leave out all the USB-related stuff. Then hook up your programmer and try again. If the minimal circuit works, then your bigger circuit must be wrong. Without a breadboard, you could still try this with wires, even if it's crude.

No breadboard, but setting up with wires should be doable. My patience is going out the window however.

There's a reason I dislike open source software such as avrdude. This is the reason.

Not that it doesn't work...that there's no phone number to call and give them a piece of my mind.
« Last Edit: Thu, 18 March 2010, 10:45:54 by kishy »
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #185 on: Thu, 18 March 2010, 11:52:26 »
Quote from: kishy;165133
Crystal is hooked up in correct position. Dumb question: there is NO type of "polarity" on a crystal, correct?


Yes, there's no polarity. Doesn't matter which orientation you're soldering it in.

Quote from: kishy;165133
At the advice of the seller of the programmer, I've started using -B # switch on the commands to slow it down. The device signature problems went away when I tried 0.1, and it appeared to successfully write the bootloader, but then the content didn't match when it was done. It took around 7-8 seconds to do it so it wasn't an "insta-fail".


Maybe that's the way to go. Like I wrote before, writing the boot loader takes a few minutes with my setup, so you should try slowing down even more.

Quote from: kishy;165133
I can't upgrade to a newer version of avrdude because a newer version doesn't exist compiled and working and including USB support...for Windows.


You could compile your own version, but this could be a painful experience.

Quote from: kishy;165133
Regarding -P, apparently "atmega32" is incorrect, BTW. It's "m32". I started making some progress after making that change, but it's back to how it was before. Will try -P usb (you're the second to mention it) on next attempt.


There's -p and -P. The first one is used to specify the AVR type (atmega32, or m32 if this is correct for your version), the second one to specify the connection port. So you could try -p m32 -P usb (or just leave out the -P usb part if it has no effect).

Quote from: kishy;165133
Verbose...if next attempt gives problems, I'll re-do it verbosely and throw the output here.


Good.

Quote from: kishy;165133
Linux...do not want, but will try as a last resort. I don't believe the type of issues showing up here CAN result from an OS incompatibility...the inconsistent nature of the failures and the fact that they change somewhat from attempt to attempt tells me this. A pure OS incompatibility would hang up in the exact same way every time because the OS isn't allowing something to happen...


Unless the OS in question is Windows, that is. Pretty much everything is messed up under Windows' shiny (or not so) hood. Threads? Fail. USB? Fail. Consistent APIs that behave as documented? Fail.

Enough ranting. It should be possible to run avrdude on Windows as it works for other people, too, but the fact that you need to install a driver and an outdated version of avrdude doesn't make this kind of setup look very stable to me.

Quote from: kishy;165133
There's a reason I dislike open source software such as avrdude. This is the reason.

Not that it doesn't work...that there's no phone number to call and give them a piece of my mind.


Well, there's the internet for instant, free help. I'm trying to help, too, no need for expensive phone calls.

Speaking of open source, I can assure you that the firmware for the controller that you are building right now would never have been written if free software such as avrdude, gcc, vim, etc. would not exist. :wave:

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Making a cheap Model M USB controller
« Reply #186 on: Thu, 18 March 2010, 12:17:56 »
I decided to try an erase, since I've read that it's generally needed if you're going to be re-writing the contents of the flash (which didn't seem right, since the entire flash contents seem to be erased before a transfer if avrdude is to be believed, but whatever)

First, we see the non-verbose output:

Code: [Select]
C:\WinAVR-20100110\bin>avrdude -B 0.1 -p m32 -P usb -c usbasp -e

avrdude: set SCK frequency to 1500000 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Now, we see the verbose output:

Code: [Select]
C:\WinAVR-20100110\bin>avrdude -B 0.1 -p m32 -P usb -c usbasp -e -vvvv

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


         Using Port                    : usb
         Using Programmer              : usbasp
         Setting bit clk period        : 0.1
avrdude: seen device from vendor ->www.fischl.de<-
avrdude: seen product ->USBasp<-
         AVR Part                      : ATMEGA32
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    10    64    0 no       1024    4      0  9000  90
00 0xff 0xff
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           flash         33     6    64    0 yes     32768  128    256  4500  45
00 0xff 0xff
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           lfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           hfuse          0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           lock           0     0     0    0 no          1    0      0  2000  20
00 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00
                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: try to set SCK period to 1e-007 s (= 10000000 Hz)
avrdude: set SCK frequency to 1500000 Hz
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: error: programm enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

...and why is the SCK period going to 1500000 Hz if I'm REDUCING the number?!?! Shouldn't it be...you know...going down?
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #187 on: Fri, 19 March 2010, 06:22:25 »
Quote from: kishy;165151
I decided to try an erase, since I've read that it's generally needed if you're going to be re-writing the contents of the flash (which didn't seem right, since the entire flash contents seem to be erased before a transfer if avrdude is to be believed, but whatever)


Yes, in general you need to erase flash memory before writing, but avrdude does this automatically.

Quote from: kishy;165151
First, we see the non-verbose output:


OK, I've compared my verbose output with yours using the same command. Here is the main diff ("-"-lines belong to your output, "+"-lines are mine):

Code: [Select]
-avrdude: try to set SCK period to 1e-007 s (= 10000000 Hz)
-avrdude: set SCK frequency to 1500000 Hz
-avrdude: warning: cannot set sck period. please check for usbasp firmware update
-.
-avrdude: error: programm enable: target doesn't answer. 1
-avrdude: initialization failed, rc=-1
-         Double check connections and try again, or use -F to override
-         this check.
-
+avrdude: try to set SCK period to 1e-07 s (= 10000 kHz)
+avrdude: set SCK frequency to 1500 kHz
+avrdude: warning: cannot set sck period. please check for usbasp firmware update.
+avrdude: AVR device initialized and ready to accept instructions


Your version of avrdude is 5.10, which seems to be the latest and greatest available (mine is still 5.8), so I think it's not a problem with outdated software.

Your programmer seems to be OK, too, otherwise you wouldn't see these lines:

Code: [Select]
avrdude: seen device from vendor ->www.fischl.de<-
avrdude: seen product ->USBasp<-


It's the AVR that refuses to talk to your programmer.

Quote from: kishy;165151

...and why is the SCK period going to 1500000 Hz if I'm REDUCING the number?!?! Shouldn't it be...you know...going down?


The -B option takes the clock period in microseconds. The shorter the period, the higher the frequency.

But it's not that easy for USBasp programmers as I've just found out reading this post from this thread.
Could you try -B 4 or -B 8 or something like that?

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #188 on: Fri, 19 March 2010, 06:39:26 »
I should add that I have released new firmware images and source tarballs on SourceForge yesterday, now at version 0.3.0.

It's possible to use two function keys now, allowing to quick-switch between the default key map and three alternative key maps.

Offline MarkWilliamson

  • Posts: 26
Making a cheap Model M USB controller
« Reply #189 on: Mon, 29 March 2010, 19:22:44 »
EDIT: Argh, sorry, hadn't read far enough through the gargantuan thread to find your own follow up to this! (http://geekhack.org/showwiki.php?title=Island:8406&do=comments&page=10)

Quote from: Mnemonix;153547
I can't sell them because the USB part of the firmware is only for free if not used commercially. As soon as I start selling them, I'd have to pay a license fee.

I thought you were using the V-USB firmware?  If it's licensed to you under the GPL then there's no legal reason you can't sell devices that use the code; if you wanted to close the code as part of your commercial operation it would perhaps be a somewhat different matter.  I'm not a lawyer but it's certainly considered acceptable to sell stuff based on GPL code in the normal case - you just have to figure out a circumstance in which people will buy the stuff from you!  If they were to add the restriction that you couldn't sell devices based on the code then that would be in conflict with the terms of the GPL, as I understand them.

From their website I see:

"Commercial Licenses for V-USB

If the terms and conditions of the GPL are unsuitable for you, e.g. because you don't want to publish the source code of your firmware"

Which seems to imply that they're assuming commercial use will generally be by people who don't want to use the GPL version.  But not that they're forbidding commercial use of the GPL code if you can find a business case for it.
« Last Edit: Tue, 30 March 2010, 11:09:30 by MarkWilliamson »

Offline MarkWilliamson

  • Posts: 26
Making a cheap Model M USB controller
« Reply #190 on: Tue, 30 March 2010, 12:30:57 »
Quote from: InSanCen;163481

I also had a quick chat with the guy who will be making these. Having looked into it, he think's it would be more feasable to do a PCB only run for .1 components. Just sounding out for interest, as he will have spare capacity on that line before he does on lines handling components. We also chatted about timescale. Bad news. Assuming no order cancellations, he's flat-out busy for at least 3 months (PCB only) and 5 months (Full board, assuming he finds a suitable connector for the Membrane to PCB). As I have said previously, the first run will be done at cost to GH members (and only "real" GH members, not someone registering just to get hold of it). Because of this, I will *not* let him break production, he is after all, a friend of mine.


I don't think I necessarily qualify as a "real" GH member as I only just registered to take part in this thread (though not specifically to try to buy a PCB!).  But if there were one or two boards available too me at a reasonable price I'd be interested.  Just the PCB would be cool, an assembled board would also be of interest since I could concentrate on programming it.  If it had the bootloader so it could be flashed without a programmer that would be just fine by me!

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #191 on: Tue, 30 March 2010, 14:12:46 »
Quote from: MarkWilliamson;167936
EDIT: Argh, sorry, hadn't read far enough through the gargantuan thread to find your own follow up to this! (http://geekhack.org/showwiki.php?title=Island:8406&do=comments&page=10)


Yes, after re-reading the licensing conditions back then, I came to the same conclusion as you, I think. Good to know I'm not the only one who's understanding the licensing conditions this way. :)

At first I thought they'd allow licensing under GPL only if there's no money involved at all (pure hobby projects). But as long as all code is GPL'ed, there seems to be no need to buy their commercial licenses, even if selling controllers for profit.

Offline InSanCen

  • Posts: 560
Making a cheap Model M USB controller
« Reply #192 on: Tue, 30 March 2010, 18:01:51 »
Quote from: MarkWilliamson;168080
I don't think I necessarily qualify as a "real" GH member as I only just registered to take part in this thread (though not specifically to try to buy a PCB!).  But if there were one or two boards available too me at a reasonable price I'd be interested.  Just the PCB would be cool, an assembled board would also be of interest since I could concentrate on programming it.  If it had the bootloader so it could be flashed without a programmer that would be just fine by me!

It will be a while before this materialises. In the meantime, Read, Participate and yeah, sure no problem. You will then be a "Real" GH member... lol.

That comment was meant to deter someone looking to post, get a board, then dissapear for ever more. If you make a contribution to this forum (and if you can program AVR's, to this thread), then you are just as valid as any other GH member.
Currently Using :- IBM M13 1996, Black :
Currently Own :- 1391406 1989 & 1990 : AT Model F 1985 : Boscom 122 (Black) : G80-3000 : G80-1800 (x2) : Wang 724 : G81-8000LPBGB (Card Reader, MY) : Unitek : AT102W : TVS Gold :
Project\'s :- Wang 724 Pink-->White Clicky : USB Model M : IBM LPFK :
Pointing stuff :- Logitech MX-518 : I-One Lynx R-15 Trackball : M13 Nipple : Microsoft Basic Optical\'s
:

Offline MarkWilliamson

  • Posts: 26
Making a cheap Model M USB controller
« Reply #193 on: Tue, 30 March 2010, 19:30:56 »
Quote from: InSanCen;163481
It will be a while before this materialises. In the meantime, Read, Participate and yeah, sure no problem. You will then be a "Real" GH member... lol.

That comment was meant to deter someone looking to post, get a board, then dissapear for ever more. If you make a contribution to this forum (and if you can program AVR's, to this thread), then you are just as valid as any other GH member.

Cool, thanks! :-)

I've not actually done AVR programming although I suspect I'll need to do some in the world of work at some stage in the (relatively) near future.  I'm a software guy anyhow so I may have opinions I can share if anyone's interested, plus I have a natural urge to obtain hardware I *could* program if I felt like it.

If I could get one built I think it would be cool to look at getting the controller to emulate other USB devices - most obviously an in-keyboard implementation of using the cursor keys to control the mouse pointer.  USB is quite happy to let a single physical device register as if it were several, so there should be no problem with the controller saying it's a keyboard and a mouse - or even multiple keyboards (and mice) if anyone could think of a sane usecase for that?

The only other input device I can currently think of that might be fun to "fake out" would be a USB game pad.  Maybe that would even be useful for something ...  Wikipedia says that alphanumeric display devices are also a valid kind of HID device, so maybe another fun thing would be an option to add a LCD text display to the keyboard?  However, hooking that up gets us into electronics which I'm not qualified to comment on ;-)

EDIT: I know some people have talked about some stuff like this before, e.g. the Geekey project requirements (http://geekey.org/forum/viewthread.php?thread_id=3&pid=31) mention emulated mouse control (which is a separate issue to supporting a built-in trackball or trackpoint).  It's probably mentioned in the associated Geekey / Open Source keyboard controller thread and maybe elsewhere in this one.  I just think it's cool so wanted to mention some possibilities I saw.
« Last Edit: Tue, 30 March 2010, 19:38:48 by MarkWilliamson »

Offline MarkWilliamson

  • Posts: 26
Making a cheap Model M USB controller
« Reply #194 on: Tue, 30 March 2010, 19:34:44 »
From what I've read in this thread it should be possible to convert most membrane keyboards right?  As long as the membrane can be hooked up in some way ...  This has potential for me as I have piles of rubber dome membrane keyboards I never use.  I'm in the process of getting to grips with understanding how a keyboard works on the electronic level at the moment.  As I understand it, for a simple membrane keyboard, the microcontroller is basically multiplexing all the keys onto fewer inputs by scanning rapidly across them?  And all I need to worry about is hooking up the keyboard controller to the membrane, programming it with the row / column count and telling it where the keys are positioned within that grid?  Sounds "easy" in principle but I know how "simple" things tend to go, especially in the realm of real electronics :-S

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #195 on: Wed, 31 March 2010, 13:37:57 »
Quote from: MarkWilliamson;168170
If I could get one built I think it would be cool to look at getting the controller to emulate other USB devices - most obviously an in-keyboard implementation of using the cursor keys to control the mouse pointer.


Hm, could be useful in some occasions.

I'd like to get my M4-1 trackpoint supported at some time, but didn't try a lot yet (no time). If mouse emulation over keyboard would be implemented, then some parts of the code could surely be reused for the trackpoint.

Quote from: MarkWilliamson;168173
From what I've read in this thread it should be possible to convert most membrane keyboards right? As long as the membrane can be hooked up in some way ...


Yes.

Many keyboards are IMHO not worth the trouble, though, unless you are modding them for educational purposes. ;)

Quote from: MarkWilliamson;168173
This has potential for me as I have piles of rubber dome membrane keyboards I never use.  I'm in the process of getting to grips with understanding how a keyboard works on the electronic level at the moment.  As I understand it, for a simple membrane keyboard, the microcontroller is basically multiplexing all the keys onto fewer inputs by scanning rapidly across them?


Yes. Instead of connecting each key switch directly to its own I/O pin on the MCU (so you'd need more than 100 I/O pins for a full-size keyboard), you're arranging them in an nxm matrix (requiring only n+m I/O pins, or fewer) and scan along one dimension. This saves I/O pins, but can introduce ghosting unless avoided in hardware (by adding diodes to the switches).

Quote from: MarkWilliamson;168173
And all I need to worry about is hooking up the keyboard controller to the membrane, programming it with the row / column count and telling it where the keys are positioned within that grid?  Sounds "easy" in principle but I know how "simple" things tend to go, especially in the realm of real electronics :-S


Yes, where extension of the firmware is the easy part. Tracing the matrix is not very hard, but can be time-consuming. Big matrices (like the 122-key IBM keyboards) require additional hardware.
Connecting your circuit to the membrane can be troublesome if the connection requires some nasty, hard to obtain connector or if there's no real connector at all (glued to the board).
It may also be hard to fit your circuit board into the keyboard case if it's a slim case.

All in all, it depends on the keyboard whether or not it's hard to mod. IBM keyboards are very mod-friendly as it seems. :)

Offline MarkWilliamson

  • Posts: 26
Making a cheap Model M USB controller
« Reply #196 on: Wed, 31 March 2010, 14:40:21 »
Quote from: Mnemonix;168379
Hm, could be useful in some occasions.

I'd like to get my M4-1 trackpoint supported at some time, but didn't try a lot yet (no time). If mouse emulation over keyboard would be implemented, then some parts of the code could surely be reused for the trackpoint.


Yep, I reckon there'd be plenty of common code there.

I also got to thinking that a cool concept, if mouse support were available, would be to flip thing on their head - an open source mouse controller with optional keyboard emulation ;-)  I imagine that'd be easy for anything mechanical and tricky for anything optical, though.

Quote

Yes.

Many keyboards are IMHO not worth the trouble, though, unless you are modding them for educational purposes. ;)


In my case it might just be "not destroying a good keyboard" purposes, I think ;-)

Quote

Yes. Instead of connecting each key switch directly to its own I/O pin on the MCU (so you'd need more than 100 I/O pins for a full-size keyboard), you're arranging them in an nxm matrix (requiring only n+m I/O pins, or fewer) and scan along one dimension. This saves I/O pins, but can introduce ghosting unless avoided in hardware (by adding diodes to the switches).


Aha!  Thanks, that link has answered many of my remaining hazy points.  I wasn't sure how the diodes / resistors came into it before.  Now I feel much more equipped to understand this stuff...

Quote

Yes, where extension of the firmware is the easy part. Tracing the matrix is not very hard, but can be time-consuming. Big matrices (like the 122-key IBM keyboards) require additional hardware.
Connecting your circuit to the membrane can be troublesome if the connection requires some nasty, hard to obtain connector or if there's no real connector at all (glued to the board).
It may also be hard to fit your circuit board into the keyboard case if it's a slim case.

All in all, it depends on the keyboard whether or not it's hard to mod. IBM keyboards are very mod-friendly as it seems. :)


Does the current code support all of a full-size kb - numpad etc?  I'm not looking to look up crazy / cool IBM terminal keyboards just yet ;-)

Offline Specter_57

  • Posts: 143
Making a cheap Model M USB controller
« Reply #197 on: Wed, 31 March 2010, 15:58:49 »
..
A quote: "I'm not looking to look up crazy / cool IBM terminal keyboards just yet ;-) "

Because these terminal keyboards are crazy is what makes them cool...and interesting...

........

and as to getting your trackpoint working...if my understanding of the trackpoint is correct...it uses a controller separate from the keyboard...and so it may not be feasible to incorporate it into the ATmega device...and likely unnecessary...but I may be wrong here.


............
Spec_57
« Last Edit: Wed, 31 March 2010, 16:02:01 by Specter_57 »

Offline Mnemonix

  • Thread Starter
  • Posts: 163
Making a cheap Model M USB controller
« Reply #198 on: Wed, 31 March 2010, 17:53:20 »
Quote from: MarkWilliamson;168396
I also got to thinking that a cool concept, if mouse support were available, would be to flip thing on their head - an open source mouse controller with optional keyboard emulation ;-)  I imagine that'd be easy for anything mechanical and tricky for anything optical, though.


Um, yes, that's a different point of view then. :)

Quote from: MarkWilliamson;168396
Does the current code support all of a full-size kb - numpad etc?  I'm not looking to look up crazy / cool IBM terminal keyboards just yet ;-)


Sure, it works with a full-size Model M already. In theory you could even build your own 200-key (or so) keyboard that has one key for each of the USB key codes, but I'm quite sure that no one would ever want such a beast.

Quote from: Specter_57;168429
and as to getting your trackpoint working...if my understanding of the trackpoint is correct...it uses a controller separate from the keyboard...and so it may not be feasible to incorporate it into the ATmega device...and likely unnecessary...but I may be wrong here.


The M4-1 trackpoint is just a stick with four strain gauges attached. There are four lines going to the strain gauges, and two coming back from them. The challenge now is to measure the resistances of the strain gauges accurately, which are changing slightly depending on the direction the stick is bent to. It should be possible to extend the firmware so to measure the strain gauges' resistances from time to time and derive a mouse movement from them.

Quite some time ago, I tried using the ATmega's analog inputs with their internal amplifiers for measuring the resistances, but found out, after lots of trying, that the internal  amps are broken on the DIP versions of the chip... ;( The data sheet indirectly mentions this, too. After disabling the amps, I could take some reasonable measurements, but signal amplification is absolutely necessary for a useful resolution. I'll look into this again when I have more spare time and will play around with some external opamps.

Offline MarkWilliamson

  • Posts: 26
Making a cheap Model M USB controller
« Reply #199 on: Wed, 31 March 2010, 18:08:17 »
Actually, following up my own comment about optical mice being difficult, various of the sites linked from here: http://opensourcemouse.org/wiki/Mouse_Hacks (for instance http://areciv.com/index.php?aid=18 or http://www.bidouille.org/hack/mousecam/index.en.php ) imply that modern optical mice tend to include a combined CCD and image processing chip that just outputs movement data (and optionally may provide dumps of the images seen by the camera).  So assuming one of these is used, getting an optical mouse working sounds easy too.

There's code for the Arduino for interfacing to at least some of these chips: http://www.martijnthe.nl/2009/07/interfacing-an-optical-mouse-sensor-to-your-arduino/

I realise mice might be a bit off topic here but thought it worth noting!  The http://opensourcemouse.org/ project is clearly of some relevance to things like the Geekey project, in principle.  In practice, though, I don't know how far that project has got.
« Last Edit: Wed, 31 March 2010, 18:10:22 by MarkWilliamson »