tuta4 microcontrollers and electronics,
DESCRIPTION
microcontrollers and electronics,MCU Unit,beginners course,TRANSCRIPT
![Page 1: TUTA4 microcontrollers and electronics,](https://reader036.vdocuments.mx/reader036/viewer/2022071804/563db8b0550346aa9a960a7d/html5/thumbnails/1.jpg)
; TUTA4.ASM 11MAR02
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; Configuration data ; PICmicro MCU type: 16F84; Oscillator: RC mode, slow, VR1 fully clockwise (max.rate); LCD display: off ; 7-segment display: off; Version 2 board settings: J14 links: Digital ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ;; The following line embeds configuration data into the PICmicro
__CONFIG H'3FFB' ; RC mode;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
; using aliases, bit names and conditional loops
#DEFINE PAGE0 BCF STATUS,5#DEFINE PAGE1 BSF STATUS,5
STATUS EQU H'03' ; STATUS registerTRISB EQU H'86' ; Port B direction registerPORTB EQU H'06' ; Port B data registerW EQU 0 ; Working register flagF EQU 1 ; File register flagC EQU 0 ; Carry flag
ORG 0 ; Reset vectorGOTO 5 ; Goto start of programORG 4 ; Interrupt vectorGOTO 5 ; Goto start of programORG 5 ; Start of program memory
CLRF PORTB ; clear Port B data registerPAGE1 ; PAGE1CLRF TRISB ; Port B direction register for
outputPAGE0 ; PAGE0
LOOP1 MOVLW 1 ; load value of 1 into Working register
MOVWF PORTB ; load this value as data into Port B
BCF STATUS,C ; clear Carry flag
LOOP2 RLF PORTB,F ; rotate value of PORTB left by 1 logical place
BTFSS STATUS,C ; check Carry flag is setGOTO LOOP2 ; this command is actioned only
if PORTB is not yet 0; the program jumping back to
address LOOP2GOTO LOOP1 ; this command is only actioned
when PORTB now = 0
END ; final statement