Dirt cheap (39 cent) MSP430 16-bit CPU as Prop peripheral
Peter Jakacki
Posts: 10,193
Someone mentioned the MSP430 launchpad on one of the threads a few weeks ago and it prompted me to have a look at this cute little fella that I used to use a decade ago. You never know, it might be worthwhile as a Prop peripheral.
Well, not only is the eval board, the "LaunchPad" really cheap (but good), like $4.30, just like the CPU, but they have practically the cheapest CPUs I've come across. I ordered 100 of the tiny but manageable 14-pin TSSOP versions for a total cost of $39 plus 3 of the LaunchPads and just started to play with them today. But which IDE to use? I started downloading Code Composer Studio and it's a whopping big file but in the meantime I stumbled across a command line assembler and debugger that runs straight from Linux. It's called "Naken430asm" and "mspdebug" and while they are command line utilities they just work without the huge overheads plus I'd rather program these babies in assembler.
From my initial attempt at getting back into the MSP430 saddle I can say it went very smoothly and things just work. I plan to make an I2C RTC (these chips are famed for getting along on a sniff of an oily electron) and peripheral I/O combo first so I will post the code but you have to get your own LaunchPads
My my.....I always have too many chips on my plate.........pass the mayo !
Well, not only is the eval board, the "LaunchPad" really cheap (but good), like $4.30, just like the CPU, but they have practically the cheapest CPUs I've come across. I ordered 100 of the tiny but manageable 14-pin TSSOP versions for a total cost of $39 plus 3 of the LaunchPads and just started to play with them today. But which IDE to use? I started downloading Code Composer Studio and it's a whopping big file but in the meantime I stumbled across a command line assembler and debugger that runs straight from Linux. It's called "Naken430asm" and "mspdebug" and while they are command line utilities they just work without the huge overheads plus I'd rather program these babies in assembler.
From my initial attempt at getting back into the MSP430 saddle I can say it went very smoothly and things just work. I plan to make an I2C RTC (these chips are famed for getting along on a sniff of an oily electron) and peripheral I/O combo first so I will post the code but you have to get your own LaunchPads
My my.....I always have too many chips on my plate.........pass the mayo !
Comments
http://tech.groups.yahoo.com/group/msp430/?yguid=293062608
Anyone interested in using the MSP430 should join it.
Yes, it's a great little chip; especially at the price.
I too use them as peripherals to the Prop as remore sensors which then communicate back via high speed comms over a 485 network. Beauty is these things wake up REAL fast from sleep, like in a couple of microseconds if you do it right. And for me that is very important as I need to conserve all the battery power I can for long periods of unattended operation. I've had good success with my Prop multi-tasking "OS", and I think soon I'll have a go at making one for the TI430. Should be a hoot!
Leon, I think I'd like to join your group.... sound like fun.
Cheers,
Peter (pjv)
Sign me up, I need more chips to program like I need more chips to eat!
(Leon, I'm just teasing, I find the majority of your comments refreshing and helpful. Experience sometimes makes for a crusty exterior but there's good stuff inside!)
I just approved your membership.
The MSP430 Launchpad that Peter mentioned only costs $4.30, I've got a couple of them. The chip is comes with is a bit limited, so I got some of the pin-compatible more capable ones to use in them. I've got a few PCBs I've made for some of the bigger chips.
It's some time since I used the MSP430, and I never activated my copy of the latest version of the Rowley software. I'm in the process of getting it going again. This new version supports the Launchpad, unlike the previous version, and I want to try it.
http://youtu.be/6p-TUhEFxPI?hd=1
P.S. in the examples change the label named 'RESET' to 'main', to avoid the warning.
- only another 15c, and it has ADC as well.... - another useful Prop peripheral.
A true RTC can run the i2c async, but I'd imagine the MSP430+PROP would need BOTH parts on faster RC clocks during i2c transactions.
So i2c comms need to be of a Cal-config nature only, and a Toggle pin would drive to Prop, waiting in MIN RC mode.
Not sure if the simplest MSP430 can toggle a pin at any frequency, without CPU wakeup ?
Also unclear is what the Icc is, if you run the CPU at 32.768K ? - or is the power budget such, you would always wake up a FastRC, and then go back to CPU off as soon as possible ?
Looks like a MSP430 can run a 32KHz Osc well under 1uA, which makes it lower power than any Logic Oscillator alternative.
and set to use a factory calibrated unique number in each chip.(even the cheapest 430 have a 1mhz setting)
mov.b &CALBC1_1MHZ,&BCSCTL1 ; Set DCO to 1MHz
mov.b &CALDCO_1MHZ,&DCOCTL
If you keep it at a steady temp and run a day long test first you probably could fine tune to be just off by 1sec/day.
Sounds optimistic, with specs around 0.5%/'C for low power Oscs.
One second a day, is ~11ppm, 1/432 of that 0.5% or a 2.3 milli-kelvin shift.
Why bother, when a 32KHz xtal is under 10c /1K, and can run under 1uA ?
Add a temperature sense, and you can correct the parabolic error to single digit ppm levels.
I think the 16 bit timer can capture, and that cal mode would need a fast RC operation, but only during calibrate.
TI is shipping 2553s and 2452s with the Launchpad for a few months now.
(But, I'll just add that I have several other cheap developer things like this that wind up just sitting around because they are a pain to program...)
- in that mode, no comms at all are needed.
2 Pins on the MSP430 would allow select of 4 (or more) rates, something like 1sec, 1/10s 5/s and ??
5 INCs a second is appx 27 years to wrap 32 bits.
There may be some apps where the Prop can simply run always on RCSlow, so a slower pulse rate could help there.
See also this thread, on what the Prop can go down to...
http://forums.parallax.com/showthread.php?129731-Prop-Limbo!-how-low-(power-voltage)-can-it-go!
We did a design once on a uC core-clocked at Mains Zero crossing. Partly to prove it could be done , and partly to get precise time at the very lowest cost.
Q: Has anyone measured the Icc of a MSP430 with core running from 32KHz clock ?
-- Gordon
Here's an old snippet of code to setup a UART (on a 'F149 chip).
BTW, I'm loving the simple yet powerful assembly code of the MSP430, it's such as relief from say the weird PIC assembly architecture for instance (good chip, archaic CPU) or the increasingly complex ARM. I notice that it seems impossible to get hold of a stand-alone absolute assembler (not backend compile/link/asm) for the ARM as they think that there is no need to do so as the magic C fairy will do it all for you. As one of the Banana Splits characters once said to Mildred (the robot) "Make me a milkshake" and Mildred unhesitatingly complied and proceeded to make the character into a milkshake. Compilers comply as long as you are compliant. Getting to know the current version of a compiler well enough so it doesn't turn you into a milkshake is a lot more work than getting to know the chip which is after all what you are really interested in.
Frank
I love the way you put that but I have used GCC for C/C++ on ARM, AVR, x86, 68000, PowerPC, XMOS, ZPU and now the Propeller. I am not quite yet a milkshake:) The language/compiler is a constant that you only have to learn once. Having to learn all those assembler languages well is something I don't want to have to do. Having to become familiar with the chips is unavoidable.
There is a stand alone GCC assembler for all these machines its called "gas" more usually the command name for it is "as".