Hi everyone Im a noob with msp430 and Im having troubles with serial
comunication with a pololu maestro servocontroller, I got serial comunnication
with an arduino board an it was easy but with the msp430 has been imposible for
me.
I dont know where is the problem and i cant get the serial comunication, please
If someone can tell me whats wrong with the code I'll be so grateful, thank
you.
Help with serial comunication and Servo controller
Started by ●February 28, 2012
Reply by ●February 28, 20122012-02-28
Reply by ●February 28, 20122012-02-28
Hi,
you should look at the 9600 baud UART example code for your chip
provided by TI. Every time you need to send something you have to load
it into the UCA0TXBUF now if you hate typing that you can always do this:
and you should always check if the Tx flag is up on the UART line,if it
is 1 it is ready for the next data if it is 0 it is busy.
Jake G.
you should look at the 9600 baud UART example code for your chip
provided by TI. Every time you need to send something you have to load
it into the UCA0TXBUF now if you hate typing that you can always do this:
and you should always check if the Tx flag is up on the UART line,if it
is 1 it is ready for the next data if it is 0 it is busy.
Jake G.
Reply by ●February 28, 20122012-02-28
Reply by ●February 28, 20122012-02-28
You need to set UCSWRST in UCA0CTL1 before you initialize any of the other UART
register settings. You should probably also initiaklize UCA0CTL0 to make sure
you have the correct stop bits, parity and character length (even if it is 8,n,1
which is the power on default)
Reply by ●February 28, 20122012-02-28
I think that I set UCSWRST, I wrotein the code:
UCA0CTL1 &= ~UCSWRST;
Is that incorrect? Im sorry but Im a begginer.
UCA0CTL1 &= ~UCSWRST;
Is that incorrect? Im sorry but Im a begginer.
Reply by ●February 28, 20122012-02-28
Hi,
Now I am not sure on this because TI example code I have seen has done
it both ways, but I usually set it at the start of initialization.
my Uart Init code:
for the MSP430F543xA chip
Jake G
Now I am not sure on this because TI example code I have seen has done
it both ways, but I usually set it at the start of initialization.
my Uart Init code:
for the MSP430F543xA chip
Jake G
Reply by ●February 28, 20122012-02-28
You need the sequence below. The 1st line sets the UCSWRST bit putting the UART
in "Setup mode". The last line clears the UCSWRST bit putting the
UART in "Operational mode". You need to set the UCSWRST bit first
before any other bits can be set, so you cannot combine the 1st and 2nd lines in
the example below.
Reply by ●February 28, 20122012-02-28
Unless some TI example code is wrong (BLASPHEMY), I think some USCI's
,or whatever the abbreviation is, have the UCSWRST already set as a
default, but like I said before I set it every time just to be safe.
Jake G
,or whatever the abbreviation is, have the UCSWRST already set as a
default, but like I said before I set it every time just to be safe.
Jake G
Reply by ●February 28, 20122012-02-28