sc8-nametag/nametag8_CH592
true 3d0a13dead minor comments updates 2024-11-09 21:22:38 -08:00
..
.settings add missing MRS project files 2024-10-20 02:10:55 -07:00
Ld fix i2c clock stretching, bit timings; speed up i2c; accelerometer working; many other fixes 2024-10-25 17:27:46 -07:00
RVMSIS initial commit of work in progress code 2024-10-12 21:59:33 -07:00
Startup initial commit of work in progress code 2024-10-12 21:59:33 -07:00
StdPeriphDriver main program tick interrupt now works 2024-10-24 17:22:20 -07:00
user minor comments updates 2024-11-09 21:22:38 -08:00
.cproject add missing MRS project files 2024-10-20 02:10:55 -07:00
.project add missing MRS project files 2024-10-20 02:10:55 -07:00
.template added nybble infotext to rgb program hex editor, fixed color editor 2024-10-26 16:51:19 -07:00
README.md some boilerplate and notes about i2c slave 2024-10-30 13:57:32 -07:00
nametag8_CH592.launch initial commit of work in progress code 2024-10-12 21:59:33 -07:00
nametag8_CH592.wvproj initial commit of work in progress code 2024-10-12 21:59:33 -07:00

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.