STM8S programming.

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:

formatting link

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.

Reply to
Daniel Pitts
Loading thread data ...

ND/2765682

There aren't any PICs that do that?

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

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.

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.

For something this small, you'll probably want to use assembler.

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.

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).

Reply to
David Platt

This is true. I've used OpenOCD with STM32-based DISCOVERY boards, though not with STM8.

Mel.

Reply to
Mel Wilson

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.

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
Reply to
Ian Malcolm

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: > >

formatting link

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

Reply to
Wouter van Ooijen

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.

Reply to
Daniel Pitts

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.