3 ms·
I recently started playing with MSP430's. They are fun devices and I think there are lots of possibilities with those. I have no real experience with other uC's
by IgorPartola 14y ago
I recently started playing with MSP430's. They are fun devices and I think there are lots of possibilities with those. I have no real experience with other uC's so I can't say anything about others or compare. Having said that, here are some very basic impressions:
TI's example code is often confusing and over-engineered. It is much better to find advice on blogs and forums instead.
The community has some great individuals that will produce great examples and tutorials. Unfortunately, it is very far removed from places like GitHub. Almost all code is shared directly in the forums at 43oh.com.
There are a couple of big projects surrounding MSP430's. Energia is, from what I understand, an Arduino-like IDE which lets you program at a much higher level, but at the cost of some performance. When you only have 512 bytes of RAM, it may or may not be an issue. Another one is BSP430 which is a lower level set of libraries. It promises much higher level abstractions at the cost of small performance penalties. I found the tutorials to be rather terse, but I may need to give it more time.
Outside of those big projects, there is lots of duplication of effort. It is typical to see 3-5 different implementations of bit-banging UART drivers that are all slightly different. I am no exception, as I started writing my own little set of libraries for dealing with various peripherals.
Lastly, a lot of the tutorials out there either use the register names directly (P2IE, P1SEL, etc) or provide really poorly named abstractions (cal_adc_15t30). Most of my time working with it so far has been spent on naming functions something like gpio_get_val(), uart_puts(), etc.
P.S.: Physical hardware buttons are terrible devices. Debouncing them is a must and most implementations in the wild are incorrect. [1] is a good read.
[1] http://www.ganssle.com/debouncing.htm http://www.ganssle.com/debouncing.htm
- theatrus2 14y agoThe problem with the raw register names is that they're not even consistent between compilers/libraries. However, they're usually the best route to go form an efficiency standpoint.
- IgorPartola 14y agoWell, even doing a #define LED_GREEN BIT6 would be an improvement. However, I'd be willing to pay a small cost in terms of RAM/performance for doing something like this: gpio_get_val(P1, 6); which would return whether port 1, pin 6 is high or low. I think that can even be a macro so it would be compiled down to (P1OUT & BIT6).