Title: Accessing ComSync/104 Registers
Date: June 16, 2005
The Zilog 85230 is a very versitile ESCC which can be put to many uses. Below you will find some basic tips on how to properly access the various registers in order to configure and use the ComSync/104 card.
Registers are read and written through the “Control” Address. The “Data” Address is for Transmit and Receive Serial data.
The I/O offsets from the base address are as follows:
- Base + 0 Channel A Data
- Base + 1 Channel A Control
- Base + 2 Channel B Data
- Base + 3 Channel B Control
- Base + 4 Status & Control (see page 6 in manual)
- Base + 5 TC & Security (see page 6 in manual)
- Base + 6 85230 Control (see page 6 in manual)
- Base + 7 Misc Control (see page 6 in manual)
So, To write to WR9 with a base address of 300 you would execute the following:
outp(0x300+1,9); // Channel(A) Control point to z85230’s WR9
outp(0x300+1,0xc0); // Channel(A) Data will be written to WR9
Tip: Don’t forget to set the Line Interface Mode bits at Base+7. These bits enable the transmitters and receivers. Without setting these correctly, there will be no data sent or received.
Important Note: These 2 operations MUST NOT be interrupted by some interrupt handler and the code MUST implement some protection mechanism to prevent this from happening.
disable(); // x86 cli instruction
#Do Read/Write Operations
enable(); // x86 sti instruction
To allow Register Reads and Writes to occur in one PC/104 bus cycle we use the Enhanced I/O feature on this card. You must turn ON SW1-4 to enable this feature. With this, reading and writing registers is much simpler:
To write WR9 of channel A:
To read that register:
x = inp(0x320+9);
Note: Channel B’s registers are at 0x30 offset.
Note: The Enhanced I/O feature will only operate when the PC/104 bus speed is <= 9 MHz (Most, if not all, PC/104 bus’s are 8.33 MHz).
For more information, Zilog has a significant amount of information about the 85230 on their web site.
For the latest information on your card please lookup your product by part number on our website.
If you have any problems or questions setting up or configuring your ComSync/104 card please contact our technical support – email@example.com or call us at 1-800-426-8979 (519-836-1291)
End of KDB-297