STM8S-Discovery: Microcontrollers Reach A New Low

A complete microcontroller development kit for little more than the cost of a bare chip? That’s what STMicroelectronics is promising with their STM8S-Discoveryseven dollars gets you not only a board-mounted 8-bit microcontroller with an decent range of GPIO pins and functions, but the USB programmer/debugger as well.

The STM8S microcontroller is in a similar class as the ATmega328 chip on latest-generation Arduinos: an 8-bit 16 MHz core, 32K flash and 2K RAM, UART, SPI, I2C, 10-bit analog-to-digital inputs, timers and interrupts and all the usual goodness. The Discovery board features a small prototyping area and throws in a touch-sense button for fun as well. The ST-LINK USB programmer/debugger comes attached, but it’s easy to crack one off and use this for future STMicro-compatible projects; clearly a plan of giving away the razor and selling the blades.

The development tools are for Windows only, and novice programmers won’t get the same touchy-feely community of support that surrounds Arduino. But for cost-conscious hackers and for educators needing to equip a whole classroom (or if you’re just looking for a stocking stuffer for your geeky nephew), it’s hard to argue with seven bucks for a full plug-and-play setup.

[thanks Billy]

223 thoughts on “STM8S-Discovery: Microcontrollers Reach A New Low

  1. Sweet… this is less $ than the discrete components I picked up to sense occurance of *things* and then trigger a battery powered camera flash after an adjustable settable delay time.

    Think water drop photography
    (photodiode / light beam affected by passing of water drop) … starts the timer

    Or balloon bursts
    (microphone senses sound)

    gotta order 3 just to see the quality of the smoke they stuffed inside (tribute to a lab partner who applied line voltage across and IC when he got the resistor divider pair reversed on a project 30+ years ago)

  2. Ordered one yesterday from Future Electronics and it arrived today, not bad for a total of ~$17 including tax and shipping. I can’t wait to pick it up.

    My two cents on the lack of a linux compiler: stop whining. I’m a linux-exclusive computer user, and I still ordered one, simply because someone, somewhere (maybe even myself or you) will port a compiler to this architecture. In the meantime, I can make do with wine.

  3. does anyone know that will ship inexpensively to italy? the shipping cost is much higher than the board.

    I checked most of the distributors. All of them has the board on Backordered :(

  4. Stop calling it whining. It is called complaining, and it is a valid form of communication to express disappointment, unusual treatment of matters, opposing your reception. Have fun with your new toys and I mean it.

  5. I’ve only used basic stamp thus far and I’ve been wanting to go to something more powerful. I was going to dive into the arduino, but this one is very tempting. is this something someone at my experience level could dive in to? I don’t know C yet, but I’d like to learn.

  6. @walt

    Nope. If you encounter problems, no one is there to help you quickly. AVRs, PICs, etc all have huge knowledge bases and forums to help you, and this thing does not.

    I would spend the extra money and get a AVR or PIC development board, that way when you have problems you can just hop on a forum and get some replies.

  7. pretty cool, having internal USB increases the usefulness no end.

    Why they didnt include at least 1 Mbyte 8 pin Flash. ? koff USB datalogger /koff

    As is, its ideal for building small milling machines, etc with external stepper drivers.

  8. “The following products relating to your Farnell order X have now been shipped from our warehouse.”

    Yay! How long will it take to the UK? £4.80 for a developing environment, not bad even if it doesn’t support my OS of choice.

    I never have and never will buy a copy of Windows, or anything developed by Microsoft, and this should hopefully be able to run on Linux, I’m not sure with Wine and hardware…

    Anyone know if the STM8S supports SPI i2c etc? I’m too cheap to buy an Arduino (Student, limited funds!), and I prefer to code real languages. I wonder how good the Discovery’s IDE C is, is it just like plain old C just with their libraries?

    Chris

  9. Hmm, had my sample order status listed as ‘Accepted’ a few days ago, now the ‘my order history’ tab shows nothing anymore. No emails or anything, so I have no idea what’s going on.

  10. Just got my sample. Agree that the scope of the support could be better. The datasheet isn’t on par with the stuff published by Atmel. For example, with the Arduino you can either use the Arduino libraries, or refer to the Atmega168 datasheet to configure registers, such as the USART serial config bits, yourself. I find no such bit config info re the UART2 registers on this ST device. But at least it was free…

  11. “Access line, 16 MHz, STM8S 8-bit MCU, up to 32 Kbytes Flash, integrated EEPROM, 10-bit ADC, timers, UART, SPI, I²C”. Should have just reread the article >.>

    Looks good, hopefully the C bindings wont be terrible.

  12. Sold out at all but one vender i’ve found, and they won’t ship outside of the UK…
    i should have jumped on this one right away

    ST appears to no longer be accepting sample requests for these

  13. Guys,

    We have sold all the inventory of STM8S-discovery, thousands of those have been purchased or given within 3 days.
    Don’t worry we are replenishing the stocks.

    I suggest to place your orders and reserve the kit in order to be served.

    Don’t hesitate to post questions, I will personally on this blog.

  14. By the way,

    For those using freesampling, you have to register and give your company name and official contact information. We are giving sample for free after a identification. (sorry for the hobbyists).
    With the buy on line @ $7 it should be OK. What is $7? A beer in SFO?

  15. “For those using freesampling, you have to register and give your company name and official contact information. We are giving sample for free after a identification. (sorry for the hobbyists).”

    I hope this doesn’t exclude students. It would be foolish for a company to give out samples only to companies, as when asked what technology (software, chips, whatever) a project should use, new-grads will often suggest what they know.

    By excluding students, a company would be losing out on potentially a huge market of new-grads that know their software and hardware.

    To be honest, as a student about to graduate (april 2010) in computer engineering, I didn’t even know STMicroelectronics existed, let alone produced something I could use.

  16. @ Dan – yeah, I’ve done a few ignitors over the years. This one’s a custom jobbie for an XT600-engined racebike, single cylinders are a piece of pish to do, but I’ve done inline and vee fours as well over the years. All CDI, not TCI. TCI is a bit harder to do.

    If you want a quick kickstart into CDI projects, try transmic.net, there’s a fairly simple pic-based single-cylinder CDI project there.

  17. @Peter

    As a student, I agree with you 100%. I think good sampling programs make for very efficient marketing.

    I requested a sample of this development kit. However, I haven’t received any confirmation, and there is no record of my request. I assume my request has been ignored.

    This is in stark contrast to Microchip. They have always been excellent about fulfilling sample requests for their PIC microcontrollers. If it weren’t for their sampling program, I probably would have never become familiar with Microchip’s PIC products. Because of this familiarity and a general feeling of goodwill toward Mircochip, I find myself recommending their products often to people working on projects requiring microcontrollers.

    STMicroelectronics might have a great product, but I guess I’ll never know. When I am in the position of choosing which microcontroller to use for a major project, guess which one I will be more likely to choose?

  18. This is starting to depress me now… I’ve been looking for library documentation/LED example, and I can’t find a thing.

    I think this’ll just be one of those, “buy it and throw it in a cupboard for 6 years” things. I’m not an avid user of C, but I know the basics, and the only examples I can find are benchmarks.

    Wouldn’t get this with Microchip/Atmel…

  19. I have looked on there, but there are no decent examples, and the default application’s source looks kinda complicated.

    I’ve tried making something that just turns LD1 on, but there isn’t even (as far as I looked) on the port configs…

  20. Chris: You’re doing better than me, then. I’ve been trying to get the sample program to build for the last two hours; apparently it’ll only work with the Cosmic compiler (I’ve got the Raisonance one down to a mere 11 errors). Some steps in the documentation can’t be carried out with the Raisonance compiler either, as UI options are missing. The Cosmic compiler is only spitting out three errors, but that’s because it can’t find a licence key (which hasn’t turned up yet).

  21. Has anyone actually got one of these running?
    I’ve used AVR up to now but the price tempted me to buy a couple from Farnell in the UK and I have been struggling ever since.
    I found that the Cosmic licensing process is manual: registration Friday night got my license file Monday. Raisonance issued a license key much more quickly, but like Ben Ryves I found that the sample code (Discover) seems incompatible with the Raisonance compiler – different keywords for interrupts, memory model(?), address specification etc.
    But the worst problem is that I can’t get the PC to talk to the board. ST Visual Programmer (STVP) crashes Windows immediately when I try to get it to read anything from the board (e.g. option bytes).
    As far as I can tell, no driver for the board is installed with STVP, so Windows picks it us a a USB mass storage device, which doesn’t seem right.
    I’ve posted a question on the STM8S forum but got no reply, so if anyone out there can give some pointers I’d be grateful.
    Arduino-knocking has been a theme here recently, but to its great credit the Arduino does work out of the box. ST on the other hand could lose me before I ever get started.

  22. Just tried on another PC and I can talk to the board OK. This one uses the USB mass storage device driver too.
    Unfortunately the driver versions on both machines are the same, so I’m no closer to finding why my main machine crashes so horribly.

  23. I got somewhere in the end by using Ride (Raisonance’s own IDE) on its own, ignoring ST’s IDE and documentation. See the website link on my name for a zipped archive of my project folder (hope it works on your machine) – the source is not going to win any awards for style, but it flashes an LED using the GPIO routines and a nice old-fashioned delay loop (optimisations must be switched off, else the LED will flicker too fast to see – no timer hardware usage here). I used ST Visual Programmer to send the .hex file to the board. It’s not much, but it’s a start..! I guess that an third-party tutorial would help a lot, but I suppose these things are to be expected with a new product. You can’t really complain for the price, either!

    @smh: My board shows up as a mass storage device (drive ID: STM32) containing several shortcut files to the ST website. It did also show up as an ST-LINK (I think?) when I first plugged it in and Windows did its automatic driver-installation magic, but I can’t see it in Device Manager under that name any more. That said, I haven’t had any problems reading from the board or writing to it – have you tried a different port/computer?

  24. I am familiar with RIDE from 8051 programming, it is a shame about the 16k limit though, that alone is enough to put this product far below PIC and AVR microcotrollers that both supply unlimited free C compilers

  25. @All
    For those who are expecting free sampling : In front of the success St is prioritizing the buy on line through distributors. (Sorry for those who can’t afford to pay 7 bucks)
    In got information on availability in few weeks from now.

    Regarding technical problems seen with STVD/STVP I strongly suggest to use the STM8 Forum.

    Finally I confirm that examples will be posted be patient.

  26. @patocheham: the STM8 forum is awfully quiet when you’re struggling to get things going. Let’s hope it gathers some momentum soon or the interest ST has generated will dissipate very quickly. This is a new device so the amount on useful information available on-line is far behind PIC and AVR.

    @Ben: A different computer worked; a different port did not, so I’ve evidently got some digging to do. Thanks for your comments: it is helpful to know that the device is meant to be picked up as a USB mass storage device.

  27. @Ben Thanks! I did look inside the stm8s_gpio.h and made my own project inside ST Visual Develop.
    #include
    #include

    int main(void)
    {
    GPIO_DeInit(GPIOD);
    GPIO_Init(GPIOD, GPIO_PIN_0, GPIO_MODE_OUT_PP_LOW_FAST);
    GPIO_WriteLow(GPIOD, GPIO_PIN_0);
    while(1);
    return 0;
    }

    (Hopefully that’ll paste here nicely.)

    Anyway, I couldn’t program the hex that RIDE7 outputted with STVP, so I put it in STVD and am programming it with the debug function, and it’s all working nicely.

    Is the any OOTB delay(int) function? I saw you used a for loop but that seems really weird…

  28. @Chris

    I went ahead and set up the development environment last week. I installed Cosmic and requested the license but never received it. I hope you have better luck.

    Despite the low price, I definitely don’t see this as an Arduino killer. I couldn’t even get a working compiler for it. This board might stand to compete with the Arduino if an open source compiler without licenses and limitations existed.

    I bought an Arduino recently to see what all the fuss is about. It seems perfect for quick and dirty hacks. It’s easy, and it just works. I’d love to see something as good for $7.

    Keep us posted on your progress.

  29. I’ll be writing Arduino-type basib library for this, as the inbuilt functions seem a little, erm, weird.

    Plus I’m used to Java, Object Orientation, so it doesn’t help having C only compiler.

    Anyway, I hope to have something simple soon, with digitalWrite etc. The Raisonance compiler works well for me, by the way (Instant licence).

    I have only a one major problem so far, one of the headers is bent a little, so no shields would work with it. I need to get onto Farnell, maybe they’ll send me another.

    I’ll post more later, and in the next few days I’ll be interfacing this puppy over SPI and IIC.

  30. Got it working with Cosmic (got the licence within a day). Tried Reisonance first, but after it started complaining on startup, quickly changed to Cosmic.

    Went through UM0834 (Developing and debugging your STM8S-DISCOVERY application code), set up the parameters (took me well over an hour, but it’s a good excersize, even though a beginer won’t learn much from this example), fixed three errors (.h and .c files not mentioned in the .pdf as needed to be included), got the Led blinking through Debug and also was able to program the “release” version using STVP.

    I agree with previous posters – an absolute lack of examples, even though the help file is a good refference, but to get something quickly most of us prefere a working code sample.

    Something that I haven’t seen mentioned here – in my eyes Arduino’s ability to talk to PC out of box (USB to RS232 interface used for boot loader can be used for two way communication once your code takes over) is a great plus!

    I’m not questioning benefits of ST-LINK and SWIM, especially ability to get a peek at all the registers and peripherals, but being able to send a “Hello world” back from MCU has it’ merrrits :)

    In my book, the first extension will have to be UART based “expansion” and UAT to RS232 converter in one of available PC’s USB ports :)

    Great piece of hardware (can’t beat the price either), good looking software environment, FirmeWare looks well thought, but will have to spend more time to get a better sense, and TOTAL LACK of user friendly documentation and code samples!

    It’s a gerat dissapointment to see only three (3) docs listed under “STM8S-DISCOVERY – Documents”!

    A bit more can be collected elsewhere, but that’s not that much either.

    Hope the discussino forum will pick up teh sepeed too, it’s a bit deserted now.

    As I hope we (users) will start producing some of the missing pieces (friendly manuals, code samples, hardware extensions, project ideas, …), ST would be smart to support us and provide a common place + expert review and assitance.

    Fingers crossed this picks up, looks very promissing now!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.