Keyboard firmwares for Atmel AVR and Cortex-M
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

MEMO.txt 9.6KB

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