To upload a program to a chip from Thomson Semiconductor you need an ST-Link programmer device to connect your PC. Thompson sells branded programmers, adaptors and cables. We'll use an inexpensive ST-LinkV2.
They look like AVR programmers but you need to read the pinouts on the side. One side is a SWIM interface for STM8 chips and the other SWD for STM32. Usually you can use the 3Volt or 5V leads but you may have to power your board from USB.
Reliable, even the low cost ones. The programmers are one good reason to work with STM32 and STM8 processors. Windows Device Manager needs to show a happy com port driver and is usually found automatically.
STM8 chips are simpler than STM32. Slower, lower flash and RAM. Equivalent to ATtiny or 8051 MCUs. We can program them with ST-Link programmer devices using a four-wire SWIM interface.
During data exchange the reset lead (RST, NRST) pulses to put the chip into flashing mode. Bits go to the flash memory on the SWIM lead.
The USB can power the board but aren't always connected to carry data. If D+ and D- do connect then you need a bootloader to program on the port.
Development BoardsThese boards were purchased as STM8S103K3T6, STM8S103F3P6 and STM8S003F3P6. The built-in LED is located on a different pin.
Look closely at the pinouts and make sure you connect the right pins together. Wrong voltages can damage components. The STM8S103K3T6 board needs to be powered through USB so 3V3 lead is not needed.
Arduino Sduino CoreInstall Sduino Core in your Arduino program and you are ready to compile and upload.
The Sduino package adds a software program called stm8flash.exe to your computer. Look closely at the verbose output and you see where it is located.
Download and install STVP from the Thomson Semiconductor Website. It also comes bundled in ST Visual Design(STVD) along with an IDE interactive design environment.
just look at all thsi stuff. All the STM8S chips have pretty much the same product info and code.
Connection status shown bottom screen. Watch LEDs on board and USB dongle. Menu Read->Current tab Ctrl+R. We are now looking at the flash memory of the STM8 chip. ASCII strings may show in the preview.
Menu File->Save as and we save with an extension like .s19 or .hex. STVP is now controlling the board and will probably stop running program. I've have to exit to reset board.
Menu File->Open and select the hex file. It was created with Arduino IDE.
Uploads our hex file to the board via the ST-Link adaptor dongle. During programming LEDs will blink showing data transmission.
Watch output at bottom of window. We want to see a happy successfully verified. I have to exit from STVP for my board to restart. There is probably a reset option.
Change your delay value to speed up or slow down the rate. Explore STM8S assembly and C/C++ programming. Watch this programming cycle including the lights on the ST-Link adaptor.
Comments
Please log in or sign up to comment.