mpogue2 / ladybug-mixer

Portable, low-cost audio mixer for square dance callers
Other
1 stars 0 forks source link

DOCS: how to build and flash #13

Open mpogue2 opened 1 month ago

mpogue2 commented 1 month ago

Output of the BUILD step:

 *  Executing task in folder BlinkTest: platformio run 

Processing STC8G1K08A (platform: intel_mcs51; board: STC8G1K08A)
-------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/intel_mcs51/STC8G1K08A.html
PLATFORM: Intel MCS-51 (8051) (2.1.0) > Generic STC8G1K08A
HARDWARE: STC8G1K08A 11MHz, 1.25KB RAM, 8KB Flash
PACKAGES: 
 - toolchain-sdcc @ 1.40200.0 (4.2.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 1 compatible libraries
Scanning dependencies...
Dependency Graph
|-- FwLib_STC8
Building in release mode
Compiling .pio/build/STC8G1K08A/src/main.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_adc.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_i2c.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_mem.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_spi.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_sys.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_tim.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_uart.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_usb.rel
Compiling .pio/build/STC8G1K08A/liba4a/FwLib_STC8/fw_util.rel
Archiving .pio/build/STC8G1K08A/liba4a/libFwLib_STC8.lib
Indexing .pio/build/STC8G1K08A/liba4a/libFwLib_STC8.lib
Linking .pio/build/STC8G1K08A/firmware.hex
Checking size .pio/build/STC8G1K08A/firmware.hex
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
Flash: [=         ]  13.6% (used 1112 bytes from 8192 bytes)
=============================== [SUCCESS] Took 1.37 seconds ===============================
 *  Terminal will be reused by tasks, press any key to close it.
mpogue2 commented 1 month ago

Output of the UPDATE (flash) step:

Configuring upload protocol...
AVAILABLE: custom, stcgal
CURRENT: upload_protocol = custom
Uploading .pio/build/STC8G1K08A/firmware.hex
Loading hex file:    Loaded 1112 bytes between: 0000 to 0457
Opening port /dev/tty.usbserial-110: done
Waiting for MCU, please cycle power: detected
MCU type: STC8G1K08A-8PIN
Protocol: STC8G/8H
F/W version: 7.3.13U
IRC frequency(Hz): unadjusted
Switching to 115200 baud, chip: set, host: set, ping: succ
Erasing chip: succ
Writing flash, size 1112: 100.00% done
mpogue2 commented 1 month ago

Hardware needed: STC Auto Programmer USB-TTL

GROUND: pin 1 on STC programmer goes to ISP connector pin 4 (next to the ISP label)
RxD: pin 3 on STC programmer goes to ISP connector pin 2
TxD: pin 5 on STC programmer goes to ISP connector pin 3 (through a DPST switch)
+5: pin 7 on STC programmer goes to ISP connector pin 1 (through a DPST switch)

The DPST switch is needed to interrupt power going to the MCU from the STC programmer, which keeps it in RUN mode, instead of powering up in PROGRAM mode.

To flash:

My hardware setup: IMG_5665

Yeah, that's the closest I could get to a momentary DPST switch. It's not DPST, more like 12PDT, AND it's not momentary. But, it works well enough for my purposes.

mpogue2 commented 1 month ago

Setup needed in Visual Studio Code's view of platformio.ini