Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 13th August 2004, 06:35 PM   (permalink)
Default Some input pins not working?

Hey,
I have 4 input pins, pin0-pin3. The physical circuit is setup the same way for each pin but I can't use them interchangeably. Pins 2 and 3 work fine; 0 and 1 don't. I believe it's because the comparator could be set? Or something like that? I've looked through the datasheet but everything looks disabled. The only initilization I have is as follows:
Quote:
bsf STATUS, RP0 ;changes banks
movlw b'00001111' ;0-4inputs 5,6outputs
movwf TRISIO ;setting input/output (1=input)
bcf STATUS, RP0 ;changes banks

movlw b'00000000' ;
movwf GPIO ;setting high/low (1=high)
Thanks
Thorpydo is offline  
Old 13th August 2004, 06:43 PM   (permalink)
Default

Yes, they're the comparator pins.

Add the following lines of code to the top of your program

BANKSEL CMCON
MOVLW .7
MOVWF CMCON
Exo is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:06 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker