i had attempted to do serial communication in msp430f5310.I coudnt see the output for it since the program shows no error.Kindly,give solution for this.
im doing the codes in code composer studio software.So,kindly help me on that serial communicaton in msp430f5310.I coudnt understand how i should make the left arm ambidextrous.
I had attempted to do serial communication in msp430f5310.I coudnt see the output for it since the program shows no error. Kindly, give solution for this.
C:
#include <stdio.h>
#include<msp430f5310>
/*
* main.c
*/
int main ( void )
{
unsigned long i;
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P4SEL = BIT4; //SELECTING THE PORT 4 .4 AS TX
P4SEL = BIT5;// SELECTING THE PORT 4.5 AS RX
UCA1CTL1 = UCSWRST; // RESET BEFORE THE PROCESS
UCA1CTL1 = UCSSEL_1; //SELECTION OF CLK SPEED ACLK=32.768 HZ
UCA1BR0=8; //BAUD RATE GENERATION
UCA1BR1=0; // BAUD RATE SELECTION
UCA1MCTL = UCBRS_0 | UCBRF_13 | UCOS16; // MODULATION CONTROL AND OVERSAMPLING.
UCA1CTL1 &= ~UCSWRST; INITIALISING USART STATE MACHINE.
P1DIR = 0XFF; // ENABLING THE PORT 4 PINS
P1OUT =0XFF; // MAKING THE OUTPUT FOR LED
while
{
UCA1TXBUF = 'a' ; //TRANSMITTING THE CHARACTER 'a' through transmit buffer
P1OUT ^= 0XFF; // BITWISING OR THE OUTPUT in loop.
for(i=0;i<5000;i++) // LOOP
{
}
}
}
.
SO,MY WAY OF GETTING OUTPUT IS THAT WHEN CHARACTER 'a' is transmitted,led should blink in provided for loop.But i coudnt get the output.Plz anyone help on this.
I don't know - I know nothing about that CPU, it's just the method of controlling bits in that register that seems wrong, and would have been disabling the "TX" bit.
Okay.. Since no-one here utilises THAT chip you will get very little help.
Ti said:
NOTE:Initializing or reconfiguring the USCI module The recommended USC Iinitialization/reconfiguration process is:
1. Set UCSWRST(BIS.B#UCSWRST,&UCAxCTL1).
2. Initialize all USCI registers with UCSWRST= 1 (including UCAxCTL1).
3. Configure ports.
4. Clear UCSWRST via software (BIC.B#UCSWRST,&UCAxCTL1).
5. Enable interrupts(optional)via UCRXIEand/orUCTXIE.
Pick a different micro that people know. These request are normally due to some lecturer at a uni picking some obscure device so people can't get answers here. Probably not a bad thing.
Mike.
Edit, you did however get help above which you seem to have completely ignored.