From 60096e11c77980ca6b54674c5b68248e8aa15d8d Mon Sep 17 00:00:00 2001 From: tmk Date: Sun, 23 Nov 2014 13:44:11 +0900 Subject: [PATCH] Update doc --- keyboard/hhkb_rn42/MEMO.txt | 36 ++++++++++- keyboard/hhkb_rn42/PowerSave.txt | 102 +++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 keyboard/hhkb_rn42/PowerSave.txt diff --git a/keyboard/hhkb_rn42/MEMO.txt b/keyboard/hhkb_rn42/MEMO.txt index 2f61574c..337dad60 100644 --- a/keyboard/hhkb_rn42/MEMO.txt +++ b/keyboard/hhkb_rn42/MEMO.txt @@ -1,12 +1,37 @@ Roving RN-42 ============ -TODO ----- Bug: - with Nexus5 keyboard and mouse are very laggy. +- lose USB connection during power-down mode + - USB initialize code in main() causes this - WRONG + - Do not power-down during USB connection is active - DONE 11/11 + (USB_DeviceState == USB_DEVICE_Configured) is used to check USB connection + matrix_power_down() matrix.c - 11/23 + +Todo: + +Design: +- remove MCU dependent power saving code from core/keyboard + - it should be located in project matrix.c - DONE 11/23 +- HHKB matrix.c needs matrix_prev? + - is_modified() is obsolete now. really needs? + + +LUFA: +USB connection check: state of USB deivce +- USB_DeviceState: + USB_Deivce_State_t { Unattached, Powered, Default, Addressed, Configured*, Suspended* } +- USB_IsInitialized: state of LUFA core setup + becomes true in USB_Init() USBController_AVR8.c + becomes false in USB_Disable() USBController_AVR8.c +- USB_VBUS_GetStatus(): state of VBUS(power/connection) +- USB_Disable() detaches, disables all interrupts, controller, PLL, regulater. + + Power saving: +- confirm suspend mode lufa.c: matrix_power_*, suspend_wakeup_condition - 8MHz clock - When not connected in a few minutes get into deep sleep to save battery life - CTS is needed for waking up from deep sleep? How deep sleep is activated? @@ -19,6 +44,9 @@ Power saving: - high resistor 100K/1M? capacitor 10nF http://www.eevblog.com/forum/beginners/measuring-battery-voltage-without-consuming-current/ +- During USB suspend change clock source to internal RC from external Xtal(6.8) +- FRZCLK: you can freeze clock for power saving. still WAKEUPI and VBUSTI interrupts are available while freezing.(21.7.3) +- Suspend: Clear Suspend Bit, Freeze clock, disable PLL, MCU sleep(21.13) Improving: - BT LED; connecting, linked, sleeping, deep sleeping @@ -306,6 +334,10 @@ SM,5 Auto Connect ANY Mode (Mode =ANY) SM,6 automatically reconnect(Mode =Pair) confirm: auto connect works well but difficult to enter command mode. +SR,Z removes all remote addresses for reconnecting. + can be used to connect another host +SR,I registers last inquiry address + Fast data mode -------------- diff --git a/keyboard/hhkb_rn42/PowerSave.txt b/keyboard/hhkb_rn42/PowerSave.txt new file mode 100644 index 00000000..943923c3 --- /dev/null +++ b/keyboard/hhkb_rn42/PowerSave.txt @@ -0,0 +1,102 @@ +RN-42 +===== + +HHKB key switch power control +----------------------------- +MOS FET Nch: BSS138 or IRLML6344T, either works and no apparent difference. +Normally on(pull-up) or off(pull-down)? interms of power saving it prefers pull-down? + +Pull-down will be better for power saving, normally off. + + + +Used Timer +---------- + +8MHz clock +---------- +1) 16MHz xtal with system prescaler div2: F_CPU=8MHz, F_USB=16MHz +2) 8MHz xtal with div1: F_CPU=8MHz, F_USB=8MHz +Hardware USART doesn't work at 115200bps with 8MHz(F_CPU). + +workaround: +a) use Sotwre serial for communcation with RN-42 +b) reduce baud of RN-42 to lower rate;(factory default is 115200bps) +10/03 + + + +Slave mode +---------- +Discovery/Inquire +Connect/Page + +SI,0012 +SJ,0012 +InqWindw=0100 +PagWindw=0100 + + +Sniff mode +---------- +0.625ms * +SW,0320 Very sluggish. Type is not lost but very slow to register. +SW,0160 Still sluggish. may transposed? can type but ... + Mouse point move intermittently +SW,0020 feel a bit late like stumble(20ms) +SW,0010 feel no latency(10ms) + + +Deep sleep +---------- +SW,8010 + + +TX power +-------- +SY,fff4 + + +IO pins +------- +S%,1000 status led and connection control don't work + GPIO5: status LED + GPIO6: Connection control + GPIO2: linked status + + + + + +Ver 6.15 04/26/2013 +(c) Roving Networks +***Settings*** +BTA=00066667BBE9 +BTName=tmkBT-BBE9 +Baudrt(SW4)=115K +Mode =DTR +Authen=1 +Bonded=0 +Rem=001BDC06415B +***ADVANCED Settings*** +SrvName= keyboard/mouse +SrvClass=0000 +DevClass=1F00 +InqWindw=0012 +PagWindw=0012 +CfgTimer=255 +StatuStr=NULL +HidFlags=3c +DTRtimer=8 +KeySwapr=0 +***OTHER Settings*** +Profile= HID +CfgChar= $ +SniffEna=8010 +LowPower=0 S|, +TX Power=fff4 SY, +IOPorts= 0 +IOValues=0 +Sleeptmr=0 +DebugMod=0 +RoleSwch=0 -- 2.39.3