09 August 2012

LCD display program for PIC 16f877a Using Mikroc



"Hellow World!" on the first line and counting number on the second line. The image above is a screen capture of a simulation. I use the Proteus 7 VSM simulator to simulate my programs. 




Source code from Mikroc

//Test LCDchar *text = "Hello World!";
char mytext[3];
int i
;
void main() {


// pic16f887// ANSEL = 0x00; //Digital I/O for PORTA// ANSELH = 0x00; //Digital Input for PORTB
// pic16f877A
CMCON = 0x07;  //Set PORTA to Digital input
TRISB = 0;  // PORTB is output
TRISA = 0x07;  //PORTA as the input/output 0000 0111
i=0
;


Lcd_Init(&PORTB); // Initialize LCD connected to PORTB
Lcd_Cmd(Lcd_CLEAR); // Clear display
Lcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor off
Lcd_Out(11text); // Print text to LCD, 2nd row
       while(1)


        {
               while(i<200)

             {
                 IntToStr(i,mytext);
                 Lcd_Out(2,1,mytext);
                 Delay_ms(500);
                 i++;
              }

            i=0;
        }



}

1 comments:

Naviya Nair said...

I have read your blog its very attractive and impressive. I like it your blog.

Java Online Training Java EE Online Training Java EE Online Training Java 8 online training Core Java 8 online training

Java Online Training from India Java Online Training from India Core Java Training Online Core Java Training Online Java Training InstitutesJava Training Institutes

Post a Comment

Related Posts with Thumbnails

Popular Posts

 
;