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.

[SOLVED] Problem with LCD in 8 bit mode-PIC Hi-Tech

Status
Not open for further replies.

The._.One

Newbie level 5
Joined
Oct 25, 2008
Messages
10
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Czech Republic
Activity points
1,330
Problem with LCD

Hi, I'm using PIC and PIC C18 compler from Hi-tech. I had little problem with LCD in 8 bit mode. When i want print number it's ok, but when i want print some char i had problem.
This is library which i use:
Code:
#include <htc.h>
#include	"lcd8.h"

#define	LCD_RS RC0
#define	LCD_RW RB5
#define LCD_EN RC5

#define LCD_DATA	PORTA

#define	LCD_STROBE()	((LCD_EN = 1),(LCD_EN=0))

void lcd8_write(char c) {
	_delay(10);
	LCD_DATA = c;
	LCD_STROBE();
}

void lcd8_clear(void) {
	LCD_RS = 0;
	lcd8_write(0x01);
	_delay(500);
}


void lcd8_putch(char c) {
	LCD_RS = 1;
	if(c >= 0x40 && c <= 0x7f)
		c+=0x40;
	lcd8_write( c );
}

void lcd8_puts(const char * s) {
	LCD_RS = 1;
	while(*s)
		lcd8_putch(*s++);
}

void lcd8_goto(char pos) {
	LCD_RS = 0;
	lcd8_write(0x80+pos);
}

void lcd8_init(void) {

	LCD_RS = 0;
	LCD_EN = 0;
	LCD_RW = 0;
	
	_delay(3750);
	LCD_DATA = 0x30;
	LCD_STROBE();
	_delay(1250);
	LCD_STROBE();
	_delay(50);
	LCD_STROBE();
	_delay(50);

	lcd8_write(0x38);
	lcd8_write(0x08);
	lcd8_clear();
	lcd8_write(0x06);
  lcd8_write(0x0C);
}

When i write lcd8_putch('e'); I have on LCD •.
This character have same low half-byte abd upper half-byte is +4.
I have use condition for corect this, ucan see it in code above. It!s some resolution where a don't need charge 4 to upper half-byte?
 

Re: Problem with LCD

Hi,
Lower nibbles of the characters 'e' and '*' are not same, one is 5h and the other is 0ah . If all numerals are comming correctly, may be a display problem. Anyway check the wiring of data line B6 for any shorts.

Regards,
Laktronics
 

    The._.One

    Points: 2
    Helpful Answer Positive Rating
Re: Problem with LCD

Oki i will try find error in schematic. I try use 4 displey and all do same thing.


I found error i use PORTA with disable OSC pin and i think then pin are going 0,1,2,3,4,5,6,7 but they are 0,1,2,3,4,5,7,6 Thank u very much.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top