Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[msp430f2274] How to extract the desired data from UCA0RXBUF

Status
Not open for further replies.

bettyxyz1028

Newbie level 6
Joined
Sep 25, 2009
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,398
I followed the sample code from the TI.
The ez430-rf2500 target board receives an external signal from a heart rate board(MSP430fg439). I first pass the value of UCA0RXBUF to UCA0TXBUF for testing. I observe the signal from P3.4(Tx) pin by using oscilloscope. It is square wave and it is correct. Then I try to pass the value to a declared variable "aNumber" and try to display this signal on the GUI (I hav alrdy set the location for extra number and the preset 2-digit number can be seen on the GUI).

But now my AP can not detect the End Device. Every time i plug in the ED, the AP stops blinking. But after a while it continues blinking without showing the ED. And when i press the pushbutton on the ED, the red LED on the ED lights.

Im expecting the ED to blink green LED a few seconds once (as the DEMO) and the GUI to show the signal from heart rate board.

Im thinking that the problem could be the extracting part. From the buffer, i hav an 8-digit data with 1 start bit and 1 stop bit (is it? I count the sqares). I guess that i may need to extract the 8-digit data from the buffer. Is it? How to extract? If this is not the problem. How can i fix?


Here is my code. I only show the added parts in Main and interrupt routine.

Main()
{

P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
P3DIR = 0xFF; // All P3.x outputs
P3OUT = 0; // All P3.x reset

//Initialize Rx
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 8; // 1MHz 115200
UCA0BR1 = 0; // 1MHz 115200
UCA0MCTL = UCBRS_6; // Modulation UCBRSx = 6
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
}

#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?
//UCA0TXBUF = UCA0RXBUF; // I test the signal from P3.4
aNumber = UCA0RXBUF;
}

Anybody can help???? Tks in advance :)
 

mallappat2011

Junior Member level 1
Joined
Apr 28, 2013
Messages
17
Helped
12
Reputation
24
Reaction score
12
Trophy points
1,283
Location
India
Activity points
1,424
Hi bettyxyz1028

Please check in the Code Composer studio right click on the project "Build Configuration->Set as Active->End Devece Access Device" Select the options Access Device or End Device.

I followed the sample code from the TI.
The ez430-rf2500 target board receives an external signal from a heart rate board(MSP430fg439). I first pass the value of UCA0RXBUF to UCA0TXBUF for testing. I observe the signal from P3.4(Tx) pin by using oscilloscope. It is square wave and it is correct. Then I try to pass the value to a declared variable "aNumber" and try to display this signal on the GUI (I hav alrdy set the location for extra number and the preset 2-digit number can be seen on the GUI).

But now my AP can not detect the End Device. Every time i plug in the ED, the AP stops blinking. But after a while it continues blinking without showing the ED. And when i press the pushbutton on the ED, the red LED on the ED lights.

Im expecting the ED to blink green LED a few seconds once (as the DEMO) and the GUI to show the signal from heart rate board.

Im thinking that the problem could be the extracting part. From the buffer, i hav an 8-digit data with 1 start bit and 1 stop bit (is it? I count the sqares). I guess that i may need to extract the 8-digit data from the buffer. Is it? How to extract? If this is not the problem. How can i fix?


Here is my code. I only show the added parts in Main and interrupt routine.

Main()
{

P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
P3DIR = 0xFF; // All P3.x outputs
P3OUT = 0; // All P3.x reset

//Initialize Rx
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 8; // 1MHz 115200
UCA0BR1 = 0; // 1MHz 115200
UCA0MCTL = UCBRS_6; // Modulation UCBRSx = 6
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
}

#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?
//UCA0TXBUF = UCA0RXBUF; // I test the signal from P3.4
aNumber = UCA0RXBUF;
}

Anybody can help???? Tks in advance :)
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top