PDA

View Full Version : Pic16f628 Port Config



actionplus
- 3rd December 2006, 00:07
I have a question on configuring the ports on this PIC. Well, mainly just a port, which is PORTB.5. I would like to use this port as analog input.

I delcared

TRISB = %00000100

and then tried to compile with the Pic Basic Pro but keep getting error with a ADCON0.

Can someone help me with this?

Thanks

keithdoxey
- 3rd December 2006, 00:30
I have a question on configuring the ports on this PIC. Well, mainly just a port, which is PORTB.5. I would like to use this port as analog input.

I delcared

TRISB = %00000100

and then tried to compile with the Pic Basic Pro but keep getting error with a ADCON0.

Can someone help me with this?

Thanks

1. Your Declaration for TRISB shows PortB.2 as an input

2. The only analogue feature on a 628 is the analogue comparators on PortA

Suggest you study the datasheet a bit further.