Searching the prequisite Chinese websites to satisfy my shopping fetish I came across a neat litte ARM Cortex-M0 chip which is a extremely good bang for buck. It is the SWM050 made by Synwit, which, I believe, is the smallest chip available in a reasonable hand-solderable package (TSOP8). Other manufactures may have smaller package but they are the tiniest BGA chips which even I dont dare to solder.
– operates from 3.3v or 5V
– max 36Mhz using internal clock
– ARM Cortex-M0
– 8KB FLASH, 1KB SRAM
– 6/10 GPIO
– 2 32bit timers with PWM
– Watchdog timer
– (almost hobbyist) friendly tsop8 or tsop16 package
It has not got very impressive peripherals, but when it comes to its price it is a killer. In large quantities the chip will costs only a few dimes. With all these advantages there must be a big catch, and there is a major one: All info is in Chinese and chinese only, so a bit of creativity is needed here. Link to the original datasheet and platform libraries.
DirtyPCBs offers a cheap way to get (low resolution) photos of the die, a service I always wanted to check out. I send in the chip and got the 4 pictures back. They buy this service from a disclosed Chinese source, which main business is to provide pictures of the die to prove a chip is genuine and not a clone or old stock. They mainly focus on chip markings. Since I’m not a graphics artist I used the builtin tools in Windows 10 to ‘stich’ the pictures to one. I included the source pictures in my GitHub in case some else wants a go.
There is no standard/generic way of programming flash ROM of an ARM chip. All chip manufacturers provide their own tools and hardware to program it. As most of my ARM adventures uses the Blackmagic Probe I decided to add support for this chip into Blackmagic Probe. Unfortunately the datasheet doesn’t tell how to program its flash directly. According to the datasheet there must be some ROM present which contains the necessary subroutine. Digging around with the BMP in that memory area ( 0x100XXX) shows up nothing.
Luckily they provide a plugin for the JLINK JTAG Segger. These plugins contains a couple of binairy blobs that get loaded onto the device in order to program it. I downloaded their JLINK device package from the SYNWIT website and disassembled the flash programming stub included therein. I’m not that big expert in ARM thumb assembly so it took me about a day to figure it out. Disassembled file and pseudocode is found in my [Github].
The other effort I made is (a largely machine) translated set of .h files that describes all its 999+ registers, a crt0.s and makefile to get you started. Be sure to flash my version of the Blackmagic to be able to flash this chip. There is also a serial based bootloader buried somewhere in silicon but it requires the install of a vague Chinese application (shrug)..
I got a couple of these chips and designed a small breakout, which is available on my tindie store. The breakout consists of a small PCB which has the GPIO and programming pins conveniently broken out. Power is delivered through a micro USB connector, a couple of LEDs and switches to get you started immediately with all your blinky needs.