btb4198 Posted August 8, 2017 Share Posted August 8, 2017 ok if I do not have wires going to pin 39 and 40 then when usart2 tries to tx out data it coming in to rx. why is that ? and how do i stop it ? Link to comment Share on other sites More sharing options...
jpeyron Posted August 8, 2017 Share Posted August 8, 2017 Hi @btb4198, Pin 39 (RX) and Pin 40 (TX) are physically tied to UART2. You can see what pins are used for in the schematic here. If you are using UART2 then Pin 39 (RX) and Pin 40 (TX) will not be able to be used for anything else. You can find more information about using UART1 and UART2 on the reference manual here in section 3.5 Peripheral I/O Functions. Are you able to use UART1? Here is also more information about the PIC32MX3XX/4XX Data Sheet which is the Primary IC on the uC32. cheers, Jon Link to comment Share on other sites More sharing options...
btb4198 Posted August 8, 2017 Author Share Posted August 8, 2017 I am using both Uart1 and Uart2 . I just do not get why everything I do not have anything connect to pin 40 and 40 it just repeats what us going to pin 39 Link to comment Share on other sites More sharing options...
jpeyron Posted August 8, 2017 Share Posted August 8, 2017 Hi @btb4198, I have not see this behavior before but I wanted to point out that the TX is meaning transmit into the uC32 and the RX is sending data out from the board. I would make sure that you have the cables attached to match this situation. You can look at pin 0 and pin 1 on the board which shows a direction for data flow. cheers, Jon Link to comment Share on other sites More sharing options...
btb4198 Posted August 8, 2017 Author Share Posted August 8, 2017 has anyone seen this before ? Link to comment Share on other sites More sharing options...
jpeyron Posted August 8, 2017 Share Posted August 8, 2017 Hi @btb4198, I looked a little bit further into the flow of data and I was wrong. The tx and rx are set as would be expected with the tx being transmitting out of the uC32 and rx being input to the uC32. I tried duplicating your scenario further generating a uart communication sending ff through uart2 on the rx (pin 39) and looking for repeat of data on tx pin 40 and reading it out what it received through uart1 using both physical connection of tx pin40 and digital write of pin 40. I did not see any data on the tx(pin 40). How are you getting the tx data on pin 40? You say that you do not have a cable connected to pin 40. So are you using digital write for pin 40? cheers, Jon uart2_uC32.txt Link to comment Share on other sites More sharing options...
btb4198 Posted August 9, 2017 Author Share Posted August 9, 2017 I add a wire to the 39 and 40, when I have the system up and running but when there is not wire, it should not be pulling from the rx Link to comment Share on other sites More sharing options...
jpeyron Posted August 9, 2017 Share Posted August 9, 2017 Hi @btb4198, Can you attach your code as well as a picture of your setup? cheers, Jon Link to comment Share on other sites More sharing options...
Question
btb4198
ok if I do not have wires going to pin 39 and 40 then when usart2 tries to tx out data it coming in to rx.
why is that ?
and how do i stop it ?
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.