PIC lights on, Assembly Language

errorlevel -302 ;prevents error code for this chipset
__config 0x373A ;chip config PIC spec page 146
processor 16F877A ;chipset

reset code 0x00
pagesel start ;Chooses pages from goto
nop ;does nothing
goto start

code ;LABEL
start ;Label
clrf STATUS ;clear status from regester(Z is in status regester)
clrf PORTA ;clear port A
clrf PORTB ;clear port B
movlw 0x03 ;move literal into w
movwf PORTA ;move w into f

bsf STATUS, RP0 ;bit set f status, Regestry bank 0
movlw 0x07 ;move literal into w
movwf ADCON1
clrf TRISA ;clear register TriState regestry port A
clrf TRISB ;clear register TriState regestry port B
clrf TRISD ;clear register TriState regestry port D

loop ;Start a Loop function
call LCD_update ;Calls LCD_Update function
call delay ;Calls delay function for time
goto loop ;Returns to loop

LCD_update_code code ;LAbEL
LCD_update ;LABEL

sw1 btfsc PORTB, 1
goto display1
btfsc PORTB, 0
goto display2
bcf PORTB, 0x01 ;turn Off LED 2
movlw 0xF9 ;Set number 1
movwf PORTD ;move w to f set PORTD
bsf PORTB, 0x00 ;turn On LED 1
goto finish_display

sw2 btfsc PORTB, 0
goto display2
btfsc PORTB, 1
goto display3
bcf PORTB, 0x00 ;turn off LED
movlw 0x24 ;Set number 2
movwf PORTD
bsf PORTB, 0x01 ;turn on LED 2
goto finish_display

sw3 btfsc PORTB, 1
goto display3
btfsc PORTB, 0
goto display4
bcf PORTB, 0x04 ;turn off LED 4
movlw 0x30 ;Set number 3
movwf PORTD
bsf PORTB, 0x02 ;turn on LED 3
goto finish_display

sw4 btfsc PORTB, 0
goto display3
btfsc PORTB, 1
goto finish_display
bcf PORTB, 0x02 ;turn off LED 3
movlw 0x8D ;Set number 4
movwf PORTD
bsf PORTB, 0x04 ;turn on LED 4
goto finish_display


;Variables for delay function

delay_udata udata ;LABEL
x res 2 ;x reserves 2 bytes

.delay code
banksel x
clrf x
movlw 20
movwf x + 1
decfsz x, 1
goto $-1
decfsz x + 1, 1
goto $-3

Posted Date: 10/17/2012 11:31:42 AM | Location : United States

Related Discussions:- PIC lights on, Assignment Help, Ask Question on PIC lights on, Get Answer, Expert's Help, PIC lights on Discussions

Write discussion on PIC lights on
Your posts are moderated
Related Questions
i want to develop traffic light system so which kind of software is needed to develop this project?

Format of Control Register The format for the control register is given in Figure. Bit 0 of this register might be one before data may be output  and  bit  two  might be  one

Intel 8259 interrupt controller :  The 8088 processor has only two interrupt control inputs, and interrupt request (INTR) and non mask able interrupt (NMI). NMI are interrupts t

Will be needing help with assembly language assignments over the course of 4 weeks

You will need to upload your main.c and factorial.s files and a .jpg photo of the output on your board using the Vista assignment upload features.  It must be submitted by the dead

I am running a small minecraft server off of my old mac mini, and am having a big issue. My computer isn''t very good, and even just running this server is an issue. I use a comma

NASM assembly language program: Consider a sequence of 19 strictly positive decimal digits, most likely stored in an array. There are obviously duplicates, and the sequence is un

MLIL: Unsigned Multiplication Byte or Word: This instruction multiplies an unsigned byte or word by the contents of the AL. The unsigned byte or word can be in any one of the gene

The processor 8088 The launching of the processor 8086 is consider as a remarkable step in the development of high speed computing machines. Before the introduction  of 8086 mo