I haven't been following this too closely but I don't see ADCON0 set in there. This is what I use: ADCON0 =3D 0; // adc off ADCON1 =3D 7; // all digital CMCON =3D 7; // Comparators off Allen > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist- > bounces@mit.edu] On Behalf Of Richard R. Pope > Sent: Tuesday, October 20, 2015 11:45 AM > To: Microcontroller discussion list - Public. > Subject: Re: SV: SV: SV: SV: [PIC]: Trying to get a 16F877A to > talk to an LCD! >=20 > Jan-Erik, > There is no activity on either PORTA or D. The blip that I see > is > probably just the pin burbbing on application of the power. I > know that > the chip is running because the OSC is running. > Well I have reduced this to the absolute minimal code. Here > it is: > #pragma config FOSC =3D HS, #pragma config WDTE =3D > OFF, > #pragma config PWRTE =3D OFF > #pragma config BOREN =3D OFF, #pragma config LVP =3D > ON, > #pragma config CPD =3D OFF > #pragma config WRT =3D OFF, #pragma config CP =3D OFF >=20 > ADCON1 =3D 7; > CMCON =3D 7; >=20 > PORTA =3D 0; > PORTD =3D 0; >=20 > TRISA =3D 0; > TRISD =3D 0; >=20 > en =3D 0; > Init: > PORTA =3D 0; > PORTD =3D 0; > wait(5); > PORTA =3D 1; > NOP(); > NOP(); > NOP(); > PORTD =3D 1; > NOP(); > NOP(); > NOP(); > wait(5); > goto Init; > It doesn't get much simpler than that. There is a 8MHz crystal > hooked up > to the OSC pins. It is running at 7.9997 MHz. The caps =3D 47pF. > As per > the data sheet the FOSC =3D HS. Almost everything else is turned > off. What > do you think? Any ideas from anybody? > Thanks, > rich! >=20 > On 10/20/2015 10:00 AM, Jan-Erik S=F6derholm wrote: > > Exactly *what* was unclear from page 349 in the XC8 manual > !? > > > > Your question make be believe that you never bothered to > > check page 349 (or anything else in the manual, I guess). > > > > Good luck. > > > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > =3D=3D=3D > > Synopsis > > #include > > NOP(); > > Description > > Execute NOP instruction here. This is often useful to fine > tune delays or > > create a handle for breakpoints. The NOP instruction is > sometimes required > > during some sensitive sequences in hardware. > > > > Example > > #include > > void crude_delay(unsigned char x) { > > while(x--){ > > NOP(); /* Do nothing for 3 cycles */ > > NOP(); > > NOP(); > > } > > } > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D > =3D=3D=3D > > > > > > Jan-Erik. > > > > > > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list > archive > View/change 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 .