1 TMK with Xtal-less V-USB
2 ========================
4 TMK onekey works on ATtiny85.
6 $ make -f Makefile.vusb
11 text data bss dec hex filename
12 5518 14 254 5786 169a onekey_vusb.elf
17 https://i.imgur.com/sNa302J.jpg
20 Program with AVRISPmkII
21 -----------------------
22 D- and D+ lines are need to be disconnected when programed.
24 $ avrdude -p attiny85 -c avrispmkii -U flash:w:onekey_vusb.hex
29 http://codeandlife.com/2012/02/22/v-usb-with-attiny45-attiny85-without-a-crystal/
31 Configure fuses for PLL, internal RC and BOD(Brown out detection).
33 $ avrdude -c avrispmkii -p attiny85 -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m
35 Set 16.5MHz to F_CPU in Makefile
39 Add settings for calibration in usbconfig.h
41 diff --git a/keyboard/onekey/usbconfig.h b/keyboard/onekey/usbconfig.h
42 index e9b4f98..01e5aa6 100644
43 --- a/keyboard/onekey/usbconfig.h
44 +++ b/keyboard/onekey/usbconfig.h
45 @@ -161,7 +161,11 @@ section at the end of this file).
46 * proceed, do a return after doing your things. One possible application
47 * (besides debugging) is to flash a status LED on each packet.
49 -/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
50 +#define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();}
51 +/* http://codeandlife.com/2012/02/22/v-usb-with-attiny45-attiny85-without-a-crystal/ */
52 +#ifndef __ASSEMBLER__
53 +extern void hadUsbReset(void); // define the function for usbdrv.c
55 /* This macro is a hook if you need to know when an USB RESET occurs. It has
56 * one parameter which distinguishes between the start of RESET state and its
58 @@ -202,7 +206,7 @@ section at the end of this file).
59 * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
60 * for each control- and out-endpoint to check for duplicate packets.
62 -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
63 +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 1
66 Another calibration code
67 ========================
68 https://github.com/obdev/v-usb/tree/master/libs-device