As I understand it, you should do adcon1=7 to make all analog pins digital. Thats how I do it. ports a and e are both affected by adcon1 reg and adcon1 = 7 will make port a digital so it should make both digital.
Travin
As I understand it, you should do adcon1=7 to make all analog pins digital. Thats how I do it. ports a and e are both affected by adcon1 reg and adcon1 = 7 will make port a digital so it should make both digital.
Travin
Thanks Travin.
So, I should be safe using ADCON1=7 annd no strange behavior from the analog IOs?
Regards,
Nick
Pin a.4 is an open drain. Read page 11 in the PBP manual if you intend on using that pin as an output.
Travin
I'm using this code and I do not get any action from Pin 7 (RA5).
I know about Pin 6 (RA4 open collector output)
ADCON1=7
CMCON=7
main:
Toggle PORTA.0
Pause 300
Toggle PORTA.1
Pause 300
Toggle PORTA.2
Pause 300
Toggle PORTA.3
Pause 300
Toggle PORTA.4
Pause 300
Toggle PORTA.5
GoTo main
End
Am I missing something?
Regards,
Nick
Is that your entire code. You might want to try and establish a know condition of the pins at the beggining. What osc are you using?
cmcon=7
adcon1=7
trisa = %00000000 ' makes them outputs
porta = %11111111 ' makes them high
main:
Toggle PORTA.0
Pause 300
Toggle PORTA.1
Pause 300
Toggle PORTA.2
Pause 300
Toggle PORTA.3
Pause 300
Toggle PORTA.4
Pause 300
Toggle PORTA.5
GoTo main
End
Last edited by Travin77; - 29th May 2006 at 00:10.
The code is only for testing A port.
Am I wrong assuming that ADCON1=7 takes care only of A0-3 ports?
Should I extend it to ADCON1=15 or ADCON1=31 to cover higher bits?
Regards,
Nick
Adcon1 should set all of port a to digital. Is there a good conection on porta.5?
Yes, connection is good, it just does not toggle.
I used ADCON1=15 and the port A5 works(?!?!?!?!).
With ADCON1=7 it does not work.
All other A ports work in both cases.
What about CVRCON register?
Nick
Bookmarks