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
Changing the status of portA analog pins
Moderator: Benj
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
dpasternack
- Posts: 5
- Joined: Tue Aug 04, 2009 1:47 pm
Re: Changing the status of portA analog pins
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.