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.

pic16f877 problems.HELP.....................

Status
Not open for further replies.

Minervamcgonall

Newbie level 3
Joined
Jan 8, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,330
im interfacing lcd with pic16f877. the problem is the program runs perfectly in proteus and PICmicro dev. board. But when i use it with pcb hardware, the lcd does not work at all. only it lits up. Multimetee=r readings show that most of the µcontrollr outputs are floating near 1.27V instead of having 5v or 0v. I have verified pcb connections, reset, power and ground voltages. Plz kindly help me. i have tried everything to locate the problem......
 

Hi,

You need to show your program code and actual circuit diagram, plus proteus.

Assume you have fitted the contrast contol across pins 1,2,3 and tried adjusting it both ways ?
 

the mistakes are on the 2nd, 25th and 63rd lines of the lcd code, and 4th line down from the middle in the lcd routine, as well as wiring around the lcd.

















seriously, if you are looking for specific help, you got to be specific on what you are doing and what issues you are running into.

Otherwise, it is incredibly difficult to be specific with your problems and provide you with specific solutions.
 

i m using jhd162a lcd, and here is the code
#include<pic.h>
void LCD_init(void);
void LCD_busy(void);
void LCD_command(unsigned char);
void LCD_senddata(unsigned char);

#define LCD_data PORTD
#define LCD_rs RB1
#define LCD_rw RB2
#define LCD_en RB4

void main()
{
TRISD=0x00; //Setting port direction
TRISB=0x00;

LCD_init();
LCD_command(0xC0);
LCD_senddata('C');
LCD_senddata('O');
LCD_senddata('U');
LCD_senddata('N');
LCD_senddata('T');
while(1);
}
void LCD_init()
{
LCD_command(0x38);
LCD_command(0x0C);
}
void LCD_busy()
{ TRISD=0x80;
LCD_en = 1; // Make port pin as o/p
LCD_rs = 0; // Selected command register
LCD_rw = 1; // We are reading
while(RD7){ // Read busy flag again and again till it becomes 0
LCD_en = 0; // Enable H->L
LCD_en = 1;
}
TRISD=0x00;
}
void LCD_command(unsigned char var)
{
LCD_data = var; // Function set: 2 Line, 8-bit, 5x7 dots
LCD_rs = 0; // Selected command register
LCD_rw = 0; // We are writing in instruction register
LCD_en = 1; // Enable H->L
LCD_en = 0;
LCD_busy(); // Wait for LCD to process the command
}
void LCD_senddata(unsigned char var)
{
LCD_data = var; // Function set: 2 Line, 8-bit, 5x7 dots
LCD_rs = 1; // Selected data register
LCD_rw = 0; // We are writing in instruction register
LCD_en = 1; // Enable H->L
LCD_en = 0;
LCD_busy(); // Wait for LCD to process the command
}

Added after 22 minutes:

i also checked the voltages of lcd without microocntroller. the readings are same as with microcntroller, sum pins showing 5volts and others at 2.5v and 0v.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top