Saggitarius Posted August 9, 2016 Share Posted August 9, 2016 Hi there, Can somebody tell me, how can I access the 2nd UART on uC32 board? (Rx pin39 & Tx pin40) I tried with Serial2.begin(38400); and receiving " error: 'Serial2' was not declared in this scope" message. Link to comment Share on other sites More sharing options...
jpeyron Posted August 10, 2016 Share Posted August 10, 2016 Hi Saggitarious, Could you post your code to help with troubleshooting this error. Without the code i would first make sure that the Serial2.begin(38400); is used above the main funtion. thank you, Jon Link to comment Share on other sites More sharing options...
JColvin Posted August 11, 2016 Share Posted August 11, 2016 Hello, You'll actually want to use Serial1.begin(38400); since the Serial names for the UART hardware start their numbering at 0. So the first UART just uses Serial, and the second UART uses Serial1. The uC32 does not have a third UART available for Serial2 which is why you are receiving this error. Thanks, JColvin Link to comment Share on other sites More sharing options...
Saggitarius Posted August 18, 2016 Author Share Posted August 18, 2016 On 8/11/2016 at 6:48 PM, JColvin said: Hello, You'll actually want to use Serial1.begin(38400); since the Serial names for the UART hardware start their numbering at 0. So the first UART just uses Serial, and the second UART uses Serial1. The uC32 does not have a third UART available for Serial2 which is why you are receiving this error. Thanks, JColvin Hi, Thanks for reply. Is it written this definition somewhere on a reference sheet? Thanks, Bela Link to comment Share on other sites More sharing options...
jpeyron Posted August 18, 2016 Share Posted August 18, 2016 Bela, Serial.begin is described here. Using multiple serial ports is described here as well. At the bottom of the web page there is an example that uses 4 serial ports that are available with the Arduino Mega with different baud rates. thank you, Jon Link to comment Share on other sites More sharing options...
Question
Saggitarius
Hi there,
Can somebody tell me, how can I access the 2nd UART on uC32 board? (Rx pin39 & Tx pin40)
I tried with Serial2.begin(38400); and receiving " error: 'Serial2' was not declared in this scope" message.
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.