200 likes | 317 Views
ColdFire MCF5282 Universal Asynchronous Receiver/Transmitters (UARTs). RS232 Interface Cable. Universal Asynchronous Receiver/Transmitters (UARTs). RS232 Character transmission. Universal Asynchronous Receiver/Transmitters (UARTs). Universal Asynchronous Receiver/Transmitters (UARTs).
E N D
ColdFire MCF5282Universal Asynchronous Receiver/Transmitters (UARTs)
/* ------------- will become array uart[3] 0200->02bc --------------- */ typedef struct { /* uart modules */ vubyte umr; /* 8bit uart mode register */ vubyte pack00[3]; /* 24bit reserved */ vubyte usr; /* 8bit read: status register */ /* write: clock-select register */ vubyte pack01[3]; /* 24bit reserved */ vubyte ucr; /* 8bit read: do not access */ /* write: command register */ vubyte pack02[3]; /* 24bit reserved */ vubyte udb; /* 8bit read: recieve buffer */ /* write: transmit buffer */ vubyte pack03[3]; /* 24bit reserved */ vubyte iacr; /* 8bit read: input port change register */ /* write: auxiliary control register */ vubyte pack04[3]; /* 24bit reserved */ vubyte ir; /* 8bit read: interupt status register */ /* write: interupt mask register */ vubyte pack05[3]; /* 24bit reserved */ vubyte dur; /* 8bit read: do not access */ /* write: divider upper register */ vubyte pack06[3]; /* 24bit reserved */ vubyte dlr; /* 8bit read: do not access */ /* write: divider lower register */ vubyte pack07[23];/* 24bit reserved */ vubyte uip; /* 8bit read: input port register */ /* write: do not access */ vubyte pack08[3]; /* 24bit reserved */ vubyte ops; /* 8bit read: do not access */ /* write: output port bit set command register */ vubyte pack09[3]; vubyte opr; /* 8bit read: do not access */ /* write: output port bit reset commmand register */ vubyte pack0a[3]; } uartstruct ; From Header File ..\mod5282\system\sim5282.h Example Assignment: sim.uart[1].ucr = 0x0200 /* reset receiver */
Universal Asynchronous Receiver/Transmitters (UARTs) Example Assignment: sim.uart[1].ucr = 0x0200 /* reset receiver */
Universal Asynchronous Receiver/Transmitters (UARTs) /* This function sets up the 5282 interrupt controller */ void SetIntc(int intc, /* Interrupt Controller Number */ long func, /* Address of Interrupt Service Routine */ int vector, /* Vector Table Number */ int level, /* Interupt Priority Level */ int prio /* Interrupt Priority Sub Level */ ); /* This macro implements the UART Interrupt Service Routine */ INTERRUPT(my_UART_func, /* Name of Interrupt Service Routine */ 0x2600 /* Mask - Enter Supervisor Mode, Set Interrupt Mask */ ) { /* You can add your ISR code here. - Do not call any RTOS function with pend or init in the function name - Do not call any functions that perform a system I/O read, write, prin }
Universal Asynchronous Receiver/Transmitters (UARTs) Interrupt Control Module