Presentation is loading. Please wait.

Presentation is loading. Please wait.

Example 17 SCI Receive Interrupts

Similar presentations


Presentation on theme: "Example 17 SCI Receive Interrupts"— Presentation transcript:

1 Example 17 SCI Receive Interrupts
Lecture L7.3

2

3 // Example 17: SCI using receive interrupts
#include <hidef.h> /* common defines and macros */ #include <mc9s12dp256.h> /* derivative information */ #include "queue.h" #include "main_asm.h" /* interface to the assembly module */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b" // SCI0 receive Interrupt Service Routine void interrupt 20 handler(){ qstore(read_SCI0_Rx()); }

4 void main(void) { char c; PLL_init(); // set system clock frequency to 24 MHz lcd_init(); // enable lcd SCI0_int_init(9600); // initialize SCI0 at with interrupts while(1){ while(qempty() != 0){ // empty the queue c = getq(); // and display on lcd data8(c); // write it to the LCD outchar0(c); // echo it back }

5 Use host.exe to download any text file to the miniDragon+ board


Download ppt "Example 17 SCI Receive Interrupts"

Similar presentations


Ads by Google