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