Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help my lcd project lmb16abd and 16f877a

Status
Not open for further replies.
That display IS HD4470 compatible (but it is upside down :-?).

I repeat myself again - you MUST use decoupling capacitors across VSS and VDD, it will not work without them, especially on breadboard and with wiring like that!

Brian.
 

how can i pick the capacitors and witch vss vdd i use them on
 

Attachments

  • lcd.rar
    158.4 KB · Views: 42

If you still have the regulator (I can't see it in the second photograph) connect a 10uF capacitor across it's input pin and ground pin and connect a 100nF capacitor between it's output pin and ground pin. These must be close to the regulator, keep the wiring as short as you can.

Also connect 100nf across pins 11 and 12 and another across pins 31 and 32. Mount them close to the PIC and with short wires.

These capacitors are important. They are there to provide a clean supply to the PIC which is especially important when you are using that type of construction. If you leave them off, you may get no operation or random operation dependng on how bad the signals across the supply lines and oscillator components become.

Brian.
 

what do you think abut the code in post 47
 

I don't use Mikro C but assuming the LCD library routines are called correctly and you have followed the advice about the LED resistors and decoupling capacitors, it should show your text then go into a loop flashing the LED.

Brian.
 

Well spotted!

Code:
while(1)
  PORTD = ~PORTD;
  Delay_ms(1000);

should be:

Code:
while(1)
{
  PORTD = ~PORTD;
  Delay_ms(1000);
}

or only the first line will execute.

Brian.
 

the led don't flash on Proteus even after betwixt post52 on it
 

If you still have the regulator (I can't see it in the second photograph) connect a 10uF capacitor across it's input pin and ground pin and connect a 100nF capacitor between it's output pin and ground pin. These must be close to the regulator, keep the wiring as short as you can.

Also connect 100nf across pins 11 and 12 and another across pins 31 and 32. Mount them close to the PIC and with short wires.

These capacitors are important. They are there to provide a clean supply to the PIC which is especially important when you are using that type of construction. If you leave them off, you may get no operation or random operation dependng on how bad the signals across the supply lines and oscillator components become.

Brian.

here is a photo and the cap you tolled me
 

That's better although your construction is very unclear.

Checklist:
1. is it really a 4MHz crystal you are using and are you sure the two loading capacitors are the correct values?
2. Do you have the PIC configured to use XT oscillator mode?
3. Is the watchdog timer enabled and if it is, are you sure it isn't constantly resetting the PIC?
4. Check the RW pin on the LCD is really grounded.
5. measure the VDD voltage and make sure it really is 5V. If the battery is slightly discharged it may fail to meet the 8V minimum needed by the 7805 to function properly.
6. measure the voltage at pin 1 and make sure it is the same as at the VDD pins.

The image shows some characters, although wrong are being written to the bottom line of the LCD so something appears to be running but not properly.

Brian.
 



i don't know how to pick the capacitors but it work it in other projects

checked on the rw

pin 1 give 5v and the vdd on the lcd give 1.5
the vdd on the pic give 5v
i stpo useing regulator and the9v battery give 5v now
 

pin 1 give 5v and the vdd on the lcd give 1.5
the vdd on the pic give 5v

Now I'm confused. The PIC VDD and LCD VDD should be linked together so how can one be 5V and the other 1.5V?

I think it's time you re-posted your schematic and code, you have obviously made changes we are not aware of so helping you is difficult. Those loading capacitors should be around 22pF or 33pF in value.

Brian.
 

i did change things when the battery don't give 9v any more

Code:
sbit LCD_EN at RB0_bit;
sbit LCD_RS at RB1_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;

sbit LCD_EN_Direction at TRISB0_bit;
sbit LCD_RS_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;




void main() {


TRISB = 0x00;
TRISD = 0x00;
PORTB = 0x00;
PORTD = 0x00;
LCD_Init();
LCD_Cmd(_LCD_CLEAR);
LCD_Cmd(_LCD_CURSOR_OFF);
Lcd_Out(1,1,"LCD 4-bit");

while(1)
{
  PORTD = ~PORTD;
  Delay_ms(1000);
}   }

both of the photos give black blocks

 

Problem 1: If the battery is a good one, you have killed the PIC and LCD. They are designed to run on no more than 5V but you have connected then directly to 9V.

Your construction is horrible but as far as I can tell from the photograph, it is electrically wired correctly except for the decoupling capacitors. I do not use your compiler but the code looks OK. Assuming the PIC and LCD have survived the supply voltage, the missing link to check is the configuration bits in the PIC. The compiler is setting them correctly but is your programmer actually loading them into the PIC? Some programmer units ignore the fuse settings or they have to be entered manually. Please try READING the PIC back into the programmer and looking at the fuses to see if they match the ones the compiler produced.

I assure you these things do work. I have a PIC running two 4 line LCDs at the same time in front of me at the moment!

Brian.
 

Problem 1: If the battery is a good one, you have killed the PIC and LCD. They are designed to run on no more than 5V but you have connected then directly to 9V.

Your construction is horrible but as far as I can tell from the photograph, it is electrically wired correctly except for the decoupling capacitors. I do not use your compiler but the code looks OK. Assuming the PIC and LCD have survived the supply voltage, the missing link to check is the configuration bits in the PIC. The compiler is setting them correctly but is your programmer actually loading them into the PIC? Some programmer units ignore the fuse settings or they have to be entered manually. Please try READING the PIC back into the programmer and looking at the fuses to see if they match the ones the compiler produced.

I assure you these things do work. I have a PIC running two 4 line LCDs at the same time in front of me at the moment!

Brian.
how do i use the decoupling capacitors
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top