Forums

STM8S programming.

Started by Daniel Pitts March 24, 2014
I was looking for a cheap MCU with > 384 bytes of memory and at least 6 
IO lines and 16MHz or better. The cheapest I found on digikey for my 
requirements was this one:

http://www.digikey.com/product-detail/en/STM8S003F3P6/497-11946-5-ND/2765682

I have some experience programming AVR chips, but no experience with 
STM.  I'm an experienced C and C++ programmer, so writing the actual 
code wouldn't be a problem.

Start-up cost is an important consideration for me, since I'm just doing 
a few hobby projects, and don't want to spend hundreds on hardware just 
to play around.

How hard is it to get up-and-running with these?
What tool-chain should I use?
Are there CLI tools for uploading the program?
I have no access to an Windows machines, will that cause problems? Only 
Mac, BSD or Linux at the moment.
Do I need specialized hardware to program it, or could I easily use an 
Arduino as a programmer?


Anything else I should be aware of?

Are there other alternatives that I'm missing?

Thanks,
Daniel.
On Mon, 24 Mar 2014 11:48:40 -0700, Daniel Pitts wrote:

> I was looking for a cheap MCU with > 384 bytes of memory and at least 6 > IO lines and 16MHz or better. The cheapest I found on digikey for my > requirements was this one: > > http://www.digikey.com/product-detail/en/STM8S003F3P6/497-11946-5-
ND/2765682
> > I have some experience programming AVR chips, but no experience with > STM. I'm an experienced C and C++ programmer, so writing the actual > code wouldn't be a problem. > > Start-up cost is an important consideration for me, since I'm just doing > a few hobby projects, and don't want to spend hundreds on hardware just > to play around. > > How hard is it to get up-and-running with these? > What tool-chain should I use? > Are there CLI tools for uploading the program? > I have no access to an Windows machines, will that cause problems? Only > Mac, BSD or Linux at the moment. > Do I need specialized hardware to program it, or could I easily use an > Arduino as a programmer? > > > Anything else I should be aware of? > > Are there other alternatives that I'm missing? > > Thanks, > Daniel.
There aren't any PICs that do that? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
In article <c6%Xu.66355$086.23448@fx18.iad>,
Daniel Pitts  <newsgroup.nospam@virtualinfinity.net> wrote:

>Start-up cost is an important consideration for me, since I'm just doing >a few hobby projects, and don't want to spend hundreds on hardware just >to play around.
ST has "discovery" boards for many of their processors. These boards are quite inexpensive. They include a sample micro (soldered down), some peripherals, and a USB-based "ST-Link" interface which serves as the programming and debugging interface. In at least some of these boards, the ST-Link can be switch-configured to drive a set of external pins on the board, rather than the on-board micro's pins... so, you can use a Discovery board as a stand-alone programmer for your own boards which have these chips. Consider, though, that the chip cost may be a small fraction of your total "play around" cost for simple projects. Having easier, or cheaper, or more-accessible chip programming and downloading support might be a much bigger saving for you than $0.50 per chip in processor cost.
>How hard is it to get up-and-running with these?
The Discovery boards usually have a downloadable development kit with a compiler or assembler, and sample applications. The biggest disadvantage is that they're all Windows-based, as far as I know.
>What tool-chain should I use?
For something this small, you'll probably want to use assembler.
>Are there CLI tools for uploading the program? >I have no access to an Windows machines, will that cause problems? Only >Mac, BSD or Linux at the moment.
Weak point for ST - they seem to support only Windows, and there's not much of a third-party Linux presence for these chips. This puts them at a big disadvantage compared to AVR, ARM, and PIC. I've read that the ST-provided programming IDE can be made to run on Linux under WINE - this might be a workable approach for you. Access to the ST-Link programming system through WINE may not be possible. However, I believe I've read that somebody has gotten ST-Link support for the Discovery boards into the open-source OpenOCD application suite, so you might be able to develop using a WINE-hosted ST toolchain and then flash the chip using OpenOCD.
>Do I need specialized hardware to program it, or could I easily use an >Arduino as a programmer?
You can almost certainly "bit-bang" the programming cycle using an Arduino, or even a simple parallel-port programming cable. Or, with a Discovery board, use OpenOCD (I think).
David Platt wrote:

> In article <c6%Xu.66355$086.23448@fx18.iad>, > Daniel Pitts <newsgroup.nospam@virtualinfinity.net> wrote:
[ ... ]
> I've read that the ST-provided programming IDE can be made to run > on Linux under WINE - this might be a workable approach for you. > > Access to the ST-Link programming system through WINE may not be > possible. However, I believe I've read that somebody has gotten > ST-Link support for the Discovery boards into the open-source OpenOCD > application suite, so you might be able to develop using a WINE-hosted > ST toolchain and then flash the chip using OpenOCD.
This is true. I've used OpenOCD with STM32-based DISCOVERY boards, though not with STM8. Mel.
Tim Wescott <tim@seemywebsite.really> wrote:

> Daniel Pitts wrote: > >> I was looking for a cheap MCU with > 384 bytes of memory and at least >> 6 IO lines and 16MHz or better. The cheapest I found on digikey for >> my requirements was this one: >> >> http://www.digikey.com/product-detail/en/STM8S003F3P6/497-11946-5- > ND/2765682 >>
<snip>
>> >> Are there other alternatives that I'm missing? >>
> > There aren't any PICs that do that?
First you have to decode his specification. 16MHz or better is fairly meaningless as microcontrollers in general do not have a 1:1 relationship between oscillator frequency and instruction execution rate. I belive the worst case is the original 8051 which took twelve cycles per instruction. The STM8 core is clamed to average 1.6 cycles per instruction so perhaps Tim is looking for a 10 MIPS processor? 8 bit PICs run at four cycles per instruction so that would be: clock speed >= 40MHz I amk assuming that if price is a major constraint, he wants an internal oscillator. Together with his other requirements this leads to the PIC16F1454. <http://www.microchipdirect.com/ProductSearch.aspx?keywords=PIC16F1454> However pricing is around a dollar depending on package and quantity. [:(] -- Ian Malcolm. London, ENGLAND. (NEWSGROUP REPLY PREFERRED) ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk [at]=@, [dash]=- & [dot]=. *Warning* HTML & >32K emails --> NUL
Daniel Pitts schreef op 24-Mar-14 7:48 PM:> I was looking for a cheap 
MCU with > 384 bytes of memory and at least 6
 > IO lines and 16MHz or better. The cheapest I found on digikey for my
 > requirements was this one:
 >
 > 
http://www.digikey.com/product-detail/en/STM8S003F3P6/497-11946-5-ND/2765682 

 >
 >
 > I have some experience programming AVR chips, but no experience with
 > STM.  I'm an experienced C and C++ programmer, so writing the actual
 > code wouldn't be a problem.
 >
 > Start-up cost is an important consideration for me, since I'm just doing
 > a few hobby projects, and don't want to spend hundreds on hardware just
 > to play around.

You are doing a few hobby projects, and you are optimizing the price of 
your uC down to the 10's of cents? Makes no sense to me. If you allow a 
price up to $2 you can pick your choice of AVR, PIC or ARM. If you have 
exeprience & tools for one of those, why not stick what you know?

My choice would probably be an LPC81x.

Wouter
Apologies if this is a repeated post. My newsreader claims that it got 
sent, but the my news service provider says no such message. I'm sending 
again.

On 3/30/14 4:44 AM, Wouter van Ooijen wrote:
> Daniel Pitts schreef op 24-Mar-14 7:48 PM:> I was looking for a cheap > MCU with > 384 bytes of memory and at least 6 > > IO lines and 16MHz or better. The cheapest I found on digikey for my > > requirements was this one: > > > > > http://www.digikey.com/product-detail/en/STM8S003F3P6/497-11946-5-ND/2765682 > > > > > > > I have some experience programming AVR chips, but no experience with > > STM. I'm an experienced C and C++ programmer, so writing the actual > > code wouldn't be a problem. > > > > Start-up cost is an important consideration for me, since I'm just doing > > a few hobby projects, and don't want to spend hundreds on hardware just > > to play around. > > You are doing a few hobby projects, and you are optimizing the price of > your uC down to the 10's of cents? Makes no sense to me. If you allow a > price up to $2 you can pick your choice of AVR, PIC or ARM. If you have > exeprience & tools for one of those, why not stick what you know?
My "hobby" is trying to do things cheaply while learning something I didn't already know. So that's why I'm trying to optimize price and I'm not sticking to something I know. If my prototypes turn out well, I may try to sell them. I've had people already say they would like one.