Search This Blog

Monday, July 30, 2018

Misc 8-bit uC projects


 Projects / Misc 8-bit uC projects

Original post date:11/15/2016

There are small cost sensitive projects that a 8-bit uC might be a better fit.

STM8S003 is a 8-bit chip from ST.  It is not particularly fast nor resourceful. It is at the price point of a fixed function jelly bean analog or logic chip which makes it interesting.



STM8F family features
One of the things that the STM8 series is different than their STM32F is that the chip is a bit "easier" to use as is without having to turn on clocks for the peripherals.  Most of the the defaults sort of make sense. On the other hand, it is less flexible as they take away some of things you could do at run time.

The STM8 uses Option byte 2 (OPT2) in EEPROM to manage mapping of multiple alternative peripherals to the same I/O. These option bytes can be written via SWIM or from firmware.


Memory Map

This chip uses a Harvard architecture, but with same logical address space. It is possible to be running code from RAM at a slower speed due to the reduced bus width (8-bit vs 32-bit for FLASH).


Breakout boards:

  1. STM8 breakout board
    - generic TSSOP20 breakout board available here.  Put down a few passives and you are done.
  2. STM8 breakout board with usb serial
  3. Breakout boards from China for about $1 and up.

Compilers:

  • SDCC (open source) retargettable, optimizing Standard C (ANSI C89, ISO C99, ISO C11) compiler suite.  SWD support with FTDI, Versaloon, J-Link, sysfsgpio using OpenOCD.
  • Cosmic is creating CXSTM8, a professional C compiler for STM8 (COS-C-COMPILER), that comes for free whatever the STM8 silicon. This product is supplied by a third party not affiliated to ST.
"March 2016 news: the stm8 compiler is now available in a free version with no technical limitations and that also includes support. More information
To use this product you must register with Cosmic Software (this page) and then get a special license after installation. After your registration, you will be able to download the software; download it and then start the installation. The installation procedure will instruct you to send a message to Cosmic Software with your PC data; as a result you will receive the appropriate free license (limited to 1 year, renewable) for this product."
Note: Documentation is under "COSMIC\FSE_Compilers\CXSTM8\Docs" after installation
Cosmic C compiler bugs - found 2 so far

Programming/Debugging:

SWIM (Single Wire Interface Module) can be used as a debug/program interface. STLink2 also supports SWIM and you can buy clones for around $2 from China.

ST Visual Programmer (STVP) - stand alone programming software for Windows
How to Program STMicro STM8S $1 Board in Linux
STM8 software for test the configuration

A short tour for the above development environment.  Also read about this STM8C header file and peripheral library,  and my alternative IRQ header file.

Fun exercise with assembly code:  STM8 Software SPI

Reference links:

http://blog.mark-stevens.co.uk/category/stm8/
http://blog.mark-stevens.co.uk/2013/09/storing-data-eeprom-stm8s/

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.