Re: Can't make RA1 a digital Input on (10 out of 20) 16F887.
This is your code tweaked for a PIC16F690, and it works:
Code:
#CONFIG
__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BOR_OFF & _FCMEN_OFF & _IESO_OFF
;__config _CONFIG2, _WRT_OFF & _BOR40V
#ENDCONFIG
DEFINE OSC 20
ANSEL = 0
ANSELH = 0
ADCON0 = 0
ADCON1 = 0
CM1CON0 = 0
CM2CON0 = 0
CM2CON1 = 0
CCP1CON = 0
;CCP2CON = 0
portb=0
portc=0
porta=0
TRISA = %00000010
TRISB = 0
TRISC = 0
;TRISD = 0
;TRISE = 0
Startup:
LOW PORTA.0
PAUSE 250
HIGH PORTA.0
PAUSE 250
IF PORTA.1 = 0 THEN
LOW PORTc.1
ELSE
HIGH PORTc.1
ENDIF
GOTO Startup
The registers a 690 does not have have been commented out. You will need a pull up on your input pin.
Sorry I don't have an 887 to test upon.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks