Noman Yousaf
Full Member level 4
- Joined
- Nov 19, 2003
- Messages
- 208
- Helped
- 3
- Reputation
- 6
- Reaction score
- 2
- Trophy points
- 1,298
- Location
- Lahore Pakistan
- Activity points
- 1,763
i m using MPLAB 8.85.
can anybody tell me that how can i use or change the state of ports my self? is that possible or not.
i just wrote a program to turn on an led by making a port hi but when i make the port line hi, in "SFR register" window it goes lo itself without any action. i m sending the code and screen short of the mplab screen.
SOFTWARE IS AS FOLLOWS.
can anybody tell me that how can i use or change the state of ports my self? is that possible or not.
i just wrote a program to turn on an led by making a port hi but when i make the port line hi, in "SFR register" window it goes lo itself without any action. i m sending the code and screen short of the mplab screen.
SOFTWARE IS AS FOLLOWS.
Code ASM - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 LIST P=PIC16F676 PROCESSOR 16F676 #include "P16F676.INC" __CONFIG _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT ;THIS IS SIMPLE SOFTWARE TO TURN ON THE LED (PORTC,0)BY CHANGING THE PORTA,5 ORG 0 IN_SW EQU 5 ;PORTA,5 AS INPUT LED EQU 0 ;PORTC,0 OUTPUT BSF STATUS,RP0 ;SELECT BANK1 CLRF TRISC ;MAKE PORTC OUTPUT MOVLW 0FFH ;MAKE WREG 0FFH MOVWF TRISA ;MAKE PORTA INPUT CLRF ANSEL ;MAKE ALL ADC LINES AS DIGITAL INPUT BCF STATUS,RP0 ;SELECT BANK0 MAIN BTFSS PORTA,IN_SW GOTO MN1 BSF PORTC,LED GOTO MAIN MN1 BCF PORTC,LED GOTO MAIN END
Last edited by a moderator: