Embedded Solutions
Page 13 of 37
Programming
Programming the PMC BiSerial-III-SDLC requires only the ability to read and write data
from the host. The base address of the module refers to the first user address for the
slot in which the PMC is installed. This address is determined during system
configuration of the PCI bus.
Depending on the software environment it may be necessary to set-up the system
software with the PMC BiSerial-III "registration" data. For example in WindowsNT there
is a system registry, which is used to identify the resident hardware.
In order to receive data the software is only required to initialize the receiver buffer start
address and enable the Rx channel. To transmit the software will need to load the
message into the appropriate Dual Port RAM, set the transmitter buffer start and end
address and any configuration parameters and enable the transmitter.
When a received message completes, the end address of the message will be written
to the receiver buffer start address with the received data stored starting with the next
address. The next message will be stored starting with the following address unless a
new starting address has been written after the first message has begun. The end
address of each received message can also be read from the address field of the
channel control register, but this will be over-written when the next message completes.
Once the transmitter starts sending a message, a new end address (and optionally a
new start address) can be written to send subsequent messages. Multiple messages
can be loaded into the transmitter RAM and sent in any order desired.
The interrupt service routine should be loaded and the interrupt mask set. The interrupt
service routine can be configured to respond to the channel interrupts on an individual
basis. After the interrupt is received, the data can be retrieved. An efficient loop can
then be implemented to fetch the data. New messages can be received even as the
current one is read from the Dual Port RAM.
The TX interrupt indicates that a message has been sent and that the message has
completed. If more than one interrupt is enabled, then the interrupt service routine
(ISR) needs to read the status to see which source caused the interrupt. The status
bits are latched, and are explicitly cleared by writing a one to the corresponding bit. It is
a good idea to read the status register and write that value back to clear all the latched
interrupt status bits before starting a transfer. This will insure that the interrupt status
values read by the ISR came from the current transfer.
VendorId = 0xDCBA, CardId = 0x005A
Flash design ID = 0x0003, Current Flash revision = 0x0002