I'm very new to working with microcontrollers, I only started using them properly within the last week.
I'm using the PIC16F684 in conjunction with MPLAB and PIC C.
One of my pins on the PIC chip is connected to the output from an encoder. The output from the encoder will always be either 5 V or 0 V, it will never be high impedence.
When power is applied to my circuit and the microcontroller boots up, I need to make sure that the pins are all high impedence, because if any of them are high or low then I'll have a short circuit leading to the encoder.
Does anyone know how to ensure that all the pins on the 16F684 will be high impedence initially?
My pin layout for the PIC16F684 is:
C0 thru C5: Output to LED's
A0: Output to LED
A1 thru A3: Input from Encoder
A4: Output to the clock input of a shift register
A5: Output to a Piezo speaker
Basically I want to use all 12 pins, I don't want them to be set to anything like A/D convertors or clock inputs. Does anyone know what __CONFIG parameters I need to achieve this?
Basically I want either:
1) All pins are high impedence at the start, and then my code in main sets them as per my specifications above. 2) All pins are set the way I want them when the chip boots up by using __CONFIG parameters (I don't even know if this is possible).Also, does anyone know how long it takes for the PIC16F684 to boot up and actually start executing instructions? I've been told that it executes its first instruction about 20 milliseconds after power is applied; does this sound about right? Also does anyone know how long it takes for the pin voltage to change once the machine instruction has been executed?