-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
64 lines (50 loc) · 2.28 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
This project is a basic USB keyboard controller based around an Atmel
ATmega??u? controller.
It is licensed under the GPL
It requires LUFA (http://www.fourwalledcubicle.com/LUFA.php) to build.
Current build is against LUFA 130901. Unpack the lufa zip file, and then
move the LUFA subdirectory within the top level one into this directory.
Initial work has been done on a ATmega32u4. Eventual target is an
ATmega32u2, although it should fit in smaller variants - with debugging
off, it should fit in an 8u2.
Currently it does not handle multimedia keys etc as they require a
multi-function USB device and I've not written the code for that yet.
A pair of 74HC595 shift registers are cascaded to drive the columns of
the matrix. The rows are connected to PORTB on the MCU.
USB suspend/resume works; there is a hack in there which doubles the
first keyboard report after a usb resume as otherwise sometimes the
first report seems to get lost.
I've been using this code for my primary keyboard for a year or so.
Most testing has been under Linux, but it appears to work fine under
Windows as well.
Debugging output (if enabled with the SERIALDEBUG define in kbdcont.h)
will get spat out the USART TX line (D3 usually) at the baud rate
defined at the top of uart.c - I find this works fine at a fairly
ludicrous 921600 baud (using another 32u4 as a usb-serial widget). I've
also used FTDI chips for this but I haven't tested them at very fast
speeds.
Currently the one of the debug LEDs toggles every second the main loop
is running, and one of them is on if we aren't asleep. The other two are
used to show USB state (connected and configured iirc).
For the 32u4 variant, pins are as follows:
B0-7 keyboard rows
C6-7 unused
D0-2 keyboard LEDS (NUM, CAPS, SCRL)
D3 debug serial out
D4-6 shift register for driving keyboard columns
D7 unused
E0 unused
F0-1 more LEDS (COMP, KANA)
F4-7 debug LEDS
For the 32u2 variant, pins are as follows:
B0-7 keyboard rows
C2 COMPOSE LED
C4-7 debug LEDS
D0-2 keyboard LEDS (NUM, CAPS, SCRL)
D3 debug serial out
D4-6 shift register for driving keyboard columns
D7 KANA LED
Assuming you keep PORTB for the row inputs (you need one
with pin change interrupts on all pins unless you add more
hardware) then changing the other pin assignments should
just involve editing LEDs.h and shiftreg.c.