Sean_Goddard
- 26th June 2007, 22:33
I've read through the help files and the manual anad I'm SURE it can be done but I just cant seem to find out how. I'm confusing PICBASIC with VHDL in that what I want to do is this;
I have 2 INPUT pins on a PIC which are pulled high, these then go to a switch which can pull EITHER bit of low, so the truth table is;
BIT A BIT B Port "MODE"
0 1 1
1 0 2
1 1 3
What I want to be able to do is define MODE as two bits of a port so that I can use it as a variable to defire a series of CASE statement to select an option and thence jump to a subroutine.
It's a cheap way of getting 3 funtions out of two pins. Anyone any ideas how I can do this. I guess the VHL instatiation would be sort of MODE=PORTA[0 TO 1] or something like that, but HOW to do it in PB??
I have 2 INPUT pins on a PIC which are pulled high, these then go to a switch which can pull EITHER bit of low, so the truth table is;
BIT A BIT B Port "MODE"
0 1 1
1 0 2
1 1 3
What I want to be able to do is define MODE as two bits of a port so that I can use it as a variable to defire a series of CASE statement to select an option and thence jump to a subroutine.
It's a cheap way of getting 3 funtions out of two pins. Anyone any ideas how I can do this. I guess the VHL instatiation would be sort of MODE=PORTA[0 TO 1] or something like that, but HOW to do it in PB??