You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

MEMO.txt 9.8KB

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