Changing the status of portA analog pins

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
dpasternack
Posts: 5
Joined: Tue Aug 04, 2009 1:47 pm

Changing the status of portA analog pins

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Changing the status of portA analog pins

Post 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.

dpasternack
Posts: 5
Joined: Tue Aug 04, 2009 1:47 pm

Re: Changing the status of portA analog pins

Post 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.

Post Reply