LIST P = 16F716 ;camera_4x4.asm ; ; 20 MHz = .2 ms/instruction ; ;****************************************************************************** ; INCLUDE __CONFIG _PWRTE_OFF & _HS_OSC & _WDT_OFF ; configuration switches ;DELA equ 0x7f ;DELA is the literal added to the f register ;*********************************************************************** ; ORG 0 ; bsf STATUS,RP0 ;select reg bank 1 movlw 0x0 ;0000 0000 movwf TRISA ;set PORTA to output movlw 0x0 ;0000 0000 movwf TRISB ;set PORTB to output bcf STATUS,RP0 ;select reg bank 0 ;movlw 0x01 ; movwf PORTB ;1 set PORTB.0 high ;This program simply turns on and off an LED connected to PORTB.0 ; pixel 0,0 TOP movlw 0x10 ;1 CLRF PORTA ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x01 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 0,1 movlw 0x10 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x02 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 0,2 movlw 0x10 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x04 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 0,3 movlw 0x10 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x08 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 1,0 movlw 0x10 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x10 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 1,1 movlw 0x10 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x20 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 1,2 movlw 0x10 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x40 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 1,3 movlw 0x10 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x80 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 2,0 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x01 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 2,1 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x02 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 2,2 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x04 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 2,3 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x08 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 3,0 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x10 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 3,1 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x20 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 3,2 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x40 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; pixel 3,3 movlw 0x11 ;1 movwf PORTA ;1 set 4-16 addr PORTA movlw 0x80 ;1 movwf PORTB ;1 set 8-bit data PORTB bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bcf PORTA,4 ;1 bsf PORTA,4 ;1 ; goto TOP ;2 END