Download presentation
Presentation is loading. Please wait.
1
ColdFire MCF5282 Universal Asynchronous Receiver/Transmitters (UARTs)
2
RS232 Interface Cable
3
Universal Asynchronous Receiver/Transmitters (UARTs)
4
RS232 Character transmission
5
Universal Asynchronous Receiver/Transmitters (UARTs)
7
From Header File..\mod5282\system\sim5282.h /* ------------- 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 ; Example Assignment: sim.uart[1].ucr = 0x0200 /* reset receiver */
8
Universal Asynchronous Receiver/Transmitters (UARTs) Example Assignment: sim.uart[1].ucr = 0x0200 /* reset receiver */
9
Universal Asynchronous Receiver/Transmitters (UARTs)
11
/* 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 }
12
Universal Asynchronous Receiver/Transmitters (UARTs) Interrupt Control Module
13
Universal Asynchronous Receiver/Transmitters (UARTs)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.