Baseline PIC Assembler, Lesson 2: Flash an LED Page 9
In lesson 1, we made GP1 high, and left it that way. To make it flash, we need to set it high, then low, and then repeat. You may think that you could achieve this with something like:
flash
movlw b'000010' ; set GP1 high
movwf GPIO
movlw b'000000' ; set GP1 low
movwf GPIO
goto flash ; repeat forever
In lesson 1, we made GP1 high, and left it that way. To make it flash, we need to set it high, then low, and then repeat. You may think that you could achieve this with something like:
flash
movlw b'000010' ; set GP1 high
movwf GPIO
movlw b'000000' ; set GP1 low
movwf GPIO
goto flash ; repeat forever