Swim for STM8 on Arduino

Thread Starter


Joined Apr 17, 2024
Hello! I'm trying to make firmware for Arduino that works as programmer via SWIM. But read and write don't work. Activation sequence works and Arduino gets synchronization frame that is sent by STM8. But STM8 does not send ack/nack as response to command or byte. I'm trying to write SWIM_CSR and Option Bytes. Tried to send it as separate bytes and via SWIM WOTF command. Does not work.

And Synchronization frame is 4/8 us instead of calculated 16 us.

Does anyone has experience in implementing custom SWIM host on microcontrollers or FPGA? Can anyone suggest right way of writing code that on Arduino that writes to STM8 SWIM_CSR registers and Option Bytes after synchronization frame?

And also I'd be glad to see right timing diagrams and timings because my attempts to work strictly according to datasheets on STM8, including STM8's UM0470, and on Arduino (ATMega328p) have not given any results excluding receiving of activation sequence synchronization frame

I'll give you all my code that I've tried if you ask