Can anyone help me with this.
I need to use " PORTC " and 4 x MSD's( bit7,6,5,4) instead of the LSD(bit,3,2,1,0).
I have also re-defined E, R/W, RS to C,2 C,1, and C,3 as in my circuit. I know it works as i have loaded assm code with the same Pin Cons.
I would be very grateful for help to find my mistake as i am trying to learn and understand 'C' Here is one of the changes i have tried! as well i have changed the order of Nybble(i); -- Nybble(i>>4);
I need to use " PORTC " and 4 x MSD's( bit7,6,5,4) instead of the LSD(bit,3,2,1,0).
I have also re-defined E, R/W, RS to C,2 C,1, and C,3 as in my circuit. I know it works as i have loaded assm code with the same Pin Cons.
I would be very grateful for help to find my mistake as i am trying to learn and understand 'C' Here is one of the changes i have tried! as well i have changed the order of Nybble(i); -- Nybble(i>>4);
Code:
,6,5,4
void Nybble(unsigned char dat)//
{
dat &= 0xf0; // clear top bits of dat
LCDdata &= 0xf0; // clear bottom bits of port (interested only in DB7-DB4)
LCDdata |= dat; //or the two and store at port
E = 1;
Delay1TCY(); //enable pulse width >= 300ns (used 4uS)
E = 0; //Clock enable: falling edge
}
Last edited: