#include <msp430.h> #include "stdlib.h" #include "string.h" #include "stdio.h" float f, b; int d; struct confComm { char clkFrq[9]; char baudRate[6]; }; void main() { struct confComm const s = {"16000000", "115200"}; f = (float)atol(s.clkFrq); b = (float)atol(s.baudRate); d = (int)(((f/b/16) - (int)(f/b/16)) * 16); UCA0CTLW0 = UCSWRST; UCA0BRW = (int)(f/b/16); UCA0MCTLW = d; UCA0CTLW0 &= ~UCSWRST; }
Can someone please explain to me why UCA0MCTLW will NOT update to the value d? if I look at the expression for d it is correct.
Thanks