The pic16f84 processor is then placed into the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NITION EQU EQU EQU EQU EQU EQU .0 .1 .2 .3 .4 .5 ; STATUS MAIN ROUTINE 0 STATUS,RP0 B'00001111' TRISA B'00000000' TRISB STATUS,RP0 PORTB BTFSC PORTA,0 BCF PORTB,0 BTFSS PORTA,0 BSF GOTO END PORTB,0 LOOP Table1. Assembly Code for LED Control Program The Assembly code is written to the PIC16F84 using the ROM writer linked to the PC. The PIC16F84 processor is then placed into the breadboard. Make sure that the LEDs glow when the switch is ‘closed’. If not, examine that the fault is in the program code or in the circuit. After debugging, check again if the LEDs are turned on. Figure 5.1.1 LED Control Program Circuit Diagram 5.2. Digital Dice Exercise 2: Before implementing a digital dice, do a simple example that displays a given number on the 7-segment LEDs when the switch is ON (for example, 0 is displayed when the switch is ‘open’ and 1 when the switch is ‘closed’). The following is an example code for this exercise (file extension: **.asm) . Consulting this code, write an Assembly code for the exercise (MAIN ROUTINE in the example code is particularly important. Make sure to fully understand the logic in this part). ; Program code for the experiment 2 ; Originally made and tested by Jane Kang ; 2006.6.11 ; LIST P=16F84 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;FILE DEFINITION;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IN...
View Full Document

Ask a homework question - tutors are online