help to change portd to portb

Status
Not open for further replies.

dodo_ur_4u

Newbie level 4
Joined
Jan 12, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,319
please help;i' trying to connect lcd in 4 bits mode on portb only and leave portb.0 empty because i need it for interrupt so i tried to modify file lcd.c
as follow

void
lcd_write(unsigned char c)
{
__delay_us(40);

PORTB = ( c & 0xF0 );
LCD_STROBE();
PORTB = ( ( c << 4 ) & 0xF0 );

LCD_STROBE();
}

but no output!!!!!!!!!!!!!!!!!!!!
 

Check input/output configuration of pins in PORTB, also check you have correctly connected 4 data lines and RS,RW,E lines to LCD.
 

i have tried every thing possible because i'm using program for simulating " Real pic simualtor", it workes for the first connection but didn't work for my program

i want to ask you if you talk about Mikroc or hi-tech? because i use both for programming
 

Hi,

Whatever the compiler check-list in previous post is valid.
If you can, slow down the simulating speed and check whether 4-data lines, RS, RW & E lines output (high or low) correctly.
At the same time you can observe value in PORTB register and register relevant to RS,RW,E lines change accordingly.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…