]> git.gir.st - tmk_keyboard.git/blob - keyboard/hhkb_rn42/MEMO.txt
Mkdir rn42
[tmk_keyboard.git] / keyboard / hhkb_rn42 / MEMO.txt
1 Roving RN-42
2 ============
3 07/16 After fix of voltage dividor on GPIO6, had a trouble that it could not send a char to BT module, though could receive.
4 Found R8 had wrong 1K resistor and changed to 10K, after that it can send to the module again. Not sure how it had sent with the wrong 1K before.
5 07/18 On Linux, had an USB related trouble; keyobard or console didn't work for some reason. Changing PID cured this problem. Very annoying, took very long time before resolved it.
6
7
8
9 TODO
10 ----
11 - Factroy reset doesn't work; need to test again. 10K pull-up is too high?
12 - Lipo voltage ADC sensing
13 - Lipo charger configuration: fast charge time: USB charger spec?
14 - Low voltage alarm: LED indcates voltage of Lipo
15 - CTS/RTS lines are needed? just connect in loop back if no flow control is needed.
16 - CTS is needed for waking up from deep sleep?
17 - Serial API callback when data are available/received(and when send buffer is available)
18 - Serial API instance several serial ports can be used
19 - DCDC converter: squeaky inducter with onsemi NCP1402
20 - Lipo charger MCP73831: needs capacitor 4.7uF *2
21 - Keymap layer bug: during space is pressed(mousekey) press Fn(HHKB) then release space before Fn, in result HHKB layer is locked(toggled) unintentionally.
22
23 DONE:
24 - USB connection check - 07.01
25 - BT on/off check: whether RX line is pulled up? - checking RTS 07.01
26 - USB/BT switching BT is on -> BT, BT is off -> USB - 07.01
27 - Under voltage lock out UVLO for protection of Lipo - Lipo has discharge protection at 3.100V 07.01
28 - Power saving: HHKB scan, BT radio control - 9h with 850mAh, this is enough 07.01
29 - Power selector doesn't work; Q4 MOSFET leaks from Lipo to USB power line. -- use Schottky instead 07/04
30
31
32 Lipo
33 ----
34 Sparkfun Polymer Lithium Ion Battery 850mAh:
35 https://www.sparkfun.com/products/341
36 Lipo Cell spec:
37 https://www.sparkfun.com/datasheets/Batteries/063048%20Li-polymer.pdf
38 Protection spec:
39 http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Prototyping/BatteryProtection.pdf
40 min typical max
41 over-charge 4.255 4.280 4.305
42 over-charge discover? 4.030 4.080 4.130
43 over-discharge 2.827 2.900 2.973
44 over-discharge discover 3.022 3.100 3.178
45
46 ADC voltage monitor: voltage divider 10K+10K(0.5)
47 ADC=V*0.5/2.56*1024
48 V ADC
49 ------------------
50 4.20 0x347(839)
51 3.10 0x26b(619)
52
53
54
55
56 Configuration
57 -------------
58 Ver 6.15 04/26/2013
59 (c) Roving Networks
60 ***Settings***
61 BTA=0006664B3AE3
62 BTName=tmkBT-3AE3
63 Baudrt(SW4)=115K
64 Mode =DTR
65 Authen=2
66 Bonded=0
67 Rem=000000000000
68 ***ADVANCED Settings***
69 SrvName= keyboard/mouse
70 SrvClass=0000
71 DevClass=0000
72 InqWindw=0100
73 PagWindw=0100
74 CfgTimer=255
75 StatuStr=NULL
76 HidFlags=3c
77 DTRtimer=8
78 KeySwapr=0
79 ***OTHER Settings***
80 Profile= HID
81 CfgChar= $
82 SniffEna=8010
83 LowPower=0
84 TX Power=0
85 IOPorts= 0
86 IOValues=0
87 Sleeptmr=0
88 DebugMod=0
89 RoleSwch=0
90
91
92
93 Serial connection
94 -----------------
95 Serial line: 115200bps, 8bit, 1-stopbit, non-parity, no flow control
96 SSP: 115200bps, 8bit, 1-stopbit, non-parity, no flow control(via Bluetooth)
97
98 To enter command mode disconnect the module from host and type '$$$'.(you will see 'CMD')
99 To exit type '---'(you will see 'END') and '+' to get local echo.
100
101
102
103 Setting command mode
104 --------------------
105 S-,tmkBT // Device name
106 SS,keyboard/mouse // service name
107 SM,4 // Auto Connect DTR mode
108 SW,8010 // Sniff enable 0x10*0.625ms=10ms; 50ms is laggish and not much power save
109 S~,6 // HID profile
110 SH,003C // HID register
111 SY,0004 // Transmit power
112
113
114
115
116 Other options:
117 SC,0000 // COD: 000005C0 (see HID spec/Bluegiga doc)
118 SD,05C0 // bit 12-8 7 6 5-0
119 // 00101 1 1 0
120 // peripheral pointing keybaord joystick, gamepad, ...
121 SM,6 // Pairing mode: auto connect
122 SM,4 // Master mode: Connection can be controled with GPIO6
123
124
125
126
127 HID profile
128 -----------
129 S~,6 HID profile
130 S~,0 SPP profile
131 R,1 reboot
132
133
134 Apple iOS
135 ---------
136 Cannot supported without apple iAP authentication chip.
137
138
139 HID flag register
140 -----------------
141 SH,0200
142 GH
143
144 10 0000 0000(0200) default
145 00 0011 1000(0038) Combo
146 || | | |\_\____ number of paired devices to which the module can reconnect
147 || | | \_______ send out reports over UART (0xFF <len> <data>)
148 || \__\_________ descriptor type
149 |\______________ toggle virtual keyboard on iOS when first connected
150 \_______________ Force HID mode if GPIO11 is high on power-up
151
152 Descriptor type:
153 0000: keybaord
154 0001: Game Pad
155 0010: Mouse
156 0011: Combo
157 0100: Joystick
158 1xxx: reserved
159
160 Out report - Indicator
161 ----------------------
162 0xFE 0x02 0x01 <LED_state>
163
164
165 LED Status
166 ----------
167 Configuring 10 times per sec
168 Startup/configuration timer 2 times per sec
169 Discoverable/Inquiring/Idle once per sec
170 Connected solid on
171
172
173 Pairing
174 -------
175 First, host initiates pairing process and once it is done, auto connect will work thereafter.
176 SM,3 Master mode
177 SM,4 Auto Connect DTR Mode uses GPIO6 to make and break connection(Mode =DTR)
178 confirm: auto connect works and control connection with GPIO6
179 SM,5 Auto Connect ANY Mode (Mode =ANY)
180 each time GPIO is set, make inquiry and connect to the first found device
181 SM,6 automatically reconnect(Mode =Pair)
182 confirm: auto connect works well but difficult to enter command mode.
183
184
185 Fast data mode
186 --------------
187 The module enters fast data mode after 'remote configuration timer' window is passed from power on.
188 In this mode the module does not accept '$$$' to enter command mode.
189
190 Power Management
191 ----------------
192 Inquiry and Page window Idle or Active (3.1.1)
193 Downside: delay in discovery or connection time
194 SI, // set inquiry scan window(discovery) on/off duty?
195 SJ, // set page scan window(connection)
196 This reduces averaege power >20mA to 5mA(3mA in Sniff mode)
197
198 Sniff mode Transmit
199 Sniff mode is disabled by default and radio is active continuously when connected.(25-30mA)
200 In Sniff mode the radio wakes up intermittently and sleeps in very low power mode.(2mA)
201 SW,<val> // set interval timer(*0.625ms) 0000-7FFF
202
203 Deep sleep Idle (3.1.2)
204 In this mode the module shuts down completly and only draws about 300uA. To enable this set the most signifant bit(0x8000) of Sniff interaval timer.
205 SW,8320 // deep sleep enable(interval=0x320*0.625=500ms)
206 In normal sleep the firmware is still running in idle mode, and wakes up about 20 times per second to check ports, update LEDs, etc. During deep sleep, the firmware actually stops runnig some tasks and the LEDs only update about once per second.
207 To wake from deep sleep there are three ways: (in worst case wake up takes 5ms)
208 *send a charactor to the UART(first charactor will be lost)
209 *toggle CTS low to high and wait 5ms
210 *wake automatically every slot time(<val>*0.625ms)
211 Once the radio is awake it stay active for exactly 1 second of inactivity and then sleeps again.
212 Downside: latency and data loss
213
214 Disable Output driver Idle or Active (3.1.3)
215 S%,1000 // set all GPIO pins(0-11) to inputs.
216
217 Lower Transmit Power Idle or Active (3.1.4)
218 SY,<hex> // transmit power setting(takes effect after a power cycle and reboot)
219 Downside: reducing effective range
220
221
222 Optimizig for Latency
223 ---------------------
224 By default the firmware is optimized for throughput.
225 SQ,16 // set latency bit
226 SQ,0 // unset latency bit
227
228
229 Configuration timer settings
230 ----------------------------
231 Remote configuration is used for the module to be configured with various commands over Bluetooth(SPP profile only?).
232
233 The module has remote configuration timer to allow remote configuration over Bluetooth after power up in Slave mode. In Master modes the remote configuration timer is set to 0(no remote configuration). (In Trigger Master mode the timer is used as an idle timer to break the connection after time expires with no charactors receive.)
234 ST,0 // no remote, no local when connected
235 ST,<1-252> // local and remote with timeout in seconds from power up
236 ST,253 // local only without timeout
237 ST,254 // remote only without timeout
238 ST,255 // local and remote without timeout
239
240
241 Android
242 -------
243 3.7.1.5 Note: To connect with Android phone the modules must wake up 11ms every 2.5seconds.
244
245
246 Commands
247 --------
248 SC,
249 SM,<val>
250 SD,
251 SP,<string> Pin code(alpahnumeric)
252 SQ,<mask> Special configuration(GPIO, discovery mode, low latency, reboot, UART)
253 SR,<hex> Store remote address
254 SR,Z Erase all address
255 SS,<string> Set service name(1-20)**
256 ST,<val> Remote configuration timer(Master:0, Slave:0-255, Triger:as idle timer)
257 SU,<val> UART baud rate
258 SW,<val> low-power sniff mode** deep sleep and wake up every 625us * <val>
259 SX,<0|1> bonding enable only acceps device that matches the stored address
260 SY,<hex> power setting**
261 SZ,<val> non-standard raw baud rate <val>=baud*0.004096
262 S~,<val> Profile 0:SPP, 5:APL, 6:HID
263 S-,<string> Device name -15 alphanumeric charactors
264 S?,<0|1> role switch enable
265 S$,<char> command mode char
266 $|,<hex> low-power connect mode deep sleep/active(discoverable and connectable) cycle
267 D display basic setting
268 E display extended setting
269 GB display the device's Bluetooth address
270 GF display Bluetooth address of connected device
271 GK show connection status
272 GR show remote address for reconnecting
273 G& show GPIO pin
274 G<char> show stored setting
275 + toggle local echo on/off
276 & show GPIO 3,4,6,7(DIP switch)
277 C connect to stored remote address
278 C,<address> connect last address
279 CFI connect and go into fast data mode
280 CFR connect and go into fast data mode
281 CT,<address>,<val> connect to the address and disconnect after val?
282 F,1 fast data mod:
283 H display help
284 I,<time>,<cod> inquiry scan with <cod>
285 IN
286 IQ scan
287 IS inquiry scan with 001F00
288 J hide pin code
289 K, kill disconnects current connection
290 L link quality
291 M show modem signlal status
292 O display other settings
293 P,<car> pass through?
294 Q quiet mode make the module not discoverable
295 Q,0 discoverable and connectable
296 Q,1 not discoverable and not connectable
297 Q,2 not discoverable and connectable
298 Q,? display current quiet mode
299 R,1 reboot
300 T,<0|1> pass received data while in command mode
301 U,<baud>,<parity> change UART setting tentatively
302 V display firmware version
303 W wake from quiet mode enable discovery and connection
304 Z deep sleep mode(<2mA)
Imprint / Impressum