Hi all,
I am having a little problem.
I am using my msp430f149 to go out and get some data out of my solar car
and transmit it out using a RF data radio which understands rs232.
The program in this message illustrates how I am trying to acomplish this.
I created a dummy char array filled with 'a' chars, then I just try to
send it out. The problem I am having is that the radio does not even
twitch. I know they are working because I have connected them to a couple
machines and they talked.
I did get the ckt working, so I am pretty sure it's a problem with my code.
Anyways, here is what I am using:
- Newlink SS-900 radio (set to 9600bps)
- max3233eepp rs232 transceiver
I am thinking that maybe I've set my clk/baud incorrectly for
9600bps...
I appreciate any help.
-helio
code bellow
--------------
#include <msp430x14x.h>
#include <signal.h>
#define TRUE 1
#define FALSE 2
void setup(void);
char full_pack[16];
char *pack_ptr;
int main (void)
{
unsigned char temp=0x00;
WDTCTL = WDTPW + WDTHOLD;
setup();
for (temp = 0; temp < 16; temp++)
full_pack[temp] = 'a';
pack_ptr = full_pack;
TXBUF0 = *pack_ptr++; //starts ADC data transm,
while (TRUE)
{
if(*pack_ptr != 'a') //time to start sending again
{
pack_ptr = full_pack;
TXBUF0 = *pack_ptr++;
}
}
return 0;
}
void setup (void)
{
//port/pin setup for the specialCOMM
P3DIR |= BIT4;
P3SEL |= BIT4; // Select pins to alternate function
BCSCTL1 |= DIVA_0; //hopefully ACLK @ 32kHz, low freq. crystal
//INITIALIZE serial port 0
//this is configured to run at 9600 according to table 12-6 in the
manual
UCTL0 = CHAR | SWRST; // 8 bit chars - leave in reset mode
UTCTL0 = SSEL_ACLK; // uclk = aclk
UBR10 = 0x00; // 9600bps, from 12-6
UBR00 = 0x03;
UMCTL0 = 0x4A;
ME1 |= UTXE0; // Enable Tx0
UCTL0 = CHAR; // 8 bit chars - take out of reset
IE1 |= UTXIE0; //enable Tx0 interrupt
eint();
}
interrupt(UART0TX_VECTOR) rs232_tx(void)
{
if(pack_ptr < &full_pack[16])
{
TXBUF0 = *pack_ptr;
*pack_ptr++;
}
}