Other Parts Discussed in Thread: MAX3221
Can the Rx and Tx pins of the UART be configured to any of the GPIOs?
If not what are the restrictions?
Our custom board has a number of restrictions on the GPIOs.
Regards,
John
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.
Thanks Fredrik K,
I have the Tx side working well. Character data can be seen on the cc2640 GPIO mapped to Tx. This Tx signal is connected to DIN on the MAX3221 Transceiver chip.
The DOUT on the MAX3221 is connected to the TX pin on the DB9 connector).
I configured the DB9 in a loop back configuration by connecting the RX pin to the TX pin.
I then connected the RX pin on the DP9 connector to the RIN input on the MAX3221.
Then I connected the ROUT pin on the MAX3221 to the cc2640 GPIO which is mapped to the Rx input.
This logic is all working well. That is to say, whenever a character is sent out the Tx GPIO, this same waveform is seen on the cc2640 GPIO mapped to the Rx input.
Even this is working, I am not able to see the Rx Fifo count increase. No characters are getting into the Rx Fifo.
Thanks,
John
Fredrik,
I'm not working from an example.
The example you refer to does not show a lot of details.
I have run that example on the 7ID board and it worked fine. However, I'm not using the 7ID board now...I'm running our own custom board.
I may be wrong, but I thought the example uses a hardware UART in the cc2640, not the Sensor Controller (maybe I'm wrong).
I'm running the UART_Emulator() function on the Sensor Controller.
I've compiled the drivers (generated from Sensor Controller Studio version 2.4) into my application...it compiles and links with no errors. It downloads and I can run the IAR debugger.
In the debugger I can breakpoint at key locations, such as before and after calling scifUartEmulatorUartGetRxFifoCount(), scifUartEmulatorUartGetTxFifoCount(), scifUartEmulatorUartTxPutChar(), etc.
I can send you the code if you need me to.
Regards,
John
Hi John,
You did not mention that you were using the SensorController.
In other words, you have configured the SC in Sensor Controller Studio, it is working fine on our EVM board, but not on your customer board, correct?
If so, what are the differences between your board and the EVM? Are there any other changes in the IO configuration? Are you sure both UART pins are properly assigned to the SC and not used by any other peripheral?
Regards,
Fredrik
Thanks Frederik K,
Yes, I'm sure the IO pins are configured correctly. I went through all the steps in the scif_how_to_use.html document. I then proceeded to implement the 'Start Sensor Controller Tasks (simplified). This did not work immediately, but as I added a few more of the steps from the more complex example, 'Use the UART Emulator (Including Task Control), it began to function some of the time. While running the debugger, if I run my start function and breakpoint at the end of my start function and then proceed the correct data shows up in the recieve Fifo. However, if I let it run through the entire start function, through the transmit and to the point in the receive code where I check the RxFifoCount, the count is zero (if I did not break the debugger as indicated above).
I've begun adding Task_Sleep() at various places in the start function but so far this has not solved the issue.
Regards,
John
Hello Frederik K,
I've cleaned up my UART Emulator loopback function. It's about as simple as I can make it and yet it still displayed the failure symptom.
But then I found if I waited for 1 millisecond ( Task_sleep() ) immediately following the call of scifUartEmulatorUartRxEnable(1), it started working flawlessly.
Thanks for your help,
John