]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - keyboard/kl27z_onekey/README.md
core: Clean up code of Locking key support
[max/tmk_keyboard.git] / keyboard / kl27z_onekey / README.md
1 KL27Z128/256 board
2 ==================
3 2016/11/30
4
5 KL27Z is configured to use internal 48MHz RC oscillator.
6
7 The board has push button on PTA4 and LED on PTD7. The button works as 'a' key and the LED as an indicator for capslock.
8
9
10 ELF board
11 ---------
12 This board acommodates 48QFN chip.
13
14 ### prototypte pinout
15 - pcb layout  https://deskthority.net/resources/image/33293
16 - schematic  https://deskthority.net/resources/image/33252
17
18
19     39 .....  44 \ conn / 1 ..... 6
20     38           |______|    LED  7
21      :  Rst                       :
22      :                            :
23     32  Bl                        13
24     31 .........24 23............ 14
25
26     1   PTD6        12  PTC3         23  GND        34  PTE20*
27     2   PTD5        13  PTC2         24  PTA18      35  PTA20   Reset
28     3   PTD4        14  PTC1         25  3.3V       36  PTA3    SWD_DIO
29     4   PTD3*       15  PTC0*        26  PTA4 NMI   37  PTA0    SWD_CLK
30     5   PTD2*       16  PTB17*       27  PTA2       38  3.3V
31     6   PTD1*       17  PTB16*       28  PTA1       39  GND
32     7   PTD0*       18  PTB3*        29  PTE25*     40  VBUS    VREGIN
33     8   PTC7        19  PTB2*        30  PTE24*     41  USB D-
34     9   PTC6        20  PTB1         31  PTE30      42  USB D+
35     10  PTC5        21  PTB0         32  PTE29*     43  GND
36     11  PTC4        22  PTA19        33  PTE21*     44  USB Shield
37
38
39 TMK KL27Z breakout
40 ------------------
41 This board acommodates 48QFN chip.
42
43 ### Pinputs
44
45     _\ conn /_
46     1       28
47     :        :
48     :  PROG  :
49     :  RST   :
50     14      15
51     ----------
52
53     1  VUSB            28  GND
54     2  VIN VREGIN      27  PTD4
55     3  PTD5            26  PTC7
56     4  PTD6            25  PTC6
57     5  PTD7            24  PTC5
58     6  PTE0*           23  PTC4
59
60     7  3.3V            22  GND
61     8  PTE30           21  PTC3
62     9  PTA0 SWD_CLK    20  PTC2
63     10 PTA1            19  PTC1
64     11 PTA2            18  PTB1
65     12 PTA3 SWD_DIO    17  PTB0
66     13 PTA4 NMI        16  PTA20 Reset
67     14 PTA18           15  PTA19
68
69
70 #### Pinouts difference between 32QFN and 48QFN
71 48QFN doesn't have PTE0
72 32QFN doesn't have PTD0-3, PTC0, PTE20-21,24,25,29, PTB2-3,16,17
73
74 ### ROM bootloader pins
75 See Reference Manual Chapter 13.
76
77     PTA2 LPUART0_TX
78     PTA1 LPUART0_RX *
79     PTB0 I2C0_SCL
80     PTB1 I2C0_SDA
81     PTC4 SPI0_SS_b *
82     PTC7 SPI0_MISO
83     PTC6 SPI0_MOSI
84     PTC5 SPI0_SCK *
85
86 Due to errata e9457, need to pull-up `SPI0_SS_b`(or `SPI0_SCK`) to prevent false detection of SPI.
87 The errata doesn't refer UART though, `LPUART0_RX` also requires pull-up or down resisitor from experience.
88 Without resistor it easily false-detects activity on UART interface with finger touch on the pin.
89
90
91
92
93 Resources
94 ---------
95 ### Deskthority thread
96 https://deskthority.net/workshop-f7/can-we-design-the-teensy-alternative-for-keyboards-t13662-510.html
97
98 ### Kinetis KL2x
99 http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/l-series-ultra-low-power-m0-plus/kinetis-kl2x-48-mhz-usb-ultra-low-power-microcontrollers-based-on-arm-cortex-m0-plus:KL2x
100
101 ### KL27Z128/256 Data Sheet
102 http://www.nxp.com/assets/documents/data/en/data-sheets/KL27P64M48SF6.pdf
103
104 ### KL27Z128/256 Reference Manual
105 http://www.nxp.com/assets/documents/data/en/reference-manuals/KL27P64M48SF6RM.pdf
106
107 ### Errata
108 http://www.nxp.com/assets/documents/data/en/errata/KINETIS_L_1N71K.pdf
109
110 >>
111 e9457: Kinetis Flashloader/ ROM Bootloader: The peripheral auto-detect code in
112 bootloader can falsely detect presence of SPI host causing non-responsive
113 bootloader
114 Description: During the active peripheral detection process, the bootloader can interpret spurious data on
115 the SPI peripheral as valid data. The spurious data causes the bootloader to shutdown all
116 peripherals except the â€œfalsely detected" SPI and enter the command phase loop using the
117 SPI. After the bootloader enters the command phase loop using the SPI, the other peripherals
118 are ignored, so the desired peripheral is no longer active.
119 The bootloader will not falsely detect activity on the I2C, UART, or USB interfaces, so only the
120 SPI interface is affected.
121 Workaround: Ensure that there is an external pull-up on the SPI chip-select pin or that the pin is driven high.
122 This will prevent the bootloader from seeing spurious data due to activity on the SPI clock pin.
123
124 ### Kinetis Bootloader and blhost
125 http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/kinetis-symbols-footprints-and-models/kinetis-bootloader:KBOOT
126
127
128 Build
129 -----
130
131     make
132
133
134 Program
135 -------
136 Flash firmware with ROM bootloader.
137
138     blhost -u -- flash-image  build/kl27z.hex erase
139
140
141 TODO
142 ----
143 - Fix boards/ELF files
144 - add macro `USBx_CTL_RESUME` to ChibiOS-Contrib/os/common/ext/CMSIS/KINETIS/kl27zxxx.h