Pages: [1]   Go Down
Author Topic: Serial Config Error  (Read 279 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
 I've searched if there were a question about this issue but I haven't found something about. So I'm trying to modify serial connection  parity and databits as describe in online guide, but compiler give me an error.

Code:
void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  Serial2.begin(9600,SERIAL_7E1);
}

Code:
Arduino:1.5.6-r2 (Windows 7), Scheda:"Arduino Due (Programming Port)"
In function 'void setup()':
error: 'SERIAL_7E1' was not declared in this scope

I've seen that it could be a compiler issue, so I've tried to use Arduino IDE 1.0.5 and it didn't get me error, but it can't support Arduino Due. So how can I resolve this problem?
Thanks all for reply  smiley
« Last Edit: April 04, 2014, 05:38:18 am by mrlele » Logged

Venezuela
Offline Offline
Sr. Member
****
Karma: 12
Posts: 433
Ground.......ground........always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In Arduino IDE 1.5.X the SAM HardwareSerial library doesn't handle a config parameter in the begin function like the AVR HardwareSerial.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Paliser thanks for replay smiley  Do you know another way so configure it?
Logged

Venezuela
Offline Offline
Sr. Member
****
Karma: 12
Posts: 433
Ground.......ground........always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry mrlele. Currently there is not serial port config implemented on Due. A year ago the people from Arduino opened an issue but still empty:
https://github.com/arduino/Arduino/issues/1343 .
P
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Reading issue post, I could use this solution to resolve problem temporally :
Code:
Serial1.begin(9600);
  USART0->US_MR = US_MR_USART_MODE_NORMAL | US_MR_USCLKS_MCK | US_MR_CHRL_7_BIT | US_MR_PAR_EVEN |
                US_MR_NBSTOP_1_BIT | US_MR_CHMODE_NORMAL;

« Last Edit: April 07, 2014, 04:46:25 am by mrlele » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8452
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Currently there is not serial port config implemented on Due. A year ago the people from Arduino opened an issue but still empty:
Just how well is the Due supported? And if the Due port is not complete after all this time what does that say for the other new boards?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've submitted a pull request that should allow you to set the config for Serial1, Serial2 and Serial3 as they use the USART. Serial cannot be fixed as it uses the UART module instead.

If you're interested in trying the fix then you can find the changes here: https://github.com/arduino/Arduino/pull/1998/files
Logged

Pages: [1]   Go Up
Jump to: