> Any suggestions? Yes, that you **read** your XC8 compiler documentation! In particular sections 3.4.7.1 and page 349. It wouldn't hurt either if you tried a little harder. =20 Jan-Erik. -----Ursprungligt meddelande----- Fr=E5n: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] F=F6r Rich= ard R. Pope Skickat: den 20 oktober 2015 16:10 Till: Microcontroller discussion list - Public. =C4mne: Re: SV: [PIC]: Trying to get a 16F877A to talk to an LCD! Jan-Erik, The compiler doesn't like NOP; Any suggestions? Thanks, rich! On 10/20/2015 8:50 AM, Jan-Erik S=F6derholm wrote: > Or simply (as a test) add 3-4 NOPs between each bit operation. > That is easier and doesn't need any new variables or program logic. > > It will certainly remove all RMW issues apart from the very worst,=20 > that you should not see with a LCD module anyway... > > Jan-Erik. > > > > -----Ursprungligt meddelande----- > Fr=E5n: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] F=F6r=20 > Isaac Marino Bavaresco > Skickat: den 20 oktober 2015 15:37 > Till: Microcontroller discussion list - Public. > =C4mne: Re: [PIC]: Trying to get a 16F877A to talk to an LCD! > > Richard, > > > Did you try to avoid RMW issues by using a shadow for the I/O ports? > It is possible to have RMW issues if then pin loading capacitance is=20 > too high or with other mysterious conditions. > > Instead of BCFing or BSFing the pins, do that in a file register and=20 > then copy its value to the port. > > eg.: > > unsigned char ShadowPortA =3D 0x04; // EN starts disabled (1) > ... > PORTA =3D ShadowPortA; > TRISA =3D 0x00; > ... > ShadowPortA &=3D ~0x04; // Set EN =3D 0 > PORTA =3D ShadowPortA; > ... > > ShadowPortA |=3D 0x04; // Set EN =3D 1 > PORTA =3D ShadowPortA; > > > Do not forget that both CMCON and ADCON1 must be set to 0x07. > > > Cheers, > > Isaac > -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/chang= e your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .