Hippogriff
Member
Hi,
I have one of those switches with I / O / II on it, where the switch can be off or on or on again. I wanted to use this switch as a startup mode selector for a PIC... either the PIC is off, easy enough... or the PIC is on in mode 1 or on in mode 2, depending on which switch output it gets power from. At startup I could check which on it is and act accordingly.
I figured - wrongly - that what I would do is wire up each of the switch outputs (I and II) to the VDD pin of the PIC and then 'split' or 'double' the output of the II switch output into pin A5 of the PIC, which I'd set to be an input and, at startup, I'd do a quick boolean check - if that pin is low or high, then go into the program mode I want.
Obviously - now that I think about it - the A5 pin is high all the time that either I or II is selected on the switch because the PIC is always getting 5V on its VDD pin and the electrons will run down the wire coming from I into VDD but back up the wire leading to II on the switch and then back down to VDD on the PIC but also down the 'split' wire coming from II on the switch into A5 on the PIC.
Yes, I think that makes sense... so pin A5 on the PIC always sees high if I or II is selected.
Is there a way I can make this work?
I think this is basic stuff, I apologise... I'm much more of a programmer than I am an electronician.
I have one of those switches with I / O / II on it, where the switch can be off or on or on again. I wanted to use this switch as a startup mode selector for a PIC... either the PIC is off, easy enough... or the PIC is on in mode 1 or on in mode 2, depending on which switch output it gets power from. At startup I could check which on it is and act accordingly.
I figured - wrongly - that what I would do is wire up each of the switch outputs (I and II) to the VDD pin of the PIC and then 'split' or 'double' the output of the II switch output into pin A5 of the PIC, which I'd set to be an input and, at startup, I'd do a quick boolean check - if that pin is low or high, then go into the program mode I want.
Obviously - now that I think about it - the A5 pin is high all the time that either I or II is selected on the switch because the PIC is always getting 5V on its VDD pin and the electrons will run down the wire coming from I into VDD but back up the wire leading to II on the switch and then back down to VDD on the PIC but also down the 'split' wire coming from II on the switch into A5 on the PIC.
Yes, I think that makes sense... so pin A5 on the PIC always sees high if I or II is selected.
Is there a way I can make this work?
I think this is basic stuff, I apologise... I'm much more of a programmer than I am an electronician.