Differences between revisions 65 and 66
Revision 65 as of 2012-05-31 00:06:26
Size: 15855
Editor: fungi
Comment:
Revision 66 as of 2012-05-31 00:14:51
Size: 15984
Editor: fungi
Comment:
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
I picked up a [[http://www.adafruit.com/products/46|USBtinyISP AVR Programmer Kit]], [[http://www.adafruit.com/products/174|Barebones AVR dev. board]] and [[http://www.adafruit.com/products/382|28-pin ZIF socket]] from Adafruit on the theory that it would be easier to preprogram the Atmega168 on a dedicated target board. Unfortunately, I followed the !SpiffChorder instructions slightly out of order and burned the external clocking fuse before writing the firmware, thus rendering the unclocked devboard useless... so instead I programmed the microcontroller in-circuit later once the 12MHz crystal and associated components were in place to clock it correctly. I used a machine running [[http://www.debian.org/|Debian GNU/Linux]] and installed their packages for [[http://packages.debian.org/avrdude|avrdude]] and [[http://packages.debian.org/avr-libc|avr-libc]]. You can test the rig with: I picked up a [[http://www.adafruit.com/products/46|USBtinyISP AVR Programmer Kit]], [[http://www.adafruit.com/products/174|Barebones AVR dev. board]] and [[http://www.adafruit.com/products/382|28-pin ZIF socket]] from Adafruit on the theory that it would be easier to preprogram the Atmega168 on a dedicated target board. Unfortunately, I followed the !SpiffChorder instructions slightly out of order and burned the external clocking fuse before writing the firmware, thus rendering the unclocked devboard useless... so instead I programmed the microcontroller in-circuit later once the 12MHz crystal and associated components were in place to clock it correctly. I used a machine running [[http://www.debian.org/|Debian GNU/Linux]] and installed their packages for [[http://packages.debian.org/avrdude|avrdude]] and [[http://packages.debian.org/avr-libc|avr-libc]]. You can test the rig after connecting the 6-pin USBtiny cable to ''CON1'' with it set to provide power (and make sure nothing is connected on ''CON2'').
Line 172: Line 172:
Now '''disconnect''' the programmer and '''then''' hold down all three thumb buttons (or short ''N'', ''C'' and ''F'' to ''GND'') while connect the circuit via USB. If you have the LEDs wired, you should see ''LN'' and ''LF'' light up, indicating it's ready for programming through the virtual USBasp programmer. Now '''disconnect''' the programmer and '''then''' hold down all three thumb buttons (or short ''N'', ''C'' and ''F'' to ''GND'') while connecting the circuit via USB. If you have the LEDs wired, you should see ''LN'' and ''LF'' light up, indicating it's ready for programming through the virtual USBasp programmer.
  • Man Machine, pseudo human being; Man Machine, super human being.

Kraftwerk, The Man-Machine (1978)


Chronicling fungi's steady descent into cyberpsychosis....

Septabmic Chording Keyer

Inspired by Greg Priest-Dorman's Chorder wiki, I'm building a handheld chorded keyboard based on Spaceman Spiff's Chording Keyboard Experiment (SpiffChorder) with some earlier influence from Steve Mann's septambic keyer. Photos and designs published in this section are licensed under the terms of the GPL (3.0), same as the SpiffChorder project itself (since they could be considered derivative works).

Breadboard

I started on a solderless breadboard, shown above, but those really aren't suited for higher-frequency prototyping and so I was getting stray USB device resets at random (particularly if I inadvertently brushed the ground line while not grounding myself first). I used the components in Greg Priest-Dorman's Digikey bill of materials, including the suggested 9x pull-up resistor SIP array (even though I was only testing with 7 keys). I also chose poorly on a preformed bank of 3 yellow LEDs which were somewhat larger than I expected; their rather rigid leads weren't quite a multiple of 0.1" standard breadboard pitch, causing them to crack superficially upon insertion. I used the excellent AVR ATmegaXX8 Pinout Stickers from Adafruit Industries to more easily keep track of what I was connecting.

Programming

I picked up a USBtinyISP AVR Programmer Kit, Barebones AVR dev. board and 28-pin ZIF socket from Adafruit on the theory that it would be easier to preprogram the Atmega168 on a dedicated target board. Unfortunately, I followed the SpiffChorder instructions slightly out of order and burned the external clocking fuse before writing the firmware, thus rendering the unclocked devboard useless... so instead I programmed the microcontroller in-circuit later once the 12MHz crystal and associated components were in place to clock it correctly. I used a machine running Debian GNU/Linux and installed their packages for avrdude and avr-libc. You can test the rig after connecting the 6-pin USBtiny cable to CON1 with it set to provide power (and make sure nothing is connected on CON2).

$ sudo avrdude -c usbtiny -p atmega168

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Assuming it's all working, unpack the latest SpiffChorder sources (I used 0.99) modify the USBaspLoader firmware Makefile, program the IC and set its fuses.

$ unzip -q SpiffChorder-0.99.zip
$ cd SpiffChorder/USBaspLoader.2008-02-05/firmware
$ sed -i 's/^\(PROGRAMMER = -c\) .*/\1 usbtiny/' Makefile
$ make
avr-gcc -Wall -Os -I. -mmcu=atmega168 -DF_CPU=12000000  -x assembler-with-cpp -c usbdrv/usbdrvasm.S -o usbdrv/usbdrvasm.o
avr-gcc -Wall -Os -I. -mmcu=atmega168 -DF_CPU=12000000  -c usbdrv/oddebug.c -o usbdrv/oddebug.o
avr-gcc -Wall -Os -I. -mmcu=atmega168 -DF_CPU=12000000  -c main.c -o main.o
usbdrv/usbdrv.h:198: warning: ‘usbFunctionDescriptor’ used but never defined
avr-gcc -Wall -Os -I. -mmcu=atmega168 -DF_CPU=12000000  -o main.bin usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o -Wl,--section-start=.text=3800
rm -f main.hex main.eep.hex
avr-objcopy -j .text -j .data -O ihex main.bin main.hex
avr-size main.hex
   text    data     bss     dec     hex filename
      0    2134       0    2134     856 main.hex
$ cp hexfiles/mega168_12mhz.hex main.hex
$ sudo make flash
avrdude -c usbtiny -p atmega168 -U flash:w:main.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406
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: reading input file "main.hex"
avrdude: writing flash (16342 bytes):

Writing | ################################################## | 100% 9.58s



avrdude: 16342 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex contains 16342 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 8.56s



avrdude: verifying ...
avrdude: 16342 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

$ sudo make fuse
avrdude -c usbtiny -p atmega168 -U hfuse:w:0xd5:m -U lfuse:w:0xff:m -U efuse:w:0x00:m
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406
avrdude: reading input file "0xd5"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xd5:avrdude: load data hfuse data from input file 0xd5:
avrdude: input file 0xd5 contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xff"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xff:
avrdude: load data lfuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0x00"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x00:
avrdude: load data efuse data from input file 0x00:
avrdude: input file 0x00 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of efuse verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

$ sudo make lock
avrdude -c usbtiny -p atmega168 -U lock:w:0x2f:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406
avrdude: reading input file "0x2f"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x2f:
avrdude: load data lock data from input file 0x2f:
avrdude: input file 0x2f contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Now disconnect the programmer and then hold down all three thumb buttons (or short N, C and F to GND) while connecting the circuit via USB. If you have the LEDs wired, you should see LN and LF light up, indicating it's ready for programming through the virtual USBasp programmer.

$ sudo avrdude -c usbasp -p atmega168 -t
$ cd ../..
$ sudo make program

Note:

Still planning to fill out the above recipes with actual session transcripts instead...

Materials

A revised Digikey bill of materials including all the parts I used:

index

quantity

part number

description

customer reference

1

2

490-3709-ND

CAP CER 22PF 50V 5% RADIAL

C1-2

2

2

399-4328-ND

CAP CER 0.1UF 100V 10% RADIAL

C3,5

3

1

493-1767-ND

CAP ALUM 10UF 16V 20% RADIAL

C4

4

1

609-2846-ND

CONN HEADER 6POS DUAL R/A PCB

CON1

5

5

A98335-ND

TERM BLOCK 4POS SIDE ENT 2.54MM

CON2-4

6

1

26022-ND

TOOL SCREWDRVR SLOT 2.0MM 145MM

screwdriver for CON2-4

7

2

1N5227BDICT-ND

DIODE ZENER 3.6V 500MW DO-35

D1-2

8

1

ATMEGA168-20PU-ND

IC AVR MCU 16K 20MHZ 28DIP

IC1

9

1

ED90054-ND

IC SOCKET 28PIN MS TIN/TIN .300

socket for IC1

10

1

OD222JE-ND

RESISTOR 2.2K OHM .25W CARB COMP

R1

11

1

OD472JE-ND

RESISTOR 4.7K OHM .25W CARB COMP

R2

12

2

OD820JE-ND

RESISTOR 82 OHM .25W CARB COMP

R3-4

13

3

OD102JE-ND

RESISTOR 1.0K OHM .25W CARB COMP

R5-7

14

1

CSC10KW-ND

RES ARRAY 10K OHM 8 RES 9-SIP

R8-15

15

3

OD103JE-ND

RESISTOR 10K OHM .25W CARB COMP

R16-18

16

1

XC1380-ND

CRYSTAL 12.000 MHZ 18PF CYL

X1

17

1

WM17115-ND

CONN USB RECEPTACLE 5POS RT ANG

mini-USB-B port

18

7

CH196-ND

SWITCH PUSH SPST-NO 0.01A 12V

key switches

19

1

67-1062-ND

LED 3MM 5V SHORT LENS GREEN DIFF

near thumb lamp

20

1

67-1080-ND

LED 3MM 5V SHORT LENS YEL DIFF

center thumb lamp

21

1

67-1068-ND

LED 3MM 5V SHORT LENS RED DIFF

far thumb lamp

22

1

V2025-ND

BOARD 2-SIDE PPH 2.0X3.0

project board

Perfboard

In an effort not to limit my capabilities with the keyer's software, I wanted to make sure whatever prototype I eventually built could double as a development board. To that end, I implemented all optional components of the SpiffChorder circuit (programming header, LEDs, pull-up resistors and screw terminals for all 8 chord keys and 3 modifier keys). I tried to keep the layout as compact as possible while still working on single-sided pad-per-hole perfboard, using entirely right-angle traces so as not to make stray contact with corners of square pads. It fits in a 17x21-hole grid including a ground bus all the way around the perimeter. Here's a top-down view showing the logical supply, ground and signal paths colored for easy identification, the front showing just silkscreen markings and jumpers, one with the traces on the back (mirrored for easier visual reference).

This is designed assuming a keyed through-hole 2x3 right-angle shrouded header of the correct size for the USBtinyISP AVR Programmer (CON1), and 5x 0.1" pitch through-hole 4-line right-angle screw terminals (these take a 2mm jeweler's screwdriver) to connect leads for all the switches, LEDs and USB (CON2-4).

I was going to try laying it out with Fritzing, but got sidetracked when I couldn't find a resistor array in its parts library. Instead I wound up just sketching the layout on graph paper and transferring it into Dia by hand. Here's the multi-layer original from which the above graphics were exported. The same pathing could be used for a custom double-sided PCB, which I'll probably create before I build the next one since installing all those tiny traces without accidentally shorting any together was painfully time-consuming. You'll notice this layout uses an 8-resistor array instead of Greg Priest-Dorman's 9x (to save on space). I also show couple of 3-resistor arrays (R5-7, R16-18)... Digikey has no such beast, but I bussed individual resistors mounted vertically by soldering the common leads together above the board (only passing one of the three through the board).

Handset

I hacked up an old telephone handset from my junk pile so I could have something vaguely ergonomic into which to mount the keys. Once I'd separated the front and back of the handset, I opened up tracks for the keys using a small cutting wheel on a Dremmel. Epoxy was added in a few places and sanded to get the tolerances just right. I ordered 7x Row 2, Size 1x1 Cherry MX Keycaps from WASD Keyboards and popped them onto the stems.

I added a mini-USB-B connector and sourced appropriately-sized green, yellow and red LEDs to fit into the thumb switches (drilling corresponding holes at the tops of those three keycaps).

Note:

More still to come!

Monocular Headmount Display

As I begin work on a wearable display, I'll flesh out this section. Here are some interesting links for components I'm considering:

Single-Board Wearable Computer

Right now I just go everywhere with an Asus Eee PC netbook running Debian GNU/Linux, but intend to transition soon to a low-power single-board computer. Some links for reference:

Portable Power Supply and Charger

Portable power will also be critical:

CCL: ManMachine (last edited 2015-04-26 19:16:13 by fungi)

CC0 To the extent possible under law, the creator of this work has waived all copyright and related or neighboring rights to it.