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.

LCD TAb Problem

Status
Not open for further replies.

Hasan Malik

Junior Member level 1
Joined
May 26, 2012
Messages
18
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,380
HI

I m having a problem while displaying on 16x2 LCD
the words or digits when displayed on the LCD every time take tab
my pin configrations of LCD are

PIN #

1 >>> VSS
2 >>> VDD
3 >>> V0
4 >>> RB4
5 >>> Ground
6 >>> RB5

7-10 >>> Ground

11 >>> RB0
12 >>> RB1
13 >>> RB2
14 >>> RB3



And my code is




// Lcd pinout settings
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D4 at RB0_bit;

// Pin direction
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D7_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB0_bit;


unsigned long temp_res; int txt[10]; unsigned int a; unsigned int tt[4];

void main() {
Lcd_Init();

Lcd_Cmd(_LCD_CURSOR_OFF); temp_res=0;

do {
temp_res = ADC_Read(2); // Get 10-bit results of AD conversion
delay_ms(50);
a=temp_res;
a=a/2; // Send 2 most significant bits to RC1, RC0
IntToStr(a, tt);
LCD_out(1,1,tt) ;
Lcd_Out_Cp("°C");
LCD_out(2,1,"TEMP SENSOR");
delay_ms(100);
} while(1);
}
 

try using
Lcd_Cmd(_LCD_CLEAR); // Clear display
 

and what is this tt??
its an array, iam supposing that you are storing two bytes in this array. which means that two other bytes are empty.
try to make it tt[2],if you are using two bytes data.
 

and what is this tt??
its an array, iam supposing that you are storing two bytes in this array. which means that two other bytes are empty.
try to make it tt[2],if you are using two bytes data.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top