Skip to content

Professor-plum/stm8_minibadges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stm8_minibadges

Repository of mini badges using the stm8s001j3.

Metroid Pitfall Doom Phoenix

This repo contains all the source code and eagle files for the mini badges I've designed using the STM8S001J3 microprocessor. I've loved this little chip as it's cheaper than an ATTiny and extremely versatile. The package design leaves a bit to be desired as it wastes one pin for a required cap and the pin 1 marking is horrible but for $.23 you can't complain much.

Assembly

I'd recommend soldering the LCD down first, followed by the STM8 chip (note the orientation) then the resistor and capacitor. Finally, solder on the pin header legs once all the surface mount components are down.

Layout

Flashing

In all my stm8 projects I do bare metal programming and utilize no libraries (I'm usually wanting to make the most of that 8K flash)

There’s also a lot of code reuse between these projects. I could probably do better at managing that, meh...

The following tools are required to compile and flash the chips:

Pinmap

To flash the badge there are only three that need to be connected from the ST-Link to the minibadge.

  • That is 3V3 to the lower 3V
  • GND to ether GND
  • SWIM to NC12 (4th pin from the right on the bottom row)

Usually, the process for compiling and flashing is the same for all projects. That is:

>sdcc -lstm8 -mstm8 --out-fmt-ihx main.c
>stm8flash -c stlinkv2 -p stm8s001j3 -w main.ihx

The stm8flash command usually needs to be executed twice, the first rarely takes. A successful flash outputs something similar to this

Determine FLASH area
Due to its file extension (or lack thereof), "main.ihx" is considered as INTEL HEX format!
4456 bytes at 0x8000... OK
Bytes written: 4456

I apologize for the lack of code comments but I don’t really care enough to do something about it :/

The colors may be inverted depending on the TFT LCD type you have. The simple fix is to locate the line ST7735_Write(ST7735_INVOFF, CMD); in the main.c file and change it to ST7735_Write(ST7735_INVON, CMD); or vice versa. Then recompile and reflash.

The official documentation for this chip can be found at https://www.st.com/resource/en/datasheet/stm8s001j3.pdf

About

Repository of mini badges using the stm8s001j3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published