3 ms·
In a small embedded processor (the launchpad processor definitely qualifies) you really want to set the baudrate at compile time. Indexing into a table is wast
by markrages 12y ago
In a small embedded processor (the launchpad processor definitely qualifies) you really want to set the baudrate at compile time. Indexing into a table is wasteful and unnecessary.
Also, the MSP430 baudrate generator is set up so you can start with #define's for the clock speed and baudrate, and with preprocessor math (division and masking) set both baudrate selection registers.
Microcontroller datasheets invariably include tables for baud rate divisor settings. This is depressing, as it indicates there are enough programmers who fail at sixth-grade math to make such tables necessary.
- david-given 12y agoThe MSP430 is a lovely processor, with a beautifully elegant combined 16/32 bit instruction set, dense code, and a good compiler if you want it (and it's a joy to write assembler in if you don't). It also runs on basically no power --- the one I've got on my desk will run flat out at 16MHz and draw 1.5mA, and it'll idle at down to 20nA. TI will sell you a complete set of dev kit hardware for $10. Plus it's got 64kB of onboard FRAM --- performs like SRAM, but it persistant! No pesky flash to worry about. It's also one of the few of this class of microcontroller which have combined data and instruction address spaces, which means you can do things like load code from external storage and run it; you can actually write real operating systems for it. It's the closest thing to an old-fashioned microcomputer that you can get. As downsides, I wish it had an external memory interface; you're stuck with the onboard RAM. And the memory map is inconveniently laid out for backwards compatibility reasons.