common routines for msp430 [WIP]