English
Language : 

COM20051I Datasheet, PDF (52/74 Pages) SMSC Corporation – Integrated Microcontroller and ARCNET (ANSI 878.1) Interface
the service routine to track from which page the most current data can be found when back to back Enable to
Receive commands are issued. MIN_RX_PAGE and MAX_RX_PAGE are two constants that contain the page
address boundaries for the ARCNET memory. If it is desired to allow more RAM for receptions and less RAM for
transmissions then these constants must be changed accordingly.
Upon entering the RX_ISR the RX_PAGE_REG is read. The lower three bits are masked off and stored as the page
address. RAM_BUF_REG is then read and the first free buffer found is used to store the packet. Once the data has
been copied, the RAM_BUF_REG is checked to make sure that at least one buffer is empty before issuing another
receive command. If no buffers are available, the interrupt is cleared and a new command is issued, thus discarding
the received packet. This is done so that all receptions are handled. If it is found that receptions are being missed
then more buffering on the CPU side is necessary. If a free buffer exists, the second receive command page is then
checked to see if the maximum page address has been reached. If the page address is at its maximum value, then
the page address is set to the minimum page address, otherwise the page address is incremented to next page. The
Enable to Receive command string is then generated from the page address. RX_PAGE_REG is updated to make
the second receive command the first command and the new command will be the second command. The actual
command is then issued. The Clear Receive Interrupt command is then issued and the routine is exited.
Transmit Interrupt Servicing
The Transmit ISR (TX_ISR) services interrupts caused by the TA bit being set. The routine will first check the TMA
bit to see if the last transmission has been received error free. If TMA is good then another transmission occurs. If
TMA is bad then the last transmission is sent again and the ISR is exited. Limits can be imposed on the number of
re-tries before aborting.
Several variables are kept in order to simplify servicing of the Transmit interrupt. TX_PEND_REG is a byte wide, bit
mapped register that conveys information about whether a packet needs to be transmitted and where it is located in
the ARCNET RAM. The lower nibble of the register tells the ISR from which external RAM page the transmit data is
to come. Bits 5 and 6 are status bits telling the ISR how many transmit commands are in the Command Chaining
pipeline. To identify from which ARCNET buffer page the last transmission originated, a variable called LAST_TX is
used that contains the page number used in the last Enable to Transmit command. LAST_TX is used to re-transmit
data when a bad TMA bit is found.
Upon entering the ISR, the status register is read and the TMA bit is checked. If the TMA bit is not set, then the
action as described above is taken. If TMA is good then the interrupt is cleared and either bit 6 or bit 5 of the
TX_PEND_REG is cleared depending on the number of transmissions pending. The configuration register is then
read and the Command Chaining enable bit is checked. If Command Chaining is enabled, then bit 4 of TX_PEND is
set, otherwise it is cleared. A series of case statements are then executed which read the TX_PEND_REG and look
for a set bit. If a bit is set in the lower nibble, it signifies that the ARCNET RAM has been loaded with data and that
page is ready to be transmitted. Software should be written so that an external routine will copy transmit data into the
ARCNET RAM. This will speed up the ISR. Bits 5 and 6 are checked to see that the pipeline is not completely
filled. If they are both set, then the routine is exited. If either one of the bits is reset, then the pending bit in
TX_PEND_REG is reset, bit 5 or 6 is set, and an Enable to Transmit command is given to the page corresponding to
the bit position in TX_PEND_REG.
Up to two transmit commands can be given within the ISR at any given time. If no transmissions are pending, then
the routine is exited without any new transmissions.
SMSC DS – COM20051I
Page 52
Rev. 03/27/2000