slippyr4 wrote: > 2010/1/20 Ruben J=F6nsson > = >> Make sure that you don't have any interrupts that interfere with the LCD >> writing. Especially if the interrupt uses bits in the same port that is >> used by >> the LCD. Also make sure that you don't have any read modify write (RMW) >> problems. >> >> > Maybe there's a problem here. > = > I use RB5, RB6, RB7 for E, RW, RS. > = > I'm using some of the lower bits in port B for other things. > = > All of my reads and writes to port B are in the form:- > = > PORTBbits.RB2 =3D 1; > = > I'm not sure if the compiler generates "safe" code for that, or not. > = > I guess in a future hardware revision I should change ports that i'm usin= g, > so I can get the LCD on it's own unique port. I think i'll need to change= to > a 40 pin part to do that though, i'm running out of capacity on the 28 pin > parts. At 20 MHz you might have to add one or two NOP's between each direct bit-instruction on a PORT reg. That should nornmaly be enough if there isn't some un-normal capacitive load on the pins. And, what do you do with RW ? Do you ever *read* from the LCD ? If not, just tie it low and save a pin... -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist