1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

STM8S programming.

Discussion in 'Embedded' started by Daniel Pitts, Mar 24, 2014.

  1. Daniel Pitts

    Daniel Pitts Guest

    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:


    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?

    Daniel Pitts, Mar 24, 2014
    1. Advertisements

  2. Daniel Pitts

    Tim Wescott Guest

    There aren't any PICs that do that?
    Tim Wescott, Mar 24, 2014
    1. Advertisements

  3. Daniel Pitts

    David Platt Guest

    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
    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).
    David Platt, Mar 24, 2014
  4. Daniel Pitts

    Mel Wilson Guest

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

    Mel Wilson, Mar 24, 2014
  5. Daniel Pitts

    Ian Malcolm Guest

    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


    However pricing is around a dollar depending on package and quantity. [:(]
    Ian Malcolm, Mar 27, 2014
  6. 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
    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 van Ooijen, Mar 30, 2014
  7. Daniel Pitts

    Daniel Pitts Guest

    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

    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.
    Daniel Pitts, Apr 7, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.