Some time ago, TI's new flash MSP430F1101 processor ($0.99 at 10k) was
mentioned here as a potential competitor of PICs.  Since TI and Wyle were
running one of those "bargin" seminars ($49 gets you the seminar, plus
breakfast, lunch, and cookies, plus more than $49 worth of evaluation
system), I thought I'd go, especially since that seemed to be the easiest
way to get the new evaluation kit.  In San Jose, this seminar was yesterday,
and I thought I'd share my impressions...

On the "oops" side, the seminar did NOT supply the flash evaluation kit
(MSP-FET430x110)  Apparently these are in high demand, as well as being
rather 'minimal' for demonstration/lab purposes.  Instead, the seminar
was done using the ($99) MSPSTK430B320 "starter kit."  This is a nicer
and more valuble set using one of the higher-end MSP430 chips and including
an LCD display, but the chip is not removable and not flash, and not all
that cheap if you wanted to buy them (~ $8)  We also got a coupon for 50%
off any other evaluation kit, so I'm not complaining very much...


Interesting things about the MSP430 series of processors.

1) Power consumption

The MSP430s are billed as "very low power consumption" chips.  They
typically run FULL speed at 400uA or lower, and have FIVE (5!) different
power-down mode for even lower consumption (two at 50uA, one at 1.5uA, one
at 0.1uA.)  The starter kit we got ran off power from the rs232 port.  The
parts generally run down to 2.2V or lower (the new low-end flash parts are
2.2V -> 3.6V parts.)


2) 16 bit ALU/Architecture

The MSP430 is a "true" 16 bit architecture, rather similar to a PDP11 in
some ways.  There is a 16 ALU and the instructions are nominally 16 bits
(plus additional words for immediate addresses and data and such.)  There
are 16 registers, which includes Stack pointer, Program Counter, Status
register, and "constant generator."  (12 general purpose registers are
left.)  There's a regular instruction set with 4 addressing modes and 27
basic opcodes.  (TI claims 7 addressing modes for source operands, but four
of those are really special cases of a single bit pattern.)

The constant generators are sort of neat.  They "occupy" one full register
position, and partly overlap the status register.  When used as a source
operand, they provide several common constants (0, -1, 1, 2, 4, 8),
depending on the addressing mode it was accessed with.  (and since it
doesn't really make any send to use the status register as an index
register, you don't lose any real functionality, either.)

By combining the 27 opcodes with the constant generator, TI implements what
it calls "emulated" instructions.  These are still a single word in length
(and execute in one cycle if the destination is a register), but they're not
really separate instuctions.  For example, "inc dest" (increment) is just
implemented as "add #1, dest", using the constant register to get the #1.
(The same sort of thing is what gets you the "extra" three addressing modes
from 2 bits in the instruction - indexed addressing using the PC gets you
"symbolic" mode, indexed addressing using "constant 0" gets you "absolute"
addressing, and register-indirect with autoincrement on the PC gets you
"immediate" addressing.)  Clever; but perhaps presenting it this way was
more confusing than otherwise...


3) Von Neuman architecture.

Unlike most low-end microcontrollers, the MSP430 uses the same address space
for instructions, data, and IO.  The labs all worked by downloading the
sample code into the RAM of the starter kit processor (it has 512 bytes.)
This has advantages and disadvantages, of course.  It DOES mean that the OTP
starter kit is more useful than it might be otherwise - small programs will
easilly fit in the RAM.  Instuctions are up to 6 bytes long and take up to 6
clock cycles, depending on addressing modes.  Register to Register
instructions all take only one cycle.


4) Clock generator.

The clock generator is just WEIRD.  I guess most of it's oddness stems from
the low power characteristics.  One of the goals is to be able to exit the
low power modes within 6us of an appropriate event, which is MUCH quicker
than some other microcontrollers can restart their clock.  All of the MSP430
chips are designed to operate with an external low-frequency (32.769kHz)
crystal (ACLK), and they all have an internal RC based clock with digital
control (MCLK.)  In the high end parts, the MCLK is locked to the ACLK using
something TI calls a "Frequency Locked Loop", and you simply set the desired
multiplier for the 32kHz that you want the system to run at (the default is
about 1MHz, highest supported speed is about 4MHz.)  In the low end parts,
the FLL is missing, so you deal with either a less accurate clock, or
implement something similar to the FLL in software.  In either case, the
peripherals operate off of the (more stable) ACLK.  (actually, the crystal
CAN be omitted entirely...)  One of the interesting (IMHO) side effects of
this is that the main CPU clock (MCLK) is NOT a perfect square wave.  It can
have assorted amounts of jitter, and for frequencies that are not
power-of-two multiples (or something like that) of the ACLK, it's derived
from multiple "taps" of counters, so it doesn't look much like an unstable
square wave either.  This can have implications if you need to write code
that is self timing down to the single cycle level - not all your cycles are
the same length!

The various low power modes of the 430 consist of being able to turn off
assorted combinations of the CPU itself, the MCLK, and the ACLK.  The most
popular LPM3 (1.5uA) turns off CPU and MCLK, but leaves the peripherals
running on the ACLK.  I *think* the fast turn-on time results from being
able to return to the RC-based clock before the crystal resumes oscillating,
and resuming the FLL tracking of frquency "later", after the crystal resumes
oscillating.  The bits controlling the low power modes are part of the CPU
status word, which means that they get pushed on the stack when an interrupt
takes the part out of LP mode, and restored (back to LP mode) when you
return from the interrupt.  (If you don't want to go back to LPM when you
return from the interrupt, you get to modify the status bits on the stack.)


5) Peripherals.

The MSP430s come with approximately the usual set of peripherals, with a
couple interesting exceptions.  The high end part include an LCD controller
that can directly drive and LCD (ie glass) display, using only (I think) a
few external resistors to generate appropriate voltages.  I'm not terribly
familliar with LCDs, but it looked pretty simple to me.  The timer on the
low end chips ("Timer-A") seemed to be quite a bit more versatile than the
usual low-end timer.  It has several counting modes (ie up/down and zero to
 continuously) and some capture/compare registers.  TI's app notes
include info on using the timer (together with some software) to implement
A/D converters, UARTs, several types of PWM, and other stuff.  More
cleverness.  (Note that some of these applications probably REQUIRE use of
the timer rather than SW delays, due to the cpu clock inconstantcy...)  The
ever-present WDT is reprogrammable as an interval timer (causing an
interrupt rather than a reset), and the external reset pin can be
reprogrammed as a non-maskable interrupt.


Annoyances:

Aside from the clock jitter issues I've already mentioned, I think the chief
annoyance of the MSP430 is the low drive capability of the digital IO pins
(only 4.5mA for the low end parts at 3.6V.)

Also, TI's "user manual" really sucks.  I read over this prior to the
seminar, and found it to frequently be in the "wrong" order.  Sections would
constantly use terms that hadn't been defined yet, leading to quite a lot of
confusion.  I *think* this might be due to the intended audience being the
low-power engineer, but I (as primarilly a SW person) found it really
disorienting.  Some of this carried over into the seminar itself, but it was
mitigated by the interactive nature of things - there were some latter
sections scheduled in the seminar that had been mostly covered (by Q&A) by
the time we reached that point in the seminar.

There's no 40 pin part.  Aside from the small 20 pin parts, the chips tend
to end up in amateur-unfriendly packages (48 pin SOP, 64 QFP, etc.)


In all, it's a pretty neat set of parts.  While marketed as an extremely low
power part, there isn't really anything so odd about the part to eliminate
its use in more general purpose applications.  I hope the low end flash
parts end up with some "hobbyist" availability...

BillW

    Source: geocities.com/westfw