Quantcast
Channel: Wireless Connectivity
Viewing all articles
Browse latest Browse all 116964

Forum Post: Help needed for using the UART

$
0
0

Hi everyone,

I'm using a cc2530F256 and trying to setup the uart by using the HAL functions provided in Z-Stack.

To begin with, I wrote the following code by following the instructions in the document "HAL Driver API.pdf":

    A[0]=1;

    A[1]=2;

    A[2]=3;

    //initialize uart
    HalUARTInit();
    
    halUARTCfg_t uartConfig;
    
    // Configure UART
    uartConfig.configured               = 1;
    uartConfig.baudRate                 = HAL_UART_BR_9600;
    uartConfig.flowControl              = HAL_UART_FLOW_OFF ;
    uartConfig.flowControlThreshold     = 5;
    uartConfig.rx.maxBufSize            = 100;
    uartConfig.tx.maxBufSize            = 100;
    uartConfig.idleTimeout              = 6; //10 minutes?
    uartConfig.intEnable                = 0;
    uartConfig.callBackFunc             = callBackFunc ;
    
    // Open the corresponding UART port
    HalUARTOpen( HAL_UART_PORT_1, &uartConfig );
   
    
    // Initalise board peripherals
    halBoardInit();
    halJoystickInit();
    //write to the port
    HalUARTWrite( HAL_UART_PORT_1, A, 1); //

doing so, im confused as to how the pins (TX, RX) associated with UART for port1 can be connected to the rs232 for transmission to the pc.

Also, confused about where in these instructions im setting up the frame to be sent, and whether i need to be running the code provided in DN112 Design Notes.

I'm just trying to sent data (A) over the rs232 line and receive it in HyperTerminal.

If you have any project files, sample code or any suggestions, I'd appreciate your help.

Thanks


Viewing all articles
Browse latest Browse all 116964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>