PDA

View Full Version : t3 uart pins



virtualdave
11-08-2012, 06:05 AM
Couple questions on the uart pins for the t3:

1. how do we read/write from/to the pins? e.g. uart1.read, uart2.read, etc. (or serial1.read, serial2.read, etc.)

2. any chance that with t3's new faster chip comes some higher baud rates? i.e. what is the maximum baud rate for communicating on the uart pins?

Thanks!
David

Paul
11-08-2012, 10:10 AM
Use Serial1, Serial2, Serial3. The normal Arduino functions are all supported. So to read port 1, use Serial1.available() and Serial1.read(). To write port 1, use Serial1.write() or Serial1.print().

Much higher baud rates are possible. The clock speeds are higher, and the UARTs have a 32X fractional divider to make accurate baud rates.

Serial1 has 8 byte fifos, so it can tolerate much more interrupt latency than Serial2 and Serial3.

By default, the software uses relatively small buffers. If you're running at higher speeds and your code spends time doing other tasks, you might need to edit serial1.c, serial2.c or serial3.c to increase the buffer size.

So far, I haven't done much testing to determine what the maximum usable sustained speed really is, based on software overhead. My guess is about 1 to 3 Mbit/sec. Like with Teensy 2.0, you can do bursts of data at faster speeds due to the buffering, but sustained transfer speeds are limited by the software overhead.