diff options
Diffstat (limited to 'keyboards/hhkb/rn42/MEMO.txt')
| -rw-r--r-- | keyboards/hhkb/rn42/MEMO.txt | 262 |
1 files changed, 262 insertions, 0 deletions
diff --git a/keyboards/hhkb/rn42/MEMO.txt b/keyboards/hhkb/rn42/MEMO.txt new file mode 100644 index 000000000..0ad56c79c --- /dev/null +++ b/keyboards/hhkb/rn42/MEMO.txt | |||
| @@ -0,0 +1,262 @@ | |||
| 1 | Memo of deveopment | ||
| 2 | ================== | ||
| 3 | just memo, NOT WORTH READING | ||
| 4 | |||
| 5 | 2015/11/24 | ||
| 6 | JP Bluetooth: | ||
| 7 | RN-42 cannot send Japanese keys like; henkan, mu-henkan and kana, JPY and RO. | ||
| 8 | It seems HID usage more than 0x65 cannot be send with the module. | ||
| 9 | http://shiki.esrille.com/2014/07/bluetoothnisse.html | ||
| 10 | |||
| 11 | |||
| 12 | Bug: | ||
| 13 | - Factory Reset PIO4 doesn't work | ||
| 14 | - the reason is unclear - 12/08 NOT LOOK INTO ANY MORE | ||
| 15 | - WORKAROUND: use serial pins(3.3V, GND, RX and TX) | ||
| 16 | - SF,1 and R,1 to set factory defalult | ||
| 17 | |||
| 18 | |||
| 19 | Todo: | ||
| 20 | - LED cover and switch knob and new Slide Switch | ||
| 21 | - RN42 auto configuration | ||
| 22 | - configure the module as HID device every time powering up | ||
| 23 | - this'll reduce work load of assembly | ||
| 24 | |||
| 25 | - move rn42 to protocol directory when it becomes reusable stack | ||
| 26 | |||
| 27 | - sendchar() in lufa.c no buffer | ||
| 28 | - no buffering. character lost can be caused. | ||
| 29 | - LUFA sendchar should be buffered and serial_uart.c buffur size is too large(256). | ||
| 30 | |||
| 31 | - BT operations | ||
| 32 | - disconnect | ||
| 33 | - new connection | ||
| 34 | - remove connection | ||
| 35 | |||
| 36 | - sendchar() in lufa.c block loop - DONE 11/29 | ||
| 37 | - block loop when powered with AC adapter | ||
| 38 | - FrameNumber is not updated when adapter powered | ||
| 39 | |||
| 40 | Improving: | ||
| 41 | - ADC resolution | ||
| 42 | AVR120 | ||
| 43 | AVR32138 | ||
| 44 | - Enhancing ADC resolution by oversampling | ||
| 45 | AVR121 http://www.atmel.com/images/doc8003.pdf | ||
| 46 | - disable digital input buffer DIDR(7.8.6) | ||
| 47 | |||
| 48 | Design: | ||
| 49 | - suspend.h - DONE 11/26 | ||
| 50 | - remove argument from suspend_power_down() for backward compatitibility | ||
| 51 | - remove MCU dependent power saving code from core/keyboard - DONE 11/23 | ||
| 52 | - it should be located in project matrix.c | ||
| 53 | - HHKB matrix.c needs matrix_prev? | ||
| 54 | - is_modified() is obsolete now. really needs? | ||
| 55 | - ADC: removing AREF capacitor C10 | ||
| 56 | - seems to be better while usb powered | ||
| 57 | - still bad while battery powered | ||
| 58 | http://electronics.stackexchange.com/questions/105849/avcc-and-capacitor-using-adc | ||
| 59 | - ADC: smaller resistors for voltage dividor | ||
| 60 | - 1K + 1K: not improved. - 11/27 | ||
| 61 | |||
| 62 | |||
| 63 | LUFA: | ||
| 64 | USB connection check: state of USB deivce | ||
| 65 | - USB_DeviceState: | ||
| 66 | USB_Deivce_State_t { Unattached, Powered, Default, Addressed, Configured*, Suspended* } | ||
| 67 | Unattached: unpluged | ||
| 68 | Powered: pluged with power adapter | ||
| 69 | Default: enumerate process bigin | ||
| 70 | Addressed: addressed | ||
| 71 | Configured: enumerated | ||
| 72 | Suspended: suspended | ||
| 73 | |||
| 74 | - USB_IsInitialized: state of LUFA core setup | ||
| 75 | becomes true in USB_Init() USBController_AVR8.c | ||
| 76 | becomes false in USB_Disable() USBController_AVR8.c | ||
| 77 | - USB_VBUS_GetStatus(): state of VBUS(power/connection) | ||
| 78 | - USB_Disable() detaches, disables all interrupts, controller, PLL, regulater. | ||
| 79 | |||
| 80 | - When connect to power adapter | ||
| 81 | - event happened: CW or CSW or C or DDC | ||
| 82 | - USB state: not configured | ||
| 83 | |||
| 84 | - USB evnets | ||
| 85 | - USB connect: CSWRWRW | ||
| 86 | - USB connect but fail to enumeration: CWRWRWRWS | ||
| 87 | - USB disconnect: D | ||
| 88 | - Power adapter connect: CW, CSW, C | ||
| 89 | - Power adapter disconnect: D | ||
| 90 | |||
| 91 | |||
| 92 | Power saving: | ||
| 93 | - Pro2 current consumption | ||
| 94 | - active: 138.2mA(no device on Hub) | ||
| 95 | - suspended: 30.9mA(WakeUp enabled DIPSW6) | ||
| 96 | - suspended: 0mA->46.0mA(WakeUp disabled DIPSW6) | ||
| 97 | - Pro current consumption | ||
| 98 | - active: 54.0mA | ||
| 99 | - suspended: 40.5mA(WakeUp enabled DIPSW6) | ||
| 100 | - suspended: 0.3mA(WakeUp disabled DIPSW6) | ||
| 101 | |||
| 102 | - RN42 3.3V | ||
| 103 | - disconnected(Idle): 5mA (config mode) | ||
| 104 | - connected(Active): | ||
| 105 | SW,0000: 23-26mA | ||
| 106 | SW,0010: 27-29mA worse than 0000 for unknown reason | ||
| 107 | SW,0020: 17-19mA mouse NG | ||
| 108 | SW,0030: 13-16mA laggy mouse NG | ||
| 109 | SW,0050: 10-13mA laggy mouse NG | ||
| 110 | |||
| 111 | - matrix power saving | ||
| 112 | - power saving while externally powered and not while unpluged | ||
| 113 | - confirm suspend mode lufa.c: matrix_power_*, suspend_wakeup_condition | ||
| 114 | - 8MHz clock | ||
| 115 | - When not connected in a few minutes get into deep sleep to save battery life | ||
| 116 | - CTS is needed for waking up from deep sleep? How deep sleep is activated? | ||
| 117 | - firmware controlled 3.3V DC converter to switch on/off BT module | ||
| 118 | - sleep MCU and BT module(keyboard is not used) | ||
| 119 | - deep sleep MCU and BT module(keyboard is not used for long time) | ||
| 120 | - deep sleep MCU and turn off BT module(keyboard is not used and not connected) | ||
| 121 | - Battery ADC; switching, high resistance | ||
| 122 | - switching gnd end of divider with PF4 | ||
| 123 | - high resistor 100K/1M? | ||
| 124 | capacitor 10nF | ||
| 125 | http://www.eevblog.com/forum/beginners/measuring-battery-voltage-without-consuming-current/ | ||
| 126 | - During USB suspend change clock source to internal RC from external Xtal(6.8) | ||
| 127 | - FRZCLK: you can freeze clock for power saving. still WAKEUPI and VBUSTI interrupts are available while freezing.(21.7.3) | ||
| 128 | - Suspend: Clear Suspend Bit, Freeze clock, disable PLL, MCU sleep(21.13) | ||
| 129 | - Voltage reference(8.1.1) | ||
| 130 | - to reduce power consumption while power down mode | ||
| 131 | - unset ADEN before sleep(24.7) | ||
| 132 | |||
| 133 | |||
| 134 | |||
| 135 | |||
| 136 | |||
| 137 | |||
| 138 | |||
| 139 | Lipo | ||
| 140 | ---- | ||
| 141 | 850mA lasts around 9 hours(07/28) | ||
| 142 | |||
| 143 | Sparkfun Polymer Lithium Ion Battery 850mAh: | ||
| 144 | https://www.sparkfun.com/products/341 | ||
| 145 | Lipo Cell spec: | ||
| 146 | https://www.sparkfun.com/datasheets/Batteries/063048%20Li-polymer.pdf | ||
| 147 | Protection spec: | ||
| 148 | http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Prototyping/BatteryProtection.pdf | ||
| 149 | min typical max | ||
| 150 | over-charge 4.255 4.280 4.305 | ||
| 151 | over-charge discover? 4.030 4.080 4.130 | ||
| 152 | over-discharge 2.827 2.900 2.973 | ||
| 153 | over-discharge discover 3.022 3.100 3.178 | ||
| 154 | |||
| 155 | ADC voltage monitor: voltage divider 10K+10K(0.5) | ||
| 156 | ADC=V*0.5/2.56*1024 | ||
| 157 | |||
| 158 | V ADC | ||
| 159 | ------------------ | ||
| 160 | 4.20 0x347(839) | ||
| 161 | 3.10 0x26b(619) | ||
| 162 | |||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | TROUBLE SHOOT | ||
| 167 | ------------- | ||
| 168 | 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. | ||
| 169 | 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. | ||
| 170 | |||
| 171 | 07/18 On Linux, had an USB related trouble; keyboard or console didn't work for some reason. Changing PID cured this problem. Very annoying, took very long time before resolved it. | ||
| 172 | |||
| 173 | 12/07 rn42_rts() read 1 every time. R12 broke in open mode(no coductive), idk why, too much heat with soldering? and PF1 pin was not soldered. | ||
| 174 | It resolved with resoldering PF1 and new resistor on R12. | ||
| 175 | |||
| 176 | |||
| 177 | |||
| 178 | |||
| 179 | Done: | ||
| 180 | - low battery alert(solid light) 09/04 | ||
| 181 | - *** Rev.E BT test *** - DONE | ||
| 182 | - with MCP73832, new Schottky, tantalum caps - DONE 12/07 | ||
| 183 | * MCP73832 doesn't leak from Vcc pin when unpluged and battery powered | ||
| 184 | 34mV vs 2.07V(MCP73831) at Vcc pin | ||
| 185 | MCP73832 doesn't need revese protection diode D5 | ||
| 186 | * PMEG2010ER is very low VF while reverse current/voltage is high | ||
| 187 | VF=0.96 vs 1.98(RB160M-30TR)with Fluke 175 | ||
| 188 | Anode of D11 is 680mV vs 20mV(RB160M-30TR) | ||
| 189 | 780mV is still low < 1.4V VBUS plugin detection(21.11) | ||
| 190 | this doesn't cause false VBUS detect | ||
| 191 | and 780mV on MCP73832 Vcc pin is also no problem. | ||
| 192 | D5 can be removed. | ||
| 193 | - ADC divider switching - DONE 12/07 | ||
| 194 | * Drain and Source of Q4 Pch was reversed wrongly on Rev.E. | ||
| 195 | |||
| 196 | - reverse current from Lipo charger - DONE 12/07 | ||
| 197 | * MCP73832 has no recverse current from Vcc pin unlike MCP73831 | ||
| 198 | |||
| 199 | |||
| 200 | - Rev.F design - DONE | ||
| 201 | - current measure point - DONE 12/08 | ||
| 202 | - change value of cap 68->47 - DONE 12/08 | ||
| 203 | - PPTC land pattern: no solder jumper, use 0Ohm resistor instead - CANCEL 12/08 | ||
| 204 | - Q4 Pch FET: wrong Drain and Source - DONE 12/08 | ||
| 205 | - D5 can be removed. - DONE 12/08 | ||
| 206 | |||
| 207 | |||
| 208 | |||
| 209 | - BT_INDICATOR LED turns on wrongly when touching line or pin. -- pull-up enabled on PF6/GPIO2 08/30 | ||
| 210 | - Lipo charger configuration: fast charge time: USB charger spec? -- used 2kohm | ||
| 211 | - use LED of charger to alarm low battery. LED should be powered directly from Lipo? - cancel; powered from VUSB | ||
| 212 | - Use RTS in serial_uart.c to resolve missing chars from help message of RN-42 - done | ||
| 213 | - CTS/RTS lines are needed? just connect in loop back if no flow control is needed. - done | ||
| 214 | - add IO pin to charger status CHRG; LED control(low) and detect charge status(input HiZ) 07.24 | ||
| 215 | - LINKED: add trace on PIO2 to PF6 07.24 | ||
| 216 | - Lipo voltage ADC sensing | ||
| 217 | - Lipo charger MCP73831: needs capacitor 4.7uF *2 | ||
| 218 | - USB connection check - 07.01 | ||
| 219 | - BT on/off check: whether RX line is pulled up? - checking RTS 07.01 | ||
| 220 | - USB/BT switching BT is on -> BT, BT is off -> USB - 07.01 | ||
| 221 | - Under voltage lock out UVLO for protection of Lipo - Lipo has discharge protection at 3.100V 07.01 | ||
| 222 | - Power saving: HHKB scan, BT radio control - 9h with 850mAh, this is enough 07.01 | ||
| 223 | - Power selector doesn't work; Q4 MOSFET leaks from Lipo to USB power line. -- use Schottky instead 07/04 | ||
| 224 | |||
| 225 | - wrongly suspended when powered from adapter without USB connection - DONE | ||
| 226 | - suspend event may occur when plug into adapter | ||
| 227 | - and never wake until conected to real USB line | ||
| 228 | - without debug print via USB no problem; CSW(wake just after suspend as real USB line) | ||
| 229 | - seems like USB print causes this problem after suspended | ||
| 230 | |||
| 231 | - lose USB connection during power-down mode - DONE | ||
| 232 | - USB initialize code in main() causes this - WRONG | ||
| 233 | - Do not power-down during USB connection is active - DONE 11/11 | ||
| 234 | (USB_DeviceState == USB_DEVICE_Configured) is used to check USB connection | ||
| 235 | matrix_power_down() matrix.c - 11/23 | ||
| 236 | |||
| 237 | - with Nexus5 keyboard and mouse are very laggy. | ||
| 238 | Not confirmed. 01/15 | ||
| 239 | |||
| 240 | - switch BT host connections - CANCEL 01/15 | ||
| 241 | - switch next connection | ||
| 242 | cannot switch connection with version 6.15 at least | ||
| 243 | |||
| 244 | - When given power only from wall wart adapter - DONE? not confirmed 01/15 | ||
| 245 | - it sleeps. it should not sleep | ||
| 246 | - Configured state without USB connection? | ||
| 247 | |||
| 248 | - timer is slow while power down - DONE 11/26 | ||
| 249 | - time out interrupt is lost while power down? | ||
| 250 | - interrupt of watchdog timer compensates timer counter(avr/suspend.c) | ||
| 251 | |||
| 252 | - repeated CHARGING/FULL_CHARGED - No longer problem 01/15 | ||
| 253 | - In LTC sharp pulses are observed. | ||
| 254 | - MCP has no pulse but still has a problem. | ||
| 255 | - needs more wait before read pin state? - NO | ||
| 256 | |||
| 257 | - USB plug-in fails while BT - No longer problem 01/15 | ||
| 258 | - it ends in suspend state | ||
| 259 | - maybe, not responsive to host enumeration process due to power-down. | ||
| 260 | - matrix_power_down() only when state is unattached - 11/26 | ||
| 261 | - need to observe a while | ||
| 262 | |||
