; The objective of this program is to display a static message over a 8X4 LED matrix ; PORTC will increment each colum incredibly fast while port b will handle the rows in the matrix ; Initialy this program will be static #include __config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF) org 0 COUNT equ 0x20 DISPLAY equ 0x21 PORTS: bsf STATUS,RP0 ; select Register Page 1 movlw 0x00 ; Move the hex value of 0 to multi purpose register W movwf TRISC ; make IO PortC all output movlw 0x00 movwf TRISB bcf STATUS,RP0 movlw 0x01 movwf DISPLAY clrf COUNT MAIN: movf COUNT,0 call TABLE movwf PORTB call ROTATE movfw DISPLAY movwf PORTC incf COUNT,1 movlw 0x08 subwf COUNT,0 btfsc STATUS,2 clrf COUNT goto MAIN ROTATE: rlf DISPLAY,f ; Rotate left btfss STATUS,0 ; Check the carry bit return clrf PORTC return TABLE: addwf PCL retlw b'1000' retlw b'0100' retlw b'0010' retlw b'0001' retlw b'0010' retlw b'0100' retlw b'1000' retlw b'0100' return end