Skip to content

Commit

Permalink
Merge pull request #9 from tmk/master
Browse files Browse the repository at this point in the history
updating
  • Loading branch information
jackhumbert committed Mar 21, 2015
2 parents a33ec2f + d23d953 commit 2e0fd30
Show file tree
Hide file tree
Showing 10 changed files with 347 additions and 246 deletions.
8 changes: 3 additions & 5 deletions converter/m0110_usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,16 @@ SRC = matrix.c \
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_plain.c
SRC += keymap_default.c
endif

CONFIG_H = config.h


# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
#MCU = at90usb162 # Teensy 1.0
MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0
MCU = atmega32u2 # TMK converter rev2
#MCU = atmega32u4 # TMK converter rev1


# Processor frequency.
Expand Down
98 changes: 98 additions & 0 deletions converter/m0110_usb/Makefile.teensy
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Target file name (without extension).
TARGET = m0110_lufa

# Directory common source filess exist
TOP_DIR = ../..

# Directory keyboard dependent files exist
TARGET_DIR = .

# keyboard dependent files
SRC = matrix.c \
led.c \
keymap_common.c \
m0110.c

# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_default.c
endif

CONFIG_H = config.h


# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
#MCU = at90usb162 # Teensy 1.0
MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0


# Processor frequency.
# Normally the first thing your program should do is set the clock prescaler,
# so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000


#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8

# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)

# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT


# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=512


# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor



#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex


# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TOP_DIR)


include $(TOP_DIR)/protocol/lufa.mk
include $(TOP_DIR)/protocol.mk
include $(TOP_DIR)/common.mk
include $(TOP_DIR)/rules.mk
25 changes: 12 additions & 13 deletions converter/m0110_usb/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
M0110/M0110A to USB keyboard converter
======================================
This firmware converts the protocol of Apple Macintosh keyboard **M0110**, **M0110A** and **M0120** into USB. Target of this project is USB AVR controller **ATmega32U4**. Using this converter you can revive these retro keyboards with modern computer.
This firmware converts the protocol of Apple Macintosh keyboard **M0110**, **M0110A** and **M0120** into USB. Target of this project is USB AVR controller like **ATmega32U2** and **ATmega32U4**. Using this converter you can revive these retro keyboards with modern computer.

Read README of top directory too.

Expand All @@ -20,12 +20,13 @@ Update
- 2013/08: Change port for signals `PF` to `PD`
- 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now.
- 2014/06: Change keymaps
- 2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c)



Building Hardware
-----------------
You need **4P4C** cable and **ATMega32U4** board like PJRC [Teensy]. Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`.
You need [TMK converter] or AVR dev board like PJRC [Teensy]. Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`.

[![M0110 Converter](http://i.imgur.com/4G2ZOegm.jpg)](http://i.imgur.com/4G2ZOeg.jpg)

Expand All @@ -38,6 +39,7 @@ Close-up picture of handset cable. You can see one end of plug has reverse color
[![4P4C cable](http://i.imgur.com/3S9P1mYm.jpg?1)](http://i.imgur.com/3S9P1mY.jpg?1)

[Teensy]: http://www.pjrc.com/teensy/
[TMK converter]: https://github.com/tmk/keyboard_converter


### Socket Pinout
Expand All @@ -53,31 +55,28 @@ You may need pull-up resistors on signal lines(`CLOCK`, `DATA`) in particular wh

Building Firmware
-----------------
To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to change compile options and pin configuration.
To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to change compile options and pin configuration. Also `KEYMAP` option can be used to select keymap.

$ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
$ cd m0110_usb
$ make clean
$ make
$ make -f Makefile clean
$ make -f Makefile [KEYMAP={default|plain|intl|spacefn|hasu}]

To select keymap use `KEYMAP` option.

$ make clean
$ make KEYMAP={plain|spacefn|hasu}
Use `Makefile.teensy` instead for Teensy.



Keymap
------
To create your own keymap copy existent keymap file to `keymap_name.c` and edit it. You can build it like this.

$ make clean
$ make KEYMAP=name
$ make -f Makefile clean
$ make -f Makefile KEYMAP=name



Debug
-----
You can use [PJRC HID listen](http://www.pjrc.com/teensy/hid_listen.html) to see debug output. The converter has some functions for debug, press `<Command>+H` simultaneously to get help.
You can use [PJRC HID listen](http://www.pjrc.com/teensy/hid_listen.html) to see debug output. The converter has some functions for debug, press `<Magic>+H` simultaneously to get help.

- Command: `Shift+Option+Command`(`Shift+Alt+Gui` or `Shift+Alt+Control`)
- Magic combo: `Shift+Option+` or `Shift+Option+Ctrl`(`Shift+Alt+Gui` or `Shift+Alt+Control`)
Loading

0 comments on commit 2e0fd30

Please sign in to comment.