Professional Documents
Culture Documents
TMP - 30707-LED BLINKING-1660618927
TMP - 30707-LED BLINKING-1660618927
Group No. 1
Members:
Aseron, Julio Gabriel
Barredo, Winnie Pearl
Bueza, Diana Rose
Cabuhat, Joyce
TITLE
SCORE
ECE 09L
DATE:
July 15, 2014
Activity No.
1
Q. 1 Encode the following source code on MPLAB, run the simulations and observe.
list
p=16F84A
#include <p16F84a.inc>
;*****VARIABLE DEFINITIONS***************************************
w_temp
EQU
0x0C
status_temp
EQU
0x0D
;**********************************************************************
MAIN_PROGRAM CODE
CBLOCK 0X20
COUNT1
COUNTA
COUNTB
ENDC
ORG 0X0000
BSF STATUS,RP0
MOVLW B'00000000'
MOVWF TRISB
BCF STATUS,RP0
CLRF PORTB
START
MOVLW B'11111111'
MOVWF PORTB
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
MOVLW B'00000000'
MOVWF PORTB
CALL DELAY
CALL DELAY
CALL DELAY
CALL DELAY
GOTO START
DELAY
DECFSZ COUNT1,1
GOTO DELAY
DECFSZ COUNTA,1
GOTO DELAY
RETURN
END
Q.2 Using the watch window, what happened to the output of PORTB?
Using the watch window, the output value of PORTB which is 11111111 does not
change.
Q.3 To see detail what happen to PORTA, PORTB and other register, go to Debug>watch
window and add the register that you want to watch. Explain your observation.
PORT A 0001000
PORT B 1111111
Q.4 Replace TRISB with TRISA, what happen? How about replacing TRISB with TRISA and
replacing PORTB with PORTA?
Nothing happens in replacing both TRISB with TRISA vice versa, and PORTB with
PORTA.
Q.5 DELAY instruction is used to delay the output of the microprocessor, what happens if all the
DELAY instruction is removed or reduced?
If all DELAY instruction is removed or reduced, the led blinks faster.
Q.6 Simulate the program in PROTEUS and draw the circuit below.