Oct 6, 2010

Very Low Cost Cortex-M3 Board: STM32

This is fun. Playing with mcu from different manufacturer. They are all ARM architectured but after playing with some demo codes you'll realize that the way they are programmed is different, not only because the prepared library is different but also because the hardware features.
STM32F103RBT6 has 128kbytes flash while STM32F103R8T6 has 64kbytes only. Both equipped with USB interface and 20kbytes SRAM. I found one minus point of this mcu; the compiling time is a bit longer than LPC2100. STM32 has Boot0 and Boot1 pins, on this board Boot1 is always 0 (PB2). To program, switch Boot0 to VDD and reset. To run your code, switch Boot0 to GND and reset. VDDA and VSSA are power supply for analog circuit (ADC and DAC), as usual make sure they are connected as close as possible to power supply to avoid digital noise come in to the analog circuit. Or, you can prepare a separated filter for analog power supply.

I use Flash Loader Demonstrator software to transfer the hex code from PC to mcu, it's free software provided by STMicroelectronics for non-commercial use (I think so, then it's called demonstrator).You can use RS232/TTL converter if you PC has COM port, or use USB/TTL converter if no COM port. So exciting when top speed 115200bps works perfectly, it doesn't take that long to download a big size hex.








Finally, there is a report telling the status of download. Instead of hex, the code size is shown in decimal numbers makes user easily estimate the flash space left. STM32F103RBT6 costs less than 5USD/pc. Need cheaper one? STM32F103R6T6 with 32kbytes flash and 10kbytes SRAM. All those three chips are 64 pins package. Googling for STM32 family, there are wide range of ports, memory, speed and peripherals available.
If you rich enough, of course you can buy a ready made development system costs 100-400USD but too much playing with software will make you less experience with the hardware. Try it and enjoy!




Here we are, finally I managed to upload a photo of the matrix board. It looks similar with LPC2100 mcu because same LQFP64 footprint. Zoom in a bit on the chip, you'll see the ST logo on it. One more interesting thing, STM32 has internal oscillator so you can take the crystal off the circuit.











Below is example code of LED blink on PB5.
https://docs.google.com/file/d/0Bz15eKH_erJrUDhFbWMxTjVPSlE/edit?usp=sharing

MCP4725 I2C 12-bit DAC and STM32F103C8T6

This breakout development board can be found easily online. The interface is I2C, for other microcontroller it's easy to hook up and ...