با سلام
من می خواستم از اینتراپت خارجی dspic33fj64gs606 استفاده کنم به همین خاطر یک برنامه ساده نوشتم اما چیزی روی lcd نمایش داده نمی شود.
دوستان لطفا کمک کنید
اینم فایل دیتاشیت مربوط به رجیسترهای اینتراپت
http://s4.picofile.com/file/7798389993/Section_47_Interrupts_Part_V_.pdf.html
من می خواستم از اینتراپت خارجی dspic33fj64gs606 استفاده کنم به همین خاطر یک برنامه ساده نوشتم اما چیزی روی lcd نمایش داده نمی شود.
دوستان لطفا کمک کنید
اینم فایل دیتاشیت مربوط به رجیسترهای اینتراپت
http://s4.picofile.com/file/7798389993/Section_47_Interrupts_Part_V_.pdf.html
کد:
// LCD module connections sbit LCD_RS at LATD10_bit; sbit LCD_EN at LATD8_bit; sbit LCD_D4 at LATD4_bit; sbit LCD_D5 at LATD5_bit; sbit LCD_D6 at LATD6_bit; sbit LCD_D7 at LATD3_bit; sbit LCD_RS_Direction at TRISD10_bit; sbit LCD_EN_Direction at TRISD8_bit; sbit LCD_D4_Direction at TRISD4_bit; sbit LCD_D5_Direction at TRISD5_bit; sbit LCD_D6_Direction at TRISD6_bit; sbit LCD_D7_Direction at TRISD3_bit; // End LCD module connections char txt1[] = "Pulse:"; unsigned int i=0,; char buffer1[16]; // Loop variable void Interrupt() { i=i+1; IFS0.INT0IF = 0; //External Interrupt 0 Flag Status bit has not occurred } void main(){ ADPCFG = 0xFFFF; // Configure AN pins as digital I/O TRISD0_bit=1; TRISF6_bit=1; // Interrupt Setting INTCON1.NSTDIS = 1; //Interrupt nesting is disabled INTCON2.INT0EP = 1; //Interrupt on negative edge IPC0 = 0x0007; //External Interrupt 0 (highest priority interrupt) IFS0.INT0IF = 0; //External Interrupt 0 Flag Status bit has not occurred IEC0.INT0IE = 1; //External Interrupt 0 Enable bit //MAX1CNT = 0b10000000; Lcd_Init(); // Initialize LCD Lcd_Cmd(_LCD_CLEAR); // Clear display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1,1,txt1); // Write text in first row while(1) { Lcd_Cmd(_LCD_CLEAR); // Clear display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1,1,txt1); // Write text in first row sprintf(buffer1, "%u", i); Lcd_Out(1,7,buffer1); Delay_ms(300); } }
دیدگاه