Community news, upcoming events and general discussions
Threads: 24 Posts: 61
Get technical support from the community
Threads: 686 Posts: 3701
Threads: 15 Posts: 54
Tell us how to make XDK better!
Threads: 30 Posts: 102
Share and discuss community member projects
Threads: 18 Posts: 99
I want to use UART1 port, which port is on the extended board. First I want to print information through PB9.
I had referenced the code in XDK Extension Bus User Guide. I hope use this code to print some characters in loop, but it's not working. I could not see any change on PB9, just can see information from console port. And I used one GPIO test code to test PB9, it can output high and low pulse, so this means the connection is ok.
Could you help to confirm why UART1 could not work?
Following are UART code:
Hello tom! Welcome to the community! Let me see how I can help you. Firstly I looked into your code and found some interesting point, in
printinformationuart1() you instruct the uart1 to output a buffer called writeBuf, but I am not seeing where the contents passed to it, also do you see at least the start and stop bit from TXD pin? Also, how you are checking the uart characters that uart1 outputs? Best Felipe
I took a look at the mentioned UART pin. I used a multimeter to detect if the voltage level on the pin is changing, to verify if there is any output on the pin. As far as I can tell, the voltage level on the pin is changing, so on the first glance I assume that the pin is working.
Nevertheless, I am going to analyse this in more detail by setting up a complement device to read the sent UART messages from the XDK. I will get back to you early next week when I know more.
Meanwhile, as Felipe already mentioned I would also like to know, what kind of device you used to conclude that the UART pin PB9 is not working. Did you use a remote device, which read the incoming UART messages? In addition, did you test the unchanged UART example? As far as I can see you made some changes in the example.
Regarding your question Felipe:
printinformationuart1() you instruct the uart1 to output a buffer called writeBuf, but I am not seeing where the contents passed to it, also do you see at least the start and stop bit from TXD pin?
He uses a static uint8_t array writeBuf as global variable, where he passes in the content “abcd\n”.
Kind regards, Franjo
I used two ways to confirm the output:
1) Used one multimeter to measure the voltage of pin, just as you had one, the voltage is always about 2.48V.
2) Connect PB9 to another UART port's input, did not show any information.
And as you said, you had seen the voltage change on the pin? Did you use my code?
I did not test the orginal example code to confirm this. According to the original code, I removed the RX section.
In fact I want to open UART1 to manage another board, at first I just test the output.
I did not use your code because you made more changes than only removing the RX section. An example for that is the init() function which is called in appInitSystem(), but not shown in your other posted code.
Today I set up an Arduino to transmit and receive data from the XDK. I wable able to send data from the Arduino to the XDK, and I was also able to receive data from it. Therefore I can confirm that the UART pin PB9 and the UART example are working.
To solve your issue, could you go more into detail what you mean with the following sentence:
Connect PB9 to another UART port's input, did not show any information.
Did you connect the UART Tx pin to another device or did you connect the UART Tx to the UART Rx pin of the XDK?
Additionally, I would ask you once again to check if the unchanged UART example is working on your XDK.