XU4 - Usart Max Baud rate?
-
- Posts: 221
- Joined: Wed Jun 19, 2013 9:39 am
- languages_spoken: english
- Has thanked: 0
- Been thanked: 0
- Contact:
XU4 - Usart Max Baud rate?
I have been experimenting with an ODroid C1 talking to a PJRC Teensy 3.2 through a serial port instead of USB. Currently doing it with the Serial port set to 2mbs, probably can go higher.
But what I really want to use is the ODroid XU4. So I was wondering what is the maximum baud rate you can set for the USART that is on the expansion connector. So far I have not found a spec showing this.
Also the Teensy 3.2 (and the Arbotix Pro) are 3.3v devices, so I know I need to do voltage level conversion. I have seen some topics with conversion board schematics, like: http://forum.odroid.com/viewtopic.php?f=53&t=4758&p
I can wire up my own, but I would be nice if I could simply use one of the commercial boards. My guess is that some of the boards are probably too slow for this, but maybe the TXB0104 board from Adafruit? I am assuming the old Sparkfun board with voltage divider for one direction could be used as they are using 10K/20K resistors, so 3.3v would convert to 2.2v, which I am assuming is too high for Odroid?
Thanks
Kurt
But what I really want to use is the ODroid XU4. So I was wondering what is the maximum baud rate you can set for the USART that is on the expansion connector. So far I have not found a spec showing this.
Also the Teensy 3.2 (and the Arbotix Pro) are 3.3v devices, so I know I need to do voltage level conversion. I have seen some topics with conversion board schematics, like: http://forum.odroid.com/viewtopic.php?f=53&t=4758&p
I can wire up my own, but I would be nice if I could simply use one of the commercial boards. My guess is that some of the boards are probably too slow for this, but maybe the TXB0104 board from Adafruit? I am assuming the old Sparkfun board with voltage divider for one direction could be used as they are using 10K/20K resistors, so 3.3v would convert to 2.2v, which I am assuming is too high for Odroid?
Thanks
Kurt
-
- Posts: 221
- Joined: Wed Jun 19, 2013 9:39 am
- languages_spoken: english
- Has thanked: 0
- Been thanked: 0
- Contact:
Re: XU4 - Usart Max Baud rate?
Thanks mdrjr,
I do have one of your level shifters I can try out, but it is pretty large, so won't for example fit on the HROS1 robot. Might work with PhantomX, but not where I currently have Odroid installed. I believe the shifter is based on the TXS0108 chip, I do have some TXB0104/0108 adapters from Adafruit and Sparkfun that I will try out.
Any spec on what the valid baud rates are for the Usart?
I do have one of your level shifters I can try out, but it is pretty large, so won't for example fit on the HROS1 robot. Might work with PhantomX, but not where I currently have Odroid installed. I believe the shifter is based on the TXS0108 chip, I do have some TXB0104/0108 adapters from Adafruit and Sparkfun that I will try out.
Any spec on what the valid baud rates are for the Usart?
-
- Site Admin
- Posts: 11786
- Joined: Fri Feb 22, 2013 11:34 pm
- languages_spoken: english, portuguese
- ODROIDs: -
- Location: Brazil
- Has thanked: 1 time
- Been thanked: 39 times
- Contact:
Re: XU4 - Usart Max Baud rate?
What speed you need?
I don't know the speed limit of our UART. I personally never tested over 115200.
But it should be able to higher..
I don't know the speed limit of our UART. I personally never tested over 115200.
But it should be able to higher..
-
- Posts: 221
- Joined: Wed Jun 19, 2013 9:39 am
- languages_spoken: english
- Has thanked: 0
- Been thanked: 0
- Contact:
Re: XU4 - Usart Max Baud rate?
So far with the C1 talking to Teensy 3.2, I have tried 2mbs, which works. I may try higher as I believe the USART on Teensy can go to 3.375mbs, when I switch to testing with Arbotix Pro, I believe the maximum is 2.25mbs.
- odroid
- Site Admin
- Posts: 37204
- Joined: Fri Feb 22, 2013 11:14 pm
- languages_spoken: English, Korean
- ODROIDs: ODROID
- Has thanked: 1712 times
- Been thanked: 1118 times
- Contact:
-
- Posts: 221
- Joined: Wed Jun 19, 2013 9:39 am
- languages_spoken: english
- Has thanked: 0
- Been thanked: 0
- Contact:
Re: XU4 - Usart Max Baud rate?
Thanks, I am hoping you are wrong as would like at minimum 1mbs, maybe 2... or ...odroid wrote:The maximum baudrate on the XU4 UART is only 921600bps.
Also I am somewhat hopeful,
Code: Select all
memset(&newtio, 0, sizeof(newtio));
// First try to set the baud rate directly.
newtio.c_cflag = B1000000|CS8|CLOCAL|CREAD;
newtio.c_iflag = IGNPAR;
newtio.c_oflag = 0;
newtio.c_lflag = 0;
newtio.c_cc[VTIME] = 0; // time-out ? (TIME * 0.1?) 0 : disable
newtio.c_cc[VMIN] = 0; // MIN ? read ? return ?? ?? ?? ?? ??
tcflush(gSocket_fd, TCIFLUSH);
if (tcsetattr(gSocket_fd, TCSANOW, &newtio) < 0) {
printf("tcsetattr 1000000 failed try indirect %d\n\r", errno);
// Try doing it indirect by setting to 38400 and
// see if the USB driver supports setting non-standard
// Try back at 38400 and setting attribute...
newtio.c_cflag = B38400|CS8|CLOCAL|CREAD;
if (tcsetattr(gSocket_fd, TCSANOW, &newtio) < 0) {
printf("tcsetattr failed %d\n\r", errno);
goto DXL_HAL_OPEN_ERROR;
}
// Get the settings...
if (ioctl(gSocket_fd, TIOCGSERIAL, &serinfo) < 0) {
printf("TIOCGSERIAL failed %d\n\r", errno);
goto DXL_HAL_OPEN_ERROR;
}
serinfo.flags &= ~ASYNC_SPD_MASK;
serinfo.flags |= ASYNC_SPD_CUST;
serinfo.custom_divisor = serinfo.baud_base / baudrate;
if(ioctl(gSocket_fd, TIOCSSERIAL, &serinfo) < 0) {
printf("TIOCSSERIAL failed %d\n\r", errno);
goto DXL_HAL_OPEN_ERROR;
}
}
So I tried it on my XU4, where I setup a link...
Before I ran program:
Code: Select all
odroid@odroid-XU4:~/Raspberry_pi/AX12_Test$ stty -F /dev/ttySAC0 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
Code: Select all
speed 1000000 baud; rows 0; columns 0; line = 0;
intr = <undef>; quit = <undef>; erase = <undef>; kill = <undef>; eof = <undef>;
eol = <undef>; eol2 = <undef>; swtch = <undef>; start = <undef>; stop = <undef>;
susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = <undef>;
flush = <undef>; min = 0; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt
-echoctl -echoke
Code: Select all
newtio.c_cflag = B1000000|CS8|CLOCAL|CREAD;
Code: Select all
newtio.c_cflag = B2000000|CS8|CLOCAL|CREAD;
Code: Select all
odroid@odroid-XU4:~/Raspberry_pi/AX12_Test$ stty -F /dev/ttyDXL -a
speed 2000000 baud; rows 0; columns 0; line = 0;
intr = <undef>; quit = <undef>; erase = <undef>; kill = <undef>; eof = <undef>;
eol = <undef>; eol2 = <undef>; swtch = <undef>; start = <undef>; stop = <undef>;
susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = <undef>;
flush = <undef>; min = 0; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt
-echoctl -echoke
odroid@odroid-XU4:~/Raspberry_pi/AX12_Test$ ls -l /dev/ttyDXL
lrwxrwxrwx 1 root root 12 Feb 7 07:32 /dev/ttyDXL -> /dev/ttySAC0

- odroid
- Site Admin
- Posts: 37204
- Joined: Fri Feb 22, 2013 11:14 pm
- languages_spoken: English, Korean
- ODROIDs: ODROID
- Has thanked: 1712 times
- Been thanked: 1118 times
- Contact:
Re: XU4 - Usart Max Baud rate?
Nice humanoid robot. 
Please check the real baud-rate with an oscilloscope at 1Mbps or 2Mbps on the ttySAC0.

Please check the real baud-rate with an oscilloscope at 1Mbps or 2Mbps on the ttySAC0.
-
- Posts: 221
- Joined: Wed Jun 19, 2013 9:39 am
- languages_spoken: english
- Has thanked: 0
- Been thanked: 0
- Contact:
Re: XU4 - Usart Max Baud rate?
Thanks, Robot is Trossen Robotics HR-OS1.
So far I am not having luck getting any signal out of the usart... Maybe my jumper wires are on the wrong pins: May need to pull robot apart and/or wait until I order 2nd XU4 (doing trade in with AmericanDroid right now...) Also maybe wrong /dev/tty* device? Or maybe my older Saleae 16 Logic Analyzer is not working at the 1.8v level, although I believe I have it configured for it...
Also was not sure if potentially the IO pin MUX needs to change to work with Usart? But I think the gpio command may imply it is OK?
Running Ubuntu 15.04 and have done sudo apt-get update as well as upgrade...
Will get back to this later today or hopefully.
So far I am not having luck getting any signal out of the usart... Maybe my jumper wires are on the wrong pins: May need to pull robot apart and/or wait until I order 2nd XU4 (doing trade in with AmericanDroid right now...) Also maybe wrong /dev/tty* device? Or maybe my older Saleae 16 Logic Analyzer is not working at the 1.8v level, although I believe I have it configured for it...
Also was not sure if potentially the IO pin MUX needs to change to work with Usart? But I think the gpio command may imply it is OK?
Code: Select all
odroid@odroid-XU4:~/wiringPi$ gpio readall
+------+-----+----------+------ Model ODROID-XU3/4 ------+----------+-----+------+
| GPIO | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | GPIO |
+------+-----+----------+------+---+----++----+---+------+----------+-----+------+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 209 | 8 | I2C1.SDA | ALT5 | 1 | 3 || 4 | | | 5V | | |
| 210 | 9 | I2C1.SCL | ALT5 | 1 | 5 || 6 | | | 0v | | |
| 18 | 7 | GPIO. 18 | IN | 0 | 7 || 8 | 1 | ALT5 | UART0.TX | 15 | 172 |
| | | 0v | | | 9 || 10 | 0 | ALT5 | UART0.RX | 16 | 171 |
| 174 | 0 | GPIO.174 | ALT5 | 1 | 11 || 12 | 0 | ALT5 | GPIO.173 | 1 | 173 |
| 21 | 2 | GPIO. 21 | IN | 0 | 13 || 14 | | | 0v | | |
| 22 | 3 | GPIO. 22 | IN | 0 | 15 || 16 | 0 | IN | GPIO. 19 | 4 | 19 |
| | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 23 | 5 | 23 |
| 192 | 12 | MOSI | ALT5 | 1 | 19 || 20 | | | 0v | | |
| 191 | 13 | MISO | ALT5 | 1 | 21 || 22 | 0 | IN | GPIO. 24 | 6 | 24 |
| 189 | 14 | SCLK | ALT5 | 0 | 23 || 24 | 0 | IN | CE0 | 10 | 190 |
| | | 0v | | | 25 || 26 | 0 | IN | GPIO.190 | 11 | 25 |
| 187 | 30 | I2C5.SDA | ALT5 | 1 | 27 || 28 | 1 | ALT5 | I2C5.SCL | 31 | 188 |
| 28 | 21 | GPIO. 28 | IN | 0 | 29 || 30 | | | 0v | | |
| 30 | 22 | GPIO. 30 | IN | 0 | 31 || 32 | 0 | IN | GPIO. 29 | 26 | 29 |
| 31 | 23 | GPIO. 31 | IN | 0 | 33 || 34 | | | 0v | | |
| | | POWER ON | ALT5 | 0 | 35 || 36 | 0 | IN | GPIO. 33 | 27 | 33 |
| | | AIN.0 | ALT5 | 0 | 37 || 38 | 0 | ALT5 | 1v8 | | |
| | | 0v | | | 39 || 40 | 0 | ALT5 | AIN.3 | | |
+------+-----+----------+------+---+----++----+---+------+----------+-----+------+
Will get back to this later today or hopefully.
-
- Posts: 221
- Joined: Wed Jun 19, 2013 9:39 am
- languages_spoken: english
- Has thanked: 0
- Been thanked: 0
- Contact:
Re: XU4 - Usart Max Baud rate?
Quick update:
I pulled two legs off of my Trossen PhantomX hexapod and pulled out the XU3-lite, updated my code on it, plus used the Adafruit jumpers to connect to the small pins (like I did on XU4), hooked up LA to it (again the older 16) and then ran my code, this time it is showing stuff being output over the USART. Here is 1mbs. Then hacked the init code to see about 2mbs... So for the heck of it I tried 3mbs (could maybe work with my Teensy 3.2, but not Arbotix Pro, whose max baud is 2.25) I assume that XU3-lite and Xu4 should be compatible with each other here?
Next up may be to see what this does through a ttl level converter to 3.3v and see if it will talk to arbotix Pro. (starting at 1mbs)
Note: Xu4 is running ubuntu 14.04
Kurt
I pulled two legs off of my Trossen PhantomX hexapod and pulled out the XU3-lite, updated my code on it, plus used the Adafruit jumpers to connect to the small pins (like I did on XU4), hooked up LA to it (again the older 16) and then ran my code, this time it is showing stuff being output over the USART. Here is 1mbs. Then hacked the init code to see about 2mbs... So for the heck of it I tried 3mbs (could maybe work with my Teensy 3.2, but not Arbotix Pro, whose max baud is 2.25) I assume that XU3-lite and Xu4 should be compatible with each other here?
Next up may be to see what this does through a ttl level converter to 3.3v and see if it will talk to arbotix Pro. (starting at 1mbs)
Note: Xu4 is running ubuntu 14.04
Kurt
- odroid
- Site Admin
- Posts: 37204
- Joined: Fri Feb 22, 2013 11:14 pm
- languages_spoken: English, Korean
- ODROIDs: ODROID
- Has thanked: 1712 times
- Been thanked: 1118 times
- Contact:
Re: XU4 - Usart Max Baud rate?
Thank you for the measurement.
1~2Mbps seems to be working well.
Yes, XU3-lite and XU4 are compatible.
1~2Mbps seems to be working well.

Yes, XU3-lite and XU4 are compatible.
Who is online
Users browsing this forum: No registered users and 3 guests