The 82C52 UART
The 82C52 is a single channel UART. Here is my schematic:
It is quite adaptable to different clock frequencies. Using the M80C85A-2 clock of 5 MHz (i.e the maximum recommended clock speed), here are the available baud rates:
Note: A 9.8304 MHz crystal would make these baud rates exact.
Going through my crystal junk box I find an 11.0592 MHz crystal. I could use this directly on the 82C52 and get a large range of exact bauds:
Anyway I will stay with the 10MHz crystal for the M80C85A-2.
Programming the 82C52
I have fully decoded an address of 0x0040 (i.e. 0x40-0x43) which in reserved for the CBIOS in the zero page. I guess it is not often used as it takes some effort to decode.
Here are the initialisation codes for 9600 8N1:
- 0x40 Read/write serial data
- 0x41 Set 8N1 0x3C
- 0x42 Use INTR with DTR/CTS 0x66
- 0x43 Set baud 9600 using a 5MHz clock 0x2A
The decoding scheme can be used for up to to 3 other devices using the CBIOS reserved area.