0% found this document useful (0 votes)
42 views1 page

Java Printing

This document contains assembly code that blinks two LEDs connected to Port E pins 1 and 2 of a PIC18F452 microcontroller. It configures the oscillator and watchdog timer, clears Port E, sets up Timer 0 to generate an interrupt every 1ms, and makes the LED pins outputs. The main loop toggles each LED pin and calls a delay subroutine between each toggle. The delay subroutine loads Timer 0, enables it to count down, waits for the interrupt flag to be set, then disables Timer 0 before returning. This causes each LED to blink on and off with a 1ms period, resulting in the two LEDs blinking alternately.

Uploaded by

SamuelClement
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views1 page

Java Printing

This document contains assembly code that blinks two LEDs connected to Port E pins 1 and 2 of a PIC18F452 microcontroller. It configures the oscillator and watchdog timer, clears Port E, sets up Timer 0 to generate an interrupt every 1ms, and makes the LED pins outputs. The main loop toggles each LED pin and calls a delay subroutine between each toggle. The delay subroutine loads Timer 0, enables it to count down, waits for the interrupt flag to be set, then disables Timer 0 before returning. This causes each LED to blink on and off with a 1ms period, resulting in the two LEDs blinking alternately.

Uploaded by

SamuelClement
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

C:/Users/lenovo/MPLABXProjects/TANMAY.X/newAsmTemplate123.

asm
LIST P=PIC18F452
#INCLUDE<P18F452.INC>
CONFIG OSC=HS, OSCS=OFF
CONFIG WDT=OFF
CONFIG DEBUG=OFF, LVP=OFF
ORG 0
CLRF PORTE
MOVLW 07H
MOVWF T0CON
MOVLW 0FH
MOVWF ADCON1
BCF TRISE, RE1
BCF TRISE, RE2
LOOPA

BTG PORTE,1
CALL DELAY
BTG PORTE,2
CALL DELAY
BTG PORTE,1
CALL DELAY
BTG PORTE,2
CALL DELAY
BRA LOOPA

DELAY

MOVLW 67H
MOVWF TMR0H
MOVLW 69H
MOVWF TMR0L
BCF INTCON,TMR0IF
BSF T0CON,TMR0ON

OVER

BTFSS INTCON,TMR0IF
BRA OVER
BCF T0CON,TMR0ON
RETURN
END

1.1 of 1

2014.12.03 12:24:19

You might also like