170 likes | 258 Views
ECSE436 Tutorial. HWI Laurier Boulianne. Questions. Outline. Polling vs Hardware Interrupts Interrupts Interrupts Implement Interrupts on the C6713 Assignments. POLLING vs HWI. 2 ways to get information in and out Polling Hardware Interrupts HWI is more efficient.
E N D
ECSE436 Tutorial HWI Laurier Boulianne
Outline • Polling vs Hardware Interrupts • Interrupts • Interrupts • Implement Interrupts on the C6713 • Assignments
POLLING vs HWI • 2 ways to get information in and out • Polling • Hardware Interrupts • HWI is more efficient
Interrupt Handler • Create a project as usual, make sure to create a DSP/BIOS configuration file • In order to enable interrupts, we need to do a few changes in the configuration file (.cdb).
Interrupt Handler • First, in the configuration manager, expand the scheduling folder • Right-click on the “TSK - Task Manager” item, select “Properties”, and ensure that the Task Manager is NOT enabled
Interrupt Handler • Expand the “HWI - Hardware Interrupt . . .” item, and select any of the interrupts from HWI INT4 to 15. Right-click on it, select properties.
Interrupt Handler • Change the “Interrupt Source” to “MCSP 1 Receive”, and the “function” to the name of your interrupt handling routine, preceded by an underscore
Interrupt Handler • Still in properties, select the “Dispatcher” tab, and enable it. Leave the other values unchanged.
Changes in your C code • In your main function, after all other initializations are done (DSK6713 init(), AIC23 configs, etc.), write • IRQ_enable(IRQ_EVT_RINT1); • IRQ_globalEnable();
Changes in your C code • Finally, write your ISR. • Do not forget to use the name that you entered in the configuration manager (minus the underscore) void myHandler(void) { ...your code... }
Double Buffering • Remember that you need some way to process the data without it being overwritten with new data, so you need to implement some sort of double-buffering scheme A Process Data Write Data B
Assignments • Read C6713 One-day Workshop from TI (chapter 2) (WebCT) • Redo exercise given in the handout, but this time handle the I/O with interrupts instead of polling