This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
hi all,
I need to interface MSP430FG4618/2013 EXP's board, with Matlab using serial port. Can any one provide me with a code to send & receive data i.e numbers. Do i need to use the hyper link in windows or how else can it be done??
Thanx
Sid
Sid,
The FG4618's USCI channel A0 is connected to the DB9 connector on the Experimenter's Board. A good starting point is to take any USCI channel A0 UART Code from our 461x Code Examples and establish an echo with your windows hyperterminal. From there you should be able to edit the program do to what you need.
Also helpful is our Experimenter Board examples
And here is that link:
(for some reason I could not edit my previous post)
hey which UART example from slac118c are you talking abt, i cannot figure that out. Is communicating with hyper link similar to communicating with MATLAB, where i have the MATLAB code for serial port.
Secondly in slac129a the touchpad code(F2013 tocuhpad), has adaption rate key up threshold & key down treshold what is the use of them.
Thank you for your help.
Regards
Sid
hey m using an Express card as my laptop does not has a serial port. When i use in device manager i see two COM port, one is of the express card & other is of MSP430, i select the one for express card & try to connect to hyperterminal. I am able to establish a connection but after that in the hyperterminal text area i cannot type ny data to be transmitted & if i do type the data is not echoed back. Can you please help me where am i going wrong.
Thanx.
Sid
Has anyone managed to get the RS232 interface to work with the MSP430FG4618/F2013?
I've created a CCE project using msp430xG46x_uscia0_uart_9600.c and that seems to do nothing. I get nothing on my PC's COM1 port from the RS232 socket on the board.
The PC/experimenter's board RS232 connector I'm using does this:
PC EXP Board
2 RXD --> UCA0TXD 2
3 TXD --> UCA0RXD 3
4 DTR --> Pin 4
5 GND --> GND 5
All other pins are unconnected.
I've just modified that code to add a TXString function, in the same fashion as the eZ430-RF2500 wireless sensor demo code, to generate some transmit data, but I'm having no success with that either. I've used the TXString function from this demo in many projects to great effect on the eZ430-RF2500 and I want an equivalent function for my MSP430FG4618/F2013 experimenter's boards.
Thanks!
hey derek i am using the same UART code in IAR & i am facing the same problem, the data is transmitted from COM port but nothing is received. I guess the reason for this is when the data is received the interrupt is not generated. I have another doubt is UCA0RXBUF on port 2 or port 4??
sam22 said:I have another doubt is UCA0RXBUF on port 2 or port 4??
You were right to query about the port number. Got a reply from EPIC this morning and they pointed out that the Experimenter's Board (MSP430FG4618/F2013) uses P2.4 for UCA0TXD and P2.5 for UCA0RXD. I made the mods to msp430xG46x_uscia0_uart_9600.c and it now works, as far as I can tell. (Tried using Termite to talk to the board, saw that characters sent by the PC were received by the board but Termite was not displaying any of the characters it had received.)
Anyway, the fix is:
Replace:
P4SEL |= 0x0C0; // P4.7,6 = USCI_A0 RXD/TXD
With:
P2SEL |= 0x030; // P2.5,4 = USCI_A0 RXD/TXD
I've uploaded a new version of msp430xG46x_uscia0_uart_9600.c to my homepage.
Derek
PS My TXString function is working a treat! [;)]
Sid,
You should be able to use the PCMCIA card if it looks like a COM port to the laptop. Have a look in Control Panel->System->Hardware tab->Device Manager->Ports (COM & LPT), you should see one related to the PCMCIA card there. Then, use this port in the terminal application.
If you are already doing this, and it's still not working, you could try to use a PC with a RS232 COM port to eliminate problems with the PCMCIA card.
Could you post the initialisation code? I could have a look and see if I can spot anything that needs changing.
Derek
Hi Derek,
I'm just trying to make a TXString function for the Experimenter's Board (MSP430FG4618/F2013) myself.
Did you have to make many differences to the TXString function given in the EZ430 wireless sensor demo code?
Micheal
Edit: Its working now, thanks for your "...uart_9600.c" fix.
hi all,
I have try to run ...uart_9600.c (with the fix of the 2.4,2.5 ports).
I am using the hyperterminal of Windows XP. the MSP430 is connected to the COM3 port and the terminal is connected to COM1 port/
the settings are: 9600,no paruty,8bit,1 stop bit.
when i type character in the hyperterminal window i cant see them on the hyperterminal itself. (and because of that echo doesnt work).
S.O.S
thanks in advance,
Amit
Amit Shainkopf said:I am using the hyperterminal of Windows XP. the MSP430 is connected to the COM3 port and the terminal is connected to COM1 port.
I don't quite understand what you are stating here. It seems that you might have multiple COM ports on your PC of which you have Hyperterminal connected to COM1 and the actual MSP430 board connected to COM3. If that is true, that won't work. You need to have the MSP430 board (physically) and Hyperterminal (logically) connected to the same COM port.
Perhaps I'm misreading what you are trying to indicate.
Hi, I’m trying to use my PC to communicate with my MS430FG4618/2013 experimenter’s board via the serial port (COM1). I’m using the code suggested in http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/19613.aspx?PageIndex=1
I’m having the same problem as some other people in this forum. Yes, I do have a serial cable connected between the PC and the board. The Hyperterminal setting is
· Bits per second: 9600
Data bits: 8
Parity: none
Stop bits: 1
Flow control: None
I’m not able to type in or see anything in the Hyperterminal. I’m sure my COM1 is good since I’m using it for something else. Any solution? Thanks.
#include <msp430xG46x.h>
void main(void)
{
volatile unsigned int i;
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
FLL_CTL0 |= XCAP14PF; // Configure load caps
do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 0x47FF; i > 0; i--); // Time for flag to set
}
while ((IFG1 & OFIFG)); // OSCFault flag still set?
P2SEL |= 0x030; // P2.5,4 = USCI_A0 RXD/TXD
ME2 |= UTXE1 + URXE1; // Enable USART1 TXD/RXD
U1CTL |= CHAR; // 8-bit character
U1TCTL |= SSEL0; // UCLK = ACLK
U1BR0 = 0x03; // 32k/9600 - 3.41
U1BR1 = 0x00; //
U1MCTL = 0x4A; // Modulation
U1CTL &= ~SWRST; // Initialize USART state machine
IE2 |= URXIE1; // Enable USART1 RX interrupt
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt
}
#pragma vector=USART1RX_VECTOR
__interrupt void USART1_rx (void)
{
while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready?
TXBUF1 = RXBUF1; // RXBUF1 to TXBUF1
}
SWU said:while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready?
uh,oh, a busy-waiting loop inside an ISR. Bad idea.
Anyway, since you're only sending what you received and both with the same baudrate, you can be SURE that the sending buffer is empty if you received another byte.
Another thing is that trying to send with 9600Bd with a clock source of 32.768kHz gives such a very high timing error that you most likely neither receive nor send something understandable. Whether it works, highly depends on your PCs RS232 chip. You should, however, see something happen.
SWU said:for (i = 0x47FF; i > 0; i--);
What else? You do not set SWRST. After a power-up it should be already set. Doing so doesn't hurt anyway and you don't forget it when you later copy the code to re-initialize the USART.
Last but not least, the DB9 connector of the experimenters board is connected to the USCI module and not to the USART1. You enable the right pins: P2SEL |= 0x030; // P2.5,4 = USCI_A0 RXD/TXD and the comment correctly states USCI_A0, but then you continue programming the USART1. I doubt this will ever work. The quoted example, however, uses the right registers and programs the right hardware module. (It is a bit confusing that the USCI0 signals can be routed to two different ports, but it allows attaching hardware for two modules and using one of them at a time). Also, the mixture of one USCI and one USART module is also not common.
Well, stay with the example code, just change the PxSEL command to the other port pins of USCI0 and it should work.
**Attention** This is a public forum