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

Wipro - Anna University Off Campus

Anna University, Chennai is organizing Tamil Nadu State Level Placement Programme (TNSLPP) 2011-12, for the Present Final Year (2012 Passing Out) Students studying in Self Financing Engineering Colleges of Tamil Nadu. Wipro Technologies, has kindly agreed to participate in this Placement Programme during 7th & 8th February 2012. Centre for University Industry Collaboration, Anna University Chennai is conducting this programme at P.S.N.A. College of Engineering & Technology, Kothandaraman Nagar, Dindigul - 624 622 for the 2012 Passing Out Students. The final year students of B.E. / B.Tech. (CSE, ECE, EEE, EIE, ICE & IT) with an average of 8.0 and above (No Standing Arrears) from I Semester to VII Semester are eligible to participate. It is mandatory that all the students should secure an average of 70% and above marks consistently from 10th Std. and 12th Std. It is requested that the Principal / Placement Officers of the College should verify the marks of the st

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

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