Skip to main content

How to interface a 16*4 LCD with PIC18F452 with codes


Over the past week I am puzzled that how to interface a lcd with pic18f452 microcontroller atlast i got it working

Softwares Used

1. mikroc for pic pro
2. proteus vsm simulator (demo version)

Hardwares Used

1. 16*4 LCD
2. PIC18F452
3. 8Mhz Crystal Oscillator
4. and resistors, capacitors, power supply etc.

The Following is the schematic


The Following is the working code


LCD
sbit Lcd_RS at RA0_bit;
sbit Lcd_EN at RA2_bit;
sbit Lcd_D7 at RB7_bit;
sbit Lcd_D6 at RB6_bit;
sbit Lcd_D5 at RB5_bit;
sbit Lcd_D4 at RB4_bit;
sbit Lcd_D3 at RB3_bit;
sbit Lcd_D2 at RB2_bit;
sbit Lcd_D1 at RB1_bit;
sbit Lcd_D0 at RB0_bit;
sbit Lcd_RS_Direction at TRISA0_bit;
sbit Lcd_EN_Direction at TRISA2_bit;
sbit Lcd_D7_Direction at TRISB7_bit;
sbit Lcd_D6_Direction at TRISB6_bit;
sbit Lcd_D5_Direction at TRISB5_bit;
sbit Lcd_D4_Direction at TRISB4_bit;
sbit Lcd_D3_Direction at TRISB3_bit;
sbit Lcd_D2_Direction at TRISB2_bit;
sbit Lcd_D1_Direction at TRISB1_bit;
sbit Lcd_D0_Direction at TRISB0_bit;
// End Lcd8 module connections

char * text;

void main(){
    ADCON1 |= 0x07;
    TRISA = 0;
    INTCON = 0;
    INTCON1 = 0;
    INTCON2 = 0;
    CCP2CON = 0;
    TRISB=0;
    Delay_ms(2000);
Lcd_Init();
Delay_ms(2000);
Lcd_Cmd(_Lcd_CLEAR);
//Lcd_Cmd(_Lcd_CURSOR_OFF);
Delay_ms(2000);
text = "WWW.ANDRIL.IN"    ;
Lcd_Out(1,1,text);
Delay_ms(2000);
text = "BLOG.KATHIR.CO.IN"    ;
Lcd_Out(1,1,text);
    }

The above code works only when lcd library in mikroc is enabled
it works only with mikroc
/ Test these codes at your own risk. we are not responsible for any malfunctions/


Comments

  1. A Liquid Crystal Display (LCD) is one of the most enduring and fundamental technologies used in most monitors, televisions, tablets and smartphones. TVs and other monitors used to use cathode ray tubes (CRTs) to provide the image onto the screen. Once LCD displays became affordable they quickly displaced the bulky CRTs. https://www.stoneitech.com/about/news/sharing/assemble-lcd-module.html

    ReplyDelete
  2. Intimately, the post is actually the sweetest on that worthw hile topic. I harmonise with your conclusions and will certainly eagerly look forward to your incoming updates. Saying thanks definitely will not simply be sufficient, for the extraordinary clarity in your writing. I will certainly perfect away grab your rss feed to stay informed of any updates. Solid work and much success in your business dealings! led futófény

    ReplyDelete

Post a Comment

Popular posts from this blog

Free Electronic Product Samples / Components For India

Texas Instruments offering samples in a wide area of electronics. They provide you products such semiconductors, ic's, sensors, microprocessors, microcontrollers, etc. Most of them can be brand new and introductory items to the entire world. If you are an entusiasist in electronics, student doing innovative project, industry implementing new technologies. You are the right person to get those samples for absolutely free. All you need to do is 1) go to their website www.ti.com 2) Signup for an account in my.ti (It is recommended to give proper shipping addresses with real , full name with initials in order to receive the samples without any conflicts.) 3) Browse various products using their simple and customized search. 4) Add those free samples you require or love to try. 5) Then submit the cart. fill up once again. if it is prompted for confirmation or address. simply accept and give the shipping address. Thats all you will get those samples delivered to you within...

Can you solve the three gods riddle? - Proposed Answer

I recently landed on a youtube video about this question and intrigued about its uncertainty in detail in every aspect. Hence i thought it would be a challenge to solve it and decided to work on it. For those who dont know about the question can watch this video to know it better. I thought we can exploit the details of the question to workaround and come up with a decent answer to this question. My take is as follows. Condition 1: We can ask only three yes/no questions Condition 2: Each question should be dedicated to only one god. Condition 3: You can ask multiple questions to the same god. Let us choose first god and ask the first question 1) Are you ARR? Repeat the question again and again to confirm it is not ARR. Since you will get different responses for the same question. (Remember, Condition 1 limits the number of questions can be asked but not from the number of times it can be asked.) If the God is ARR, We can skip to the 2nd god, otherwise we can s...

Mitticool Refrigerator - An Indian Invention which runs without electricity

Mansukhbhai Raghavjibhai Prajapati  was born in gujarat. He was a traditional potter and was a popular rural innovator. who is well known for his innovative refrigerator called "Mitticool Refrigerator". Yeah you have been well known about the idea behind this refrigerator. The refrigerator is working without electricity. And its quite cheap as it is the most simplest and efficient form of refrigeration. It can preserve the fruits, eggs etc fresh for more than three days. It is made from a special form of clay and its environment friendly too. It will eliminate the potential environmental and pollution hazards. M.R. Prajapati now holds the patent for the mitticool invention along with several awards. Mitticool was featured in centre for india and global business, Judge business school, university of cambridge. Bosch and siemens hausgerate was shown interest to buy this product. The Forbes magazine listed him the most powerful rural entrepreneur in 2010. Pressure cooker, water...