Other Parts Discussed in Thread: CC2530
i want to add serial transmission in existing sample app...
i want to send data from cc2530DK to PC
help me find out
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.
Other Parts Discussed in Thread: CC2530
i want to add serial transmission in existing sample app...
i want to send data from cc2530DK to PC
help me find out
Dears,
Try the following steps:
1. Create initUart function
void initUart(halUARTCBack_t pf)
{
halUARTCfg_t uartConfig;
uartConfig.configured = TRUE;
uartConfig.baudRate = HAL_UART_BR_115200;
uartConfig.flowControl = FALSE;
uartConfig.flowControlThreshold = 48;
uartConfig.rx.maxBufSize = 128;
uartConfig.tx.maxBufSize = 128;
uartConfig.idleTimeout = 6;
uartConfig.intEnable = TRUE;
uartConfig.callBackFunc = pf;
HalUARTOpen (HAL_UART_PORT_0, &uartConfig);
}
2. Create receiver callback function
void uartRxCB( uint8 port, uint8 event )
{
if ( event != HAL_UART_TX_EMPTY )
{
// Read from UART
HalUARTRead( HAL_UART_PORT_0, pBuf, TXRX_BUF_LEN );
...//Process receiving pBuf data here by yourself.
}
}
3. Initialized initUart function in your SampleApp_Init().
4. You can use HalUARTWrite( HAL_UART_PORT_0, pBuf_write, pBuf_write_len ) to send data through uart.
hi thanks for ur reply
i am new to this module
in sample app where ecactly i have to paste these codes ???
thanks :)
nw i want o use cc2530 zigbee EM module as stand alone ....
hw can i power it with external supply ??
Hello:
I found this tread to be the one that best answered my questions. But I still have some doubts:
I'm using my own cc2530 hardware boards and my application is based on GenericApp. I have two boards one configured as End Dev and the other as Coordinator.
I'm using Zstack v2.5.0 and implemented uart_isr instead of uart_DMA. Both application bind and I successfully configured my end Dev to send serial data over the air (detected using sniffer). Also Coordinator Debug shows that data arrives at
case AF_INCOMING_MSG_CMD:
Harvest_MessageMSGCB( MSGpkt );
break;
MSGpkt has endDev sent data available.
My Harvest_MessageMSGCB function as small changes from GenericApp and executes HalUARTWrite form _hal_uart_isr.c
void Harvest_MessageMSGCB( afIncomingMSGPacket_t *pkt )
{
switch ( pkt->clusterId )
{
case HARVEST_CLUSTERID1:
// "the" message
HalLedSet ( HAL_LED_4, HAL_LED_MODE_FLASH );
HalUARTWrite(HAL_UART_PORT_0,Harvest_TxBuf,46);
break;
}
}
Something is not working because data does not arrive at P03 pin (Txd line). What I can´t find is where UxDBUF is written for the first byte (the remaining bytes are written at Tx_ISR function defined at _hal_uart_isr.c).
As I understand from HalUARTWriteISR, this function only fills isrCfg.txBuf and doesn’t execute the first write to UxDBUF.
Where is UxDBUF written to for the first time?
Hello:
Thank You Chen for your kind answer.
Yes HAL_UART is defined as TRUE. Also HalUARTPoll(); is running in the driver module.
Pedro
Hello:
Thank you for your kind answer. But since my first post that HAl_UART option was defined at the preprocessor tab.
Pedro
thanks for ur valuable reply
1) stil i cant receive the signal from Smartrf05 to Pc ....
i made all modifications in sampleapp.c
but stil i cant send data from smartrf0f please help me ..
Hi Srinivasan,
I see in your test that you use uart ISR instead of DMA. Do you want to define "#define HAL_UART_DMA 1" and "HAL_UART_ISR=0" to see if it works?
i made all modification sugessted by all, but still icant receive the data ...
It is weird that you can not make it. Could you post the picture showing how you connect your CC2530DK to PC?