STMicroelectronics recently released the STM8S-Discovery evaluation board for their STM8S family microcontrollers, with an RRP of $7. It features a STM8S105C6 running at up to 16MHz, offering 32KB of program memory, 2KB of RAM and 1KB of data EEPROM. An ST-LINK is integrated with the evaluation board, allowing you to program and debug the microcontroller over USB. You get up to 38 general-purpose I/O pins, and a nice range of on-board peripherals to play with (UART, SPI, IC, ADC, timers). You get an LED and a touch-sensing key built in to play with, and all of the microcontroller's pins are brought out on standard 0.1" pin headers to connect to your own circuits.

Whilst the price and power makes this an attractive platform, getting started with ST's current documentation and samples are frankly baffling for the beginner and there's not much out there in terms of community support. In light of this, I've written an STM8S-Discovery tutorial for the beginner, covering all the basics of this platform (you will probably need some basic experience with C and microcontrollers to get the most out of it, however). Yes, I know this is spam, but I thought some people here may be interested. Wink

Has anyone else here bought one of these devices, and if so how have you got on?
I ordered one, but its backordered (mouser)
Kllrnohj wrote:
I ordered one, but its backordered (mouser)


Protip: Never order from Mouser unless you have to; there are far cheaper distributors to buy from (Digi-Key, Jameco, MCM, Newark, etc.)
Ultimate Dev'r wrote:
Protip: Never order from Mouser unless you have to; there are far cheaper distributors to buy from (Digi-Key, Jameco, MCM, Newark, etc.)


Digi-key is the same price but was already OOS when I went to order. Mouser was still showing some in stock. But I'll keep that in mind for future orders.
After looking at the datasheets for this device maybe we could use this in the kit? It's very cheap and packs a large amount of features in a devboard for only $7; however, like Ben said, the documentation could be better; I may order one to play with for Christmas Smile

EDIT: I bought 2 from Avnet Very Happy
As ST have put the recommended price on their website I don't think there'll be that much price variation between distributors, fortunately. Smile

It may be a nice alternative or addition for the kit - its integrated USB debugger certainly helps - but even with its pin headers it's harder to connect to a breadboard to use with your own components than a DIP chip would be. I haven't decided how I'm going to handle this myself - can you get leads with a pin on one end and a pin socket on the other? I was probably going to solder some wires to a pin socket strip.
benryves wrote:
can you get leads with a pin on one end and a pin socket on the other?


Yes but they're pretty hard to find. I remember buying some a few years ago but I can't remember from where...

EDIT: Good 'ole SparkFun has them http://www.sparkfun.com/commerce/product_info.php?products_id=9139 Very expensive though; I remember paying only a few bucks for mine...
Ultimate Dev'r wrote:
EDIT: Good 'ole SparkFun has them http://www.sparkfun.com/commerce/product_info.php?products_id=9139 Very expensive though; I remember paying only a few bucks for mine...


That is also a pack of 100. Couldn't you always just make some yourself, though? You don't need many for this, do you?
Kllrnohj wrote:
Ultimate Dev'r wrote:
EDIT: Good 'ole SparkFun has them http://www.sparkfun.com/commerce/product_info.php?products_id=9139 Very expensive though; I remember paying only a few bucks for mine...


That is also a pack of 100. Couldn't you always just make some yourself, though? You don't need many for this, do you?


But I bought a pack of 500 for half that; you could make them yourself, if you have the right tools and patience. For this particular devboard you wouldn't need too many, so maybe a pack of 10 or 20 would do it (SparkFun sells a pack of 10 for ~$4). I'd have to check to see how many pins are on the header for the dev board.

EDIT: Here's a guide if you want to make your own breadboard jumper cables: http://www.basicxandrobotics.com/tutorials/jumpers/index.html

EDIT2: Found my receipt from when I bought mass quantities of jumper wire; seems I bought it from eBay, but "the seller is no longer a registered user" Sad
Cheers! It's good to know they exist; all I've found on eBay thus far are the regular male-to-male variety, but I'm sure I can do some digging (buying stuff from the US usually imposes ridiculous postage charges). Yes, you can make them yourself but for that you'd need some crimp connectors and a crimping tool, so however I go about it I'll need to place an order somewhere. Smile
Ultimate Dev'r wrote:
But I bought a pack of 500 for half that; you could make them yourself, if you have the right tools and patience. For this particular devboard you wouldn't need too many, so maybe a pack of 10 or 20 would do it (SparkFun sells a pack of 10 for ~$4). I'd have to check to see how many pins are on the header for the dev board.
There are four blocks of 2x6 pin headers, so 48 pins total.
Regarding the OP: yes, I remember seeing this story on Hackaday a week or two ago. It looks like a very affordable and palatable way to get into microcontroller development, and I certainly hope to get one soon (as well as that TI watch, of course Very Happy ).
Just got my tracking number from Avnet Very Happy It seems that FedUp recycles tracking numbers, as early this morning I got tracking details for a package shipped back in January and this afternoon I got the tracking details for my package. Now I have F5 Syndrome Laughing
So Ben, I saw on your blog that you got yours and you've been playing around with it; any comments or criticisms yet?
I've been messing around for the past week or so with mine; IMO this dev board is not "beginner friendly".
Woo, very nicely done. I'd expect a project of that magnitude to be relatively trivial; exactly how nontrivial was that?
KermMartian wrote:
Woo, very nicely done. I'd expect a project of that magnitude to be relatively trivial; exactly how nontrivial was that?


Very; it was just a test to make sure I got my dev environment setup properly (ST needs to document their products better; their forums are very helpful though). Here's the code:


Code:
#include "stm8s.h"

/* Evalboard I/Os configuration */

#define LEDS_PORT (GPIOB)

void Delay(u16 nCount)
{
  /* Decrement nCount value */
  while (nCount != 0)
  {
    nCount--;
  }
}

void main(void)
{
   u8 Leds = 0x00; /* Contains which LEDs to operate */

   /* Initialize I/Os in Output Mode */
   GPIO_Init(LEDS_PORT, GPIO_PIN_LNIB, GPIO_MODE_OUT_PP_HIGH_FAST);

   /* Forever loop */
   for(;;)
   {      
      while( Leds < 0x10)
      {
         /* Turn on LEDs, wait, turn off, wait */
         GPIO_WriteLow((LEDS_PORT), Leds);   
         Delay((u16)60000);
         GPIO_WriteHigh((LEDS_PORT), Leds);
         Delay((u16)60000);
         /* Increment counter */
         Leds += (u8)0x01;
      }
      /* Reset counter to 0 */
      Leds = 0x00;
   }
}


Also, Cosmic compiler > Raisonance compiler (Cosmic has much more robust debug features).
Sorry for missing your post, Kerm. I'd agree with Ultimate Dev'r - it's not beginner friendly, but that's chiefly due to the relatively poor quality of the documentation at the moment (I tried to rectify this with the tutorial I wrote). I also omitted a step in the tutorial (setting the MCU type for the firmware library, which prevents you from using some of the on-board peripherals - see the end of the Adding the standard firmware library section). I probably should have posted this in here too, sorry!

@Ultimate Dev'r: Does your while loop delay work with optimisations on? I had to bung a nop(); inside my delay loops to prevent the compiler from optimising them away!

I've written a simple VGM player for the STM8S (source code, information and MP3 recordings here).
benryves wrote:
Sorry for missing your post, Kerm. I'd agree with Ultimate Dev'r - it's not beginner friendly, but that's chiefly due to the relatively poor quality of the documentation at the moment (I tried to rectify this with the tutorial I wrote). I also omitted a step in the tutorial (setting the MCU type for the firmware library, which prevents you from using some of the on-board peripherals - see the end of the Adding the standard firmware library section). I probably should have posted this in here too, sorry!

@Ultimate Dev'r: Does your while loop delay work with optimisations on? I had to bung a nop(); inside my delay loops to prevent the compiler from optimising them away!

I've written a simple VGM player for the STM8S (source code, information and MP3 recordings here).


Strange; your for loop doesn't get optimized out when I comment out the nop statement; what optimization settings did you have enabled (and what compiler were you using?)

Also, I wish I had known about your tutorial earlier; would've saved me a considerable amount of time Very Happy
Ultimate Dev'r wrote:
Strange; your for loop doesn't get optimized out when I comment out the nop statement; what optimization settings did you have enabled (and what compiler were you using?)

Ah, that could be it. I initially wrote an LED flashing program using Raisonance (the licence key came instantly so I started with that) and that definitely optimised the loop away. However, none of the samples compiled with Raisonance so I switched to Cosmic's compiler, but didn't check to see if that also optimised the loop away. I'd be a bit surprised if it doesn't (I know AVR-GCC does the same trick).
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement