Hi guys. I have a project named Smart Fluorescent Lamp Control Using Computer Based.
I want to use PIC16F877A as the microcontroller (using assembly language) and use VB6 as the GUI interface.
1st, I want to use LED before do the wiring for fluorescent lamp.
Below is the written assembly code:
What code or instruction I have to add/change if I want to trigger the switch(PORTA) to turn on the LED(PORTB) through VB6?
I'm very new to assembly language, VB and also actual wiring. >.<
I want to use PIC16F877A as the microcontroller (using assembly language) and use VB6 as the GUI interface.
1st, I want to use LED before do the wiring for fluorescent lamp.
Below is the written assembly code:
Code:
#INCLUDE <P16F877A.INC>
__CONFIG 0X3F32
TRISA EQU 85H
TRISB EQU 86H
PORTA EQU 05H
PORTB EQU 06H
BSF 03h,5 ;go to bank1
MOVLW b'00000001' ;set bit number 0 as input (switch)
MOVWF TRISA
MOVLW b'00000000' ;all bits as output (LED)
MOVWF TRISB
BCF 03h,5 ;back to bank0
CLEAR:
CLRF PORTB ;clear signal for portB output
SWITCH:
BTFSS PORTA,0 ;test portA bit 0
GOTO CLEAR ;this instruction skipped if PORTA switch is pressed
MOVLW b'00000001' ;send signal to PORTB (LED)
MOVWF PORTB
GOTO SWITCH
END
I'm very new to assembly language, VB and also actual wiring. >.<
Last edited by a moderator: