PIC + LCD 2x16..

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Re: PIC + LCD 2x16..

Postby shahrul » Wed May 18, 2011 7:03 pm

Thanks follow my lesson.

Your LCD backlight blinking ON and OFF, then your microcontroller circuit and it's programming running.
I think the problem is on the lcd data connection.
1) Make sure you connect to PORTD following the programming part.
2) Did you soldered the LCD connection? Because I have facing before, one person use LCD connector but not solder. He just plug-in into the LCD port on the SK40C.

Other thing, on programming, you can try add more delay on LCD power-up. All LCD I buy, I use 15ms delay and it's working fine.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PIC + LCD 2x16..

Postby syntium87 » Wed May 18, 2011 10:47 pm

i've solder the LCD connector..and check every connection on the LCD..after another attempt just to make it display correctly...1st line of LCD doesnt show anything..2nd line just black bar appear..

why is that happening?hmm..or should i change a new LCD?
syntium87
Novice
 
Posts: 27
Joined: Sun Apr 03, 2011 12:51 am

Re: PIC + LCD 2x16..

Postby shahrul » Wed May 18, 2011 11:02 pm

syntium87 WROTE:i've solder the LCD connector..and check every connection on the LCD..after another attempt just to make it display correctly...1st line of LCD doesnt show anything..2nd line just black bar appear..

why is that happening?hmm..or should i change a new LCD?

Yes, should try on another LCD.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PIC + LCD 2x16..

Postby yonghui » Wed May 18, 2011 11:09 pm

hi,

there are some instructions require more delay like the clear, instruction, be aware of that.

and one thing is that the contrast Vee is connected to gnd via a resistor, different lCD might need different resistor for proper contrast, u can try using a preset to adjust suitable contrast.

what is the controller u are using and wat is the frequency u are running.
the TRIS bits are set correctly?


regards,
yh
thanks&regards,
yh
yonghui
Professional
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: PIC + LCD 2x16..

Postby syntium87 » Wed May 18, 2011 11:47 pm

ouh...on the clear part??havent check yet..im using pic16f877a n freq run at 20Mhz..hmmm

and i wonder why the 1st line just very clear with no black bar at all..but on the 2nd line is quite thick black bar..n the LCD i used is the same as in the PR3 cytron..

hmmm.... :arrow:
syntium87
Novice
 
Posts: 27
Joined: Sun Apr 03, 2011 12:51 am

Re: PIC + LCD 2x16..

Postby syntium87 » Thu May 19, 2011 4:35 pm

fuhhh..finally can display the msg on the LCD...thanks guys for all help of u guys...credit to all of u .. :)

but then i have this problem..(PIC+LCD+Push button+LED)
CODE: SELECT_ALL_CODE
if(!sw1)
  { 
     PORTB=0bxxxxxxxxx; (for LED)
     delay(xxxxx);
     PORTB=0bxxxxxxxxx; (for LED)
     delay(xxxxx);
     lcd_goto(0);
     lcd_string("  xxxx MSG xxxx ");
     lcd_goto(20);
     delay(xxxxx);   //for about 3-4s
  }
else (!sw2)
  {
      {almost the same as in switch 1}
  }

before this program i have a standby mode function being called that makes the LED blinking..but after i try to press either one push button..it doesnt show any output as command written on the program..the cct is just keep running the standby mode

CODE: SELECT_ALL_CODE
standby mode()

    PORTB=0b011111111; (for LED)
    delay(xxxxx);
    PORTB=0b000000000; (for LED)
    delay(xxxxx);
}

then i check for
(1)the port for push button is PORT A n already define as the input...
(2)circuitry for push button and LCD is maintain be4 being combined together(before that both cct is working well)
(3)the current and voltage for the push button and PORT A after pressed and before pressed shows only 0 value( 0V and 0A)

hmm..what am i missing on the program???

Simple flowchart that i wnt.. -->

standby--->if press PB1 --> yes --> led blink style 1 & LCD show msg 1 --> delay --> standby mode
--> no --> standby mode
--->if press PB2 --> yes --> led blink style 2 & LCD show msg 2 --> delay --> standby mode
--> no --> standby mode

help me to solve it :?
syntium87
Novice
 
Posts: 27
Joined: Sun Apr 03, 2011 12:51 am

Re: PIC + LCD 2x16..

Postby yonghui » Sun May 22, 2011 2:50 pm

im suspicious with ur push button circuit.
in the normal connection for push button with a pull up resistor, the voltage shud be 5V when released and 0V when pressed. but u mentioned both states give 0v?

regards,

yh
thanks&regards,
yh
yonghui
Professional
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: PIC + LCD 2x16..

Postby robosang » Sun May 22, 2011 5:20 pm

syntium87 WROTE:
CODE: SELECT_ALL_CODE
if(!sw1)
  { 
     PORTB=0bxxxxxxxxx; (for LED)
     delay(xxxxx);
     PORTB=0bxxxxxxxxx; (for LED)
     delay(xxxxx);
     lcd_goto(0);
     lcd_string("  xxxx MSG xxxx ");
     lcd_goto(20);
     delay(xxxxx);   //for about 3-4s
  }
else (!sw2)
  {
      {almost the same as in switch 1}
  }


(1)the port for push button is PORT A n already define as the input...
(2)circuitry for push button and LCD is maintain be4 being combined together(before that both cct is working well)
(3)the current and voltage for the push button and PORT A after pressed and before pressed shows only 0 value( 0V and 0A)


1. I doubt you can compile your code :) And I don understand why you don want to put the value into the code, putting XXXXX does not help any of us nor you. At the back of "else" there should not be any case.
2. PORTA as digital input? You might have get into another trouble :lol: Why? Because PORTA (most of the pin) is analog port, and by default it is analog pin. After you configure as input you will still need to make sure those pins are digital instead of analog.
3. So what is the problem with your LCD? You din share with the rest of us. Other might had similar problem. Your sharing will save their time.
4. How do you measure the current for push button? Really like to know the method.
5. As yonghui said, how do you connect the circuit for push button?
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: PIC + LCD 2x16..

Postby syntium87 » Tue May 24, 2011 9:16 am

thanks guys..i already solve it..credit to all of u...huhu..
syntium87
Novice
 
Posts: 27
Joined: Sun Apr 03, 2011 12:51 am

Re: PIC + LCD 2x16..

Postby ecrumb » Thu Jan 19, 2012 5:23 am

hi,
i try to run project as in PR3..i follow every steps as in the manual which start form construct the hardware until run the program but the result is not as i desired.what happen is my lcd displayed black row on the 1st row and nothing appeared on 2nd row..
can u explain to me what is wrong with my project?
ecrumb
Freshie
 
Posts: 4
Joined: Tue Jan 17, 2012 10:56 am

PreviousNext

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 2 guests