CS452 - Real-Time Programming - Fall 2009
Lecture 3 - Communications: RS-232
Reminder
- Practical Details: pdf
- Assignment deadlines
- How to compile and run your first program: pdf
Assignment 1
Overall System
Provided and maintained by CSCF
- Linux systems
- cross compiler: runs on 86_64, produces code for ARM
- GNU toolchain: compiler, assembler, link editor
- You will notice that my makefile separates
- compilation to assembly code,
- assembling the assembly code, and
- link editing.
- need to login explicitly to
linux.student.cs
- TFTP servers
- need to type IP number explicitly
TS-7200
`COM' ports
Connected to UARTs
Only really two
Ethernet port
Reset switch
Timers
EP-9302
System on chip
- ARM 920T core, implementing ARM v4T instruction set
- Two co-processors
- System controller, MMU
- Maverick Crunch floating point unit
- Peripherals
- UARTs
- Timers
- DIO
- A/D
- etc.
Memory
Byte addressable, word size 32 bits
- 32 Mbytes of RAM, starting at 0x00000000
- 4 Mbytes of flash RAM, starting at 0x60000000
- Contains RedBoot, which is loaded into RAM at startup
- Special locations at low addresses
- Special locations above 0x80000000
Separate instruction and data caches
Software
Compiler
GNU tool chain
- when you are getting started optimizing is usually a bad idea
- software multiplication, division, floating point from libgcc.a
- Makefile
- target.ld
RedBoot
Partial implementation
- fconfig :: NOT
- load (tftp)
- examine, copy, fill memory
Returns when program terminates
Busy-wait IO
COM2 uses monitor; COM1 goes to train
- initialization
- output
- input
Data Communication using RS-232
Communication protocol existing since forever.
- description of a wire, and the signals on it.
Why do we still use it in the age of USB, etc.
- simple
- inexpensive
- robust
- easy to implement
Very simple RS-232
Three wires
Wired like this
GND ---------- GND
XMIT --\ /---- XMIT
X
RCV----/ \---- RCV
What could be simpler?
- BUT, ...
- This is actually called a null modem.
- To see why we need to look at the pins on the connector.
Less Simple RS-232
Distinguish Data Terminal Equipment (DTE) from Data Circuit-terminating
Equipment (DCE)
On the DE-9 connector we have for DTE
5 -- GND
3 -- XMIT
2 -- RCV
and for DCE
5 -- GND
3 -- RCV
2 -- XMIT
A very simple `straight through' cable connects these perfectly. But when
we conect DTE to DTE we need the cable above, which is called a `null
modem'.
Train RS-232
Three wire works fine as long as both ends of the wire are much faster
than the wire itself. But the train controller is very slow. Why?
- Wait for mechanical sensors.
- High electrical noise
The train controller needs to be able to say STOP. How is this done?
Software Flow Control
XOFF, XON
Hardware Flow Control
CTS, RTS
DTR, DSRWhat Happens if You Omit Flow Control
Return to: