Page 1 of 1

Changing the status of portA analog pins

Posted: Tue Aug 04, 2009 2:47 pm
by dpasternack
Hi,

I'm new to both Flowcode and embedded programming. I'm having trouble figuring out how to switch all the pins in portA of a 16F88 chip to i/o digital using Flowcode. Does this happen automatically when I set them to an input within my flowcode program? Flowcode shoes all 8 bits as available for i/o. It simulates fine. However, when I download the program into the actual chip and run, the last three bits don't seem to function as digital i/o. Any help would be appreciated. I promise that as I learn my questions will be more interesting.

Thanks

Dave

Re: Changing the status of portA analog pins

Posted: Tue Aug 04, 2009 4:30 pm
by Benj
Hello Dave

The target microcontroller pins are always digital in Flowcode unless you are specifically reading a ADC component connected to a pin. Therefore inputs and outputs will always be digital. The pin will also remain in the state you left it in so if you have used it to read an input signal level then the pin will remain in high impedance state until told otherwise.

The 16F88 device shares pin RA5 with the Reset pin and pins RA6 and RA7 are used by the crystal / RC oscillator. Therefore as standard you cannot use these pins for general I/O.

These pins can be enabled for your own use by changing the chip configuration to use the internal oscillator and internal MCLR. Note that even if you are using the internal MCLR, RA5 can only ever be an input.

If you need to use all 8 bits for learning purposes etc then all 8 pins of PortB are available for I/O as you would expect.

Re: Changing the status of portA analog pins

Posted: Wed Aug 05, 2009 12:22 am
by dpasternack
Thanks Ben. I guess I'll pick a different PIC for my app. I need 8 inputs and 8 outputs. You've been a great help.