Loading...
Pages: [1]   Go Down
Author Topic: Arduino IDE 1.0.x - direct UART register manipulation stopped working  (Read 401 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi guys,

I understand that the IDE has now moved away from allowing direct UART manipulation in place of Serial3.begin(speed, config) etc

I have some code which requires UART3 on a Mega 2560 to be changed to 8E1 (even parity)
The following code stopped working

Code:
UCSR3C = ( UCSR3C & ~_BV(UPM00) | _BV(UPM01) );

I have since tried to use 
Code:
Serial3.begin(9600, SERIAL_8E1);
However this doesn't work. Checking my inline scanner it seems to still be using 8N1.

I'm current force to compile on an earlier IDE to get it to work.

Any insight is greatly appreciated.

Thanks in advance.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 116
Posts: 10144
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


http://arduino.cc/forum/index.php/topic,97455.0.html
... #6, fifth bullet.
Logged

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


Thanks for your reply .. but it doesn't help much smiley

Ill ask my question a different way. Has something been done / left / still to do with
A: Direct UART register maniplation such as the code I posted above
B: Has anyone got the new SerialX.begin(SPEED, SERIAL_XXX) to work correctly.

In my testing using an in-line external scanner my Arduino Mega 2560 is still transmitting 8N1 .. not 8E1 which I have been directing it to do (again see above code posted)

Thanks in advance
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 23
Posts: 1320
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did not even notice you could now use a second parameter in Serial.begin to specify the protocol. What version introduced this? The reference pages for Serial.begin in the 1.0.3 download do not refer to the extra protocol parameter but the on-line version does.

I do not have a Mega but after reading this thread and referring to the on-line documentation I can confirm the protocol parameter is working on a v2 UNO using 1.0.3 IDE. Below is the output. CH1 = 8N1, CH2 = 8O1 & CH3 = 8E1
« Last Edit: December 18, 2012, 07:54:42 am by Riva » Logged

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

Cheers for posting that up ... very interesting.

Quick off topic question ... what software / hardware are you using for your screenshot ?

I have been compiling with 1.0.2 .. Ill try 1.0.3 to see if I can get it running.

Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 23
Posts: 1320
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quick off topic question ... what software / hardware are you using for your screenshot ?
I am using this little device http://www.ikalogic.com/ikalogic-products/scanalogic-2/

Quote
I have been compiling with 1.0.2 .. Ill try 1.0.3 to see if I can get it running.
As I said I don't have a Mega so could not test it on the other serial ports but would assume (foolishly) they all work the same.


Logged

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 218
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I understand that the IDE has now moved away from allowing direct UART manipulation in place of Serial3.begin(speed, config) etc

Where was that announced?

Logged


Pages: [1]   Go Up
Print
 
Jump to: