各位大虾我是新手,我先搞的汇编,大家能告诉我怎么控制io口的复用问题么,我用汇编搞了个程序用按键扫描控制亮灯但是不知道为啥没反应
#INCLUDE "C:\Program files\microchip\mpasm suite\p16F917.inc"
__config _XT_OSC & _WDT_OFF
clrf PORTB
BANKSEL TRISB
clrf TRISB
movlw B'00010000'
movwf TRISA
movlw H'07'
movwf ADCON1
BANKSEL PORTA
Loop btfss PORTA,4
goto On
Off movlw B'00000010'
movwf PORTB
goto Loop
On movlw B'00001000'
movwf PORTB
goto Loop
Here goto Here
END |