SI2457-D-FS Silicon Laboratories Inc, SI2457-D-FS Datasheet - Page 300

no-image

SI2457-D-FS

Manufacturer Part Number
SI2457-D-FS
Description
IC ISOMODEM SYSTEM-SIDE 16SOIC
Manufacturer
Silicon Laboratories Inc
Datasheets

Specifications of SI2457-D-FS

Lead Free Status / Rohs Status
Lead free / RoHS Compliant
AN93
Modem Interrupt Service Sample Code
The following is the C code for the modem ISR. Also refer to "Figure 76. Parallel- or SPI-Port Interrupt-Service
Flowchart" for more explanations. Please contact Silicon Labs to obtain a complete C8051F12xx project bundle.
// Macros for modem ISR readability
#define RXFInterrupt
#define TXEInterrupt
#define TimerInterrupt ( !( modem_status & SiREM ) && !RXFInterrupt && !rxf_processed )
#define U70Interrupt
#define RTSIsSet
#define ClearRTS
#define ClearRXF
#define ClearTXE
#define ClearINTM
#define rxBufferSize
#define ReadModemStatus
#define readModemByte
//-----------------------------------------------------------------------------
// Interrupt service routine
//-----------------------------------------------------------------------------
// modemInterrupt()
//-----------------------------------------------------------------------------
// Invoked whenever the modem issues an interrupt: this is meant as reference
// code for parallel-port/SPI interrupt service.
//
// Parameters:
// Return value: None
//-----------------------------------------------------------------------------
void modemInterrupt( void ) interrupt 2
{
300
char modem_status;
char modem_control; // Modem control before writing (written only if modifed)
char control_update = 0;
char rxf_processed = 0;
int BytesSent;
int BytesReceived = 0;
char SFRPAGE_SAVE;
EA = 0;
EA = 0;
SFRPAGE_SAVE = SFRPAGE;
ReadModemStatus;
// Set default write value. Always write the RXF and TXE bits to 1 by default
// to avoid inadvertently clearing those interrupts
modem_control = modem_status | SiTXE | SiRXF;
// Clear the RTS bit if it's set. The part comes out of reset with RTS set.
// RTS will have no effect unless the modem gets the AT\Q3 command.
// If RTS isn't needed this code can be removed.
if ( RTSIsSet )
{
ClearRTS;
control_update = 1;
None
// Clear the RTSb so data enters FIFO
( modem_status & SiRXF )
( modem_status & ( SiTXE & modem_control ) )
( modem_status & ( SiINT & ( modem_status >> 1 ) ) )
( modem_status & SiRTSb )
( modem_control &= ~SiRTSb )
( modem_control &= ~SiRXF )
( modem_control &= ~SiTXE )
( modem_control &= ~SiINTM )
gModemToUARTBufferSize
modem_status = readModem( HIR1 )
pushByteToUART( readModem( HIR0 ) )
// Tracks whether control register was modified, needs updating
// Disable global interrupt
// Dummy operation required by MCU, as per MCU data sheet
// Save Current SFR page
// Read HIR1 to get current status
Rev. 1.3

Related parts for SI2457-D-FS