Wednesday, 15 May 2013

c - Using the Msp430fr5969 to send strings over Tx -



c - Using the Msp430fr5969 to send strings over Tx -

i trying send info msp430fr5969 launchpad rn-52-ek can pass info along through bluetooth.

#include <msp430.h> void uartsend(unsigned char *pucdata, unsigned char uclength) { while(uclength>0) { // wait tx buffer ready new info while(!(uca1ifg & uctxifg)); // force info tx buffer uca1txbuf = *pucdata; // update variables uclength--; pucdata++; } } void inituart() { /* place uca0 in reset configured */ uca0ctl1 = ucswrst; //set brclk = smclk uca0ctl1 |= ucssel_2; //values found using table 16mhz , 115200 baudrate uca0br0=8; uca0br1=0; uca0mctlw = 0xf7 << 8; uca0mctlw |= 10 << 4; uca0mctlw |= ucos16; //uca0 out of reset uca0ctl1 &= ~ucswrst; } int main(void) { // disable watchdog timer //------------------------ wdtctl = wdtpw + wdthold; // stop wdt inituart(); unsigned char sendstring[] = "banana"; unsigned char length=6; while(1) { uartsend(sendstring,length); } homecoming 0; }

nothing happening when run above code, not reading on multimeter. missing?

i know there bad practices, want working , i'll add together interrupt based sending later.

c embedded msp430

No comments:

Post a Comment