Thanks for the tip. I guess I'll get hold of the supervisor as suggested. But maybe you could answer my question:
I'm using a PIC18f452 with PicKit3, and I'm using C18. The latter is the kicker. I can read the documentation for PORTA such that I could configure it for digital IO on PORTA using ASM, but I see no documentation for C. Do you know the answer?
I wish that were true, spinnaker, but I am using a PIC18f452 and they are different.Look for the document called PICkit 3 Debug Express PIC18F45K20 MPLAB® C Lessons on the Microchip website.
Go through the lessons. If you have a question, post back.
So what happens, blueroom? I configured my PortA for output and it worked just fine, then I configured it for input and it was zero, not what I told it to be.. What is happening? I just presumed it was a configuration problem. Am I wrong? My thought is that PortA is analog to digital and I have to figure out how to turn it into digital IO using C18.
Note: On a Power-on Reset, RA5 and RA3:RA0
are configured as analog inputs and read
as 0. RA6 and RA4 are configured as
digital inputs.
The operation of each pin is selected by clearing/setting the
control bits in the ADCON1 register (A/D Control
Register1).
ADCON1 = 0x07;
Have you looked at the sample code?How do I do that with C, specifically?
by Robert Keim
by Duane Benson
by Jake Hertz
by Robert Keim