UART
UART¶
Finding Info¶
Common Baud Rates:
1. 9600 (about 104.2 µs per bit)
2. 38400 (about 26.04 µs per bit)
3. 19200 (about 52.08 µs per bit)
4. 57600 (about 17.36 µs per bit)
5. 115200 (about 8.681 µs per bit)
When device is off:
- Vcc: INF resistance
- Tx: 80kΩ
- Rx: 12kΩ
- GND: 0Ω
When device is on:
- Vcc: 3.3V
- Tx: 1.7-2.5V
- Rx: 0-0.004V
- GND: 0Ω
Finding Baudrate¶
Using Saleae Logic Analyzer:
1. Start the Saleae Analyzer
- Set to at least 50 MS/s
- Set Duration for 30 seconds
- Set Channel 0 for Trigger on Falling Edge
2. Click on the + next to Analyzers Select Async Serial
Using Logic Analyzer:
1. Set the capture length to 20 M Samples
2. Set the capture rate to 1 MHz
3. Click on the + next view to UART
4. Set Ports to the correct RX and TX
5. Set to ascii instead of hex to view the data.
6. Optional Change the baudrate.
Using Software:
- baudrate.py
- https://github.com/muratdemirtas/tty-baudrate-finder
- https://github.com/devttys0/baudrate
Using the Script:
>>> python baudrate.py
{'baudrate': 9600, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
[-] Invalid: Baudrate: 4000000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 3500000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 3000000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 2500000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 2000000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 1500000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 1152000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 1000000 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 921600 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 576000 | Parity: N | StopBits: 1 | ByteSize: 8
b'xxxxx<xxxxxxxxxxxxxx<xxxx'
{'baudrate': 500000, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b'xxxxxxxxxxxxxxxxxxxxxxxxx'
{'baudrate': 460800, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b'`fff~f`f~`f`~``fxf`fxff`f'
{'baudrate': 230400, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b'fxfxxxxpL\x0c\x0c@\x0c\x0c\x0c\r\nErased 1'
{'baudrate': 115200, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b'h)\x0b\x0c:X\tS::xZ[\ry,\t9yi:X\t8Z'
{'baudrate': 57600, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b'^:9z.)!k;!,gRrV98-1@J`hHZ'
{'baudrate': 38400, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b"hJP'|\tpC_Y4AD\\PHYCMTL]BQX"
{'baudrate': 19200, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b'YUEVPUBa\rLQ%D5%\r5%5%=O)Eu'
{'baudrate': 9600, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
b'Ef88\rf980C|8u.P 4`QP4 06"'
{'baudrate': 4800, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 5, 'write_timeout': None, 'inter_byte_timeout': None}
[-] Invalid: Baudrate: 2400 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 1800 | Parity: N | StopBits: 1 | ByteSize: 8
[-] Invalid: Baudrate: 1200 | Parity: N | StopBits: 1 | ByteSize: 8
Connecting to Tigard¶
Connecting using a Tigard:
screen /dev/ttyUSB0 115200
Dump Flash¶
ar7240> md.b [Start Flash address] [Flash Size]
ar7240> md.b 9F000000 0x400000