|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
|
|
Listing 2-The XR-88C681A DUART goes into multidrop 9-bit operation and interrupt generation when a character is received.
// Full DUART Register Definitions
#define MODE1 ((volatile char *) 0x00 + DUARTBASE) // Mode 1 Register -- Channel A
#define MODE2 ((volatile char *) 0x00 + DUARTBASE) // Mode 2 Register -- Channel A
#define TXDONE ((volatile char *) 0x01+ DUARTBASE) // Status Register -- Channel A
#define CLOCK ((volatile char *) 0x01+ DUARTBASE) // Clock Select Register - Channel A
#define CMD ((volatile char *) 0x02+ DUARTBASE) // Command Register - Channel A
#define INTMASK ((volatile char *) 0x05+ DUARTBASE) // Interrupt Mask Register
#define TXHOLD ((volatile char *)0x03+ DUARTBASE) // Transmit Hold Register
#define ResetToMODE1() *CMD = 0x10 | (*CMD & 0x0F) // Macro to force access to Mode Register 1
void Initialize21KplusDUART(void) { // 21k processor configuration
*SYSCON21K &= BANKS8K; // Set bank size
*WAIT21K &= BANK3MASK; // Clear Bank 3 bits
*WAIT21K |= WAIT6BANK3; // 6 Waits to set
// XR-88C681A Channel A Configuration
*CLOCK = 0x99; // 4800 Baud
*CMD = 0xD5; // TX and RX enabled
ResetToMODE1(); // Access first-mode register
*MODE1 = 0x1F; // 9-bit char, multidrop mode
// Interrupt asserted on RXRDY
*MODE2 = 0x07;
*INTMASK = 0x02; // Activate interrupt
}
|
|||||||||||||||||||||||||||||||||
|
Copyright © 2003 ChipCenter-QuestLink About ChipCenter-Questlink |
||||||||||||||||||||||||||||||||||