MAX3111ECWI-T Maxim Integrated Products, MAX3111ECWI-T Datasheet - Page 28

no-image

MAX3111ECWI-T

Manufacturer Part Number
MAX3111ECWI-T
Description
UART Interface IC
Manufacturer
Maxim Integrated Products
Datasheet

Specifications of MAX3111ECWI-T

Lead Free Status / Rohs Status
No
SPI/MICROWIRE-Compatible UART and ±15kV ESD-
Protected RS-232 Transceivers with Internal Capacitors
Listing 1. Outline for a MAX3110E/MAX3111E Software Driver
28
______________________________________________________________________________________
This is a C-language outline of an interrupt-driven software driver that interfaces
to a MAX3110E/MAX3111E, providing an intermediate layer between the bit-manipulation
subroutine and the familiar PutChar / GetChar subroutines.
User must supply code for managing the transmit and receive queues, as well as the
low-level hardware interface itself.
initialized before this driver is called.
char is an 8 bit character.
& is the bitwise Boolean AND operator.
/* High level interface routine to put a character to the MAX3110E/MAX3111E. */
PutChar ( char c )
{
}
/* High level interface routine to get a character from the MAX3110E/MAX3111E.
** Wait for a character to be received, if necessary.
*/
char GetChar ( )
{
}
/* Configure the MAX3110E/MAX3111E with the specified baud rate.
ConfigureMAX3110E/MAX3111E ( int baud_rate_index )
{
}
/* private variable that stores the configuration settings for the MAX3110E/MAX3111E
*/
int config;
/* Low level communication routine between the computer and the MAX3110E/MAX3111E.
** This is a PRIVATE routine to be used only within the driver software.
*/
int MAX3110E/MAX3111E ( int mosi )
{
}
EnQueue ( txqueue, c );
/* enable the transmit-buffer-empty interrupt */
config = config | 0x0800; /* set the TM bit */
config = config | 0xC000; /* set bits 15 and 14 */
MAX3110E/MAX3111E ( config );
while ( IsQueueEmpty ( rxqueue ) )
return DeQueue ( rxqueue );
baud_rate_index = baud_rate_index & 0x000F; /* restrict to a 4 bit field */
config = 0xC400 + baud_rate_index; /* enable received data interrupt */
MAX3110E/MAX3111E ( config );
int miso;
/* this is interface-specific.
** Transmit 16 bits of master-out, slave-in data, MSB first,
** while simultaneously receiving 16 bits of master-in, slave-out data.
** If and SPI hardware interface is available, use (CPOL=0,CPHA=0) mode.
** Lacking specialized hardware, just set and clear I/O bits to generate
** the waveform in figures 2 and 3 in the MAX3110E/MAX311E data sheet.
*/
return miso; /* return 16 bits of master-in, slave-out data, MSB first */
/* wait for data to be received */ ;
int is a 16 bit unsigned integer.
The interrupt control hardware must be
| is the bitwise Boolean OR operator.
*/

Related parts for MAX3111ECWI-T