3d0a13dead | ||
---|---|---|
.. | ||
.settings | ||
Ld | ||
RVMSIS | ||
Startup | ||
StdPeriphDriver | ||
user | ||
.cproject | ||
.project | ||
.template | ||
README.md | ||
nametag8_CH592.launch | ||
nametag8_CH592.wvproj |
README.md
GAT Nametag SC8 CH592 Firmware
main mcu firmware for the GAT Nametag originally shown at Supercon 8.
building
This is a MounRiver Studio project. Build in MRS.
loading firmware over USB
Easiest way is to use WCHISPStudio. This comes bundled with MRS. Tools > WCH In-System Programmer
enabling debug
By default, the debug interface is locked. To unlock the debug interface, do the following within a roughly 5 second window:
- Hold down BOOT, then plug in to USB
- Device should be dected in WCHISPStudio
- Within WCHISPStudio, click the
Enable Simulat
button at the bottom
At this point flash will be cleared and the debug interface will be re-enabled.
bugs, quirks, omissions
-
this micro has VERY SLOW flash. therefore, most user code is executed from RAM. additionally, the flash is protected and not really documented. will take time to reverse engineer it from the provided .a file to possibly determine if wait states can be adjusted.
-
i2c master is bitbanged and may still have bugs.
-
i2c slave is bitbanged and hasn't been tested at all.
-
i2c master and i2c slave are both BLOCKING. this means that while data is being manipulated on OLED or other I2C slaves on the addon, the addon will not respond as I2C slave. to address this device as a slave, ack poll until you get an ack, then send your payload. make sure to wait at least 4 bit times before trying each ack poll.
-
"idle mode" isn't really a power saving mode. no time to implement. need to do the following to implement this properly:
- implement a low power mode in the sub MCU as well, tell it to go to sleep
- get low power mode implemented and tested with gpio wakeup on this MCU
- put rgbled controller into low power mode
- configure accelerometer for wakeup with interrupt pin output
- get the interrupt chain working from accel -> sub mcu -> main mcu
- properly reinitialize and wake up once interrupt received and data matches expectations
-
cpu usage calculation is pretty busted and is only meant to gauge how much free time may exist for doing more processing before the framerate drops.