-
PORTA problems 18LF252
I am new to the forum and PBP.
I also have searched and tried some of the things listed here.
I am using PORTA with a dip switch but it dosent' seem to be working.
Here is what I got from the site
ADCON1 = %0111111 ' Disable AD Converters
TRISA = %0111111 ' PORTA all set to Input
IF PORTA.bit0 = 0 Then Map
Any help appreciated.
Ian
-
Welcome to the forum.
In your case, refer to datasheet section 17-2
if you set BIT3-0 as %1111... AN0 will be analog ;( not what you want i guess.
try ADCON1 = 7
-
Thanks! That worked. It also helped if I could design a board properly. Missed the fact that you have to pull up/down for the PIC to know where anything is at. :)