Hello all,
I am running into a issue which I can not seem to solve. In migration from PIC16K690 to PIC18F26K22 I am not able to have my inputs function correctly(meaning I have no input functionality at all). Lets say for example I am using PORTA RA1 as my pin here. Now I have set my ansela to "clrf ansela" and have turned off my comparators in cm1con0 and cm2con0. I have set my trisa to 1 for RA1. When tested this pin works as an output when set up as such, so I know the pin is operable. There are no other peripherals on this pin as per the data sheet. I then had written a short piece of code:
btfss porta, ra1
goto $-2 ;for pic18 move back one line
btg latb, rb5 ;I am using this pin as my output to test.
goto $
I have a switch connected to RA1 and checked to make sure I met the voltage requirements for the pin to go high.
I can not figure out why this is not working. Please note this is the first time that I have used inputs on this new to me chip. I have never had problems getting an input to function properly.
Could anyone help me to see what I could have missed? This seems pretty basic but I am embarrassed that I cant get this to work.
Thank you in advance for you suggestions.
Peaches
I am running into a issue which I can not seem to solve. In migration from PIC16K690 to PIC18F26K22 I am not able to have my inputs function correctly(meaning I have no input functionality at all). Lets say for example I am using PORTA RA1 as my pin here. Now I have set my ansela to "clrf ansela" and have turned off my comparators in cm1con0 and cm2con0. I have set my trisa to 1 for RA1. When tested this pin works as an output when set up as such, so I know the pin is operable. There are no other peripherals on this pin as per the data sheet. I then had written a short piece of code:
btfss porta, ra1
goto $-2 ;for pic18 move back one line
btg latb, rb5 ;I am using this pin as my output to test.
goto $
I have a switch connected to RA1 and checked to make sure I met the voltage requirements for the pin to go high.
I can not figure out why this is not working. Please note this is the first time that I have used inputs on this new to me chip. I have never had problems getting an input to function properly.
Could anyone help me to see what I could have missed? This seems pretty basic but I am embarrassed that I cant get this to work.
Thank you in advance for you suggestions.
Peaches