Hi Friends,
It gives me pleasure that with the help of 'talkingelectronics' also experts of this forum I have been able to build a moving display. But when I try to display and move a big message, a problem is faced. The entire message does not display, rather it stops to a certain point and restarts from the beginning of the message. I think this is due to limitation of Program Counter. Searching internet for some tips on PCL, PCLATH and Big Lookup table I could not grasp any conception as to how big lookup tables could be handled. I am giving the code with the hope to have some expertise advice from forum members.
regards
swapan
It gives me pleasure that with the help of 'talkingelectronics' also experts of this forum I have been able to build a moving display. But when I try to display and move a big message, a problem is faced. The entire message does not display, rather it stops to a certain point and restarts from the beginning of the message. I think this is due to limitation of Program Counter. Searching internet for some tips on PCL, PCLATH and Big Lookup table I could not grasp any conception as to how big lookup tables could be handled. I am giving the code with the hope to have some expertise advice from forum members.
regards
swapan
Code:
list p=16f72 ; list directive to define processor
#include <p16f72.inc> ; processor specific variable definitions
__CONFIG _CP_ALL & _WDTEN_OFF & _BODEN_ON & _PWRTEN_ON & _HS_OSC
errorlevel -203, -205, -302,
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The labels following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;***** VARIABLE DEFINITIONS (examples)
; example of using Uninitialized Data Section
cblock 0x20
jump_value
view_count
col_1
col_2
col_3
col_4
col_5
col_6
col_7
col_8
col_9
col_10
col_11
col_12
col_13
col_14
col_15
col_16
col_17
col_18
col_19
col_20
col_21
col_22
col_23
col_24
col_25
col_26
col_27
col_28
col_29
col_30
col_31
col_32
view_count_1
view_count_2
count1
count2
count3
; variable used for context saving
endc
;**********************************************************************
RESET_VECTOR CODE 0x0000 ; processor reset vector
goto start ; go to beginning of program
INT_VECTOR CODE 0x0004 ; interrupt vector location
MAIN_PROG CODE
start
bsf STATUS,RP0
movlw 00h
movwf TRISA
movlw 00h
movwf TRISB
movlw 00h
movwf TRISC
movlw 06h
movwf ADCON1
movlw b'10000111'
movwf OPTION_REG
bcf STATUS,RP0
;;;;;;;;;;;
clrf PORTB
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Run_1:
clrf col_1
clrf col_2
clrf col_3
clrf col_4
clrf col_5
clrf col_6
clrf col_7
clrf col_8
clrf col_9
clrf col_10
clrf col_11
clrf col_12
clrf col_13
clrf col_14
clrf col_15
clrf col_16
clrf col_17
clrf col_18
clrf col_19
clrf col_20
clrf col_21
clrf col_22
clrf col_23
clrf col_24
clrf col_25
clrf col_26
clrf col_27
clrf col_28
clrf col_29
clrf col_30
clrf col_31
clrf col_32
clrf jump_value
Run_2:
movlw d'40'
movwf view_count
call shift
incf jump_value,1
movf jump_value,0
call table
movwf col_1
xorlw 0FFh
btfsc status,z
goto Run_1
Run_3:
decfsz view_count,1
goto Run_4
goto Run_2
Run_4:
call scan
goto Run_3
shift:
movf col_31,0
movwf col_32 ;32
movf col_30,0
movwf col_31 ;31
movf col_29,0
movwf col_30 ;30
movf col_28,0
movwf col_29 ;29
movf col_27,0
movwf col_28 ;28
movf col_26,0
movwf col_27 ;27
movf col_25,0
movwf col_26 ;26
movf col_24,0
movwf col_25 ;25
movf col_23,0
movwf col_24 ;24
movf col_22,0
movwf col_23 ;23
movf col_21,0
movwf col_22 ;22
movf col_20,0
movwf col_21 ;21
movf col_19,0
movwf col_20 ;20
movf col_18,0
movwf col_19 ;19
movf col_17,0
movwf col_18 ;18
movf col_16,0
movwf col_17 ;17
movf col_15,0
movwf col_16 ;16
movf col_14,0
movwf col_15 ;15
movf col_13,0
movwf col_14 ;14
movf col_12,0
movwf col_13 ;13
movf col_11,0
movwf col_12 ;12
movf col_10,0
movwf col_11 ;11
movf col_9,0
movwf col_10 ;10
movf col_8,0
movwf col_9 ;9
movf col_7,0
movwf col_8 ;8
movf col_6,0
movwf col_7 ;7
movf col_5,0
movwf col_6 ;6
movf col_4,0
movwf col_5 ;5
movf col_3,0
movwf col_4 ;4
movf col_2,0
movwf col_3 ;3
movf col_1,0
movwf col_2 ;2
return
scan:
bsf PORTA,0
bsf PORTC,3
nop
nop
bsf PORTA,1
nop
nop
bcf PORTA,1
bcf PORTC,3
movf col_32,0
movwf PORTB
call view_delay
movf col_31,0
movwf PORTB
call view_delay
movf col_30,0
movwf PORTB
call view_delay
movf col_29,0
movwf PORTB
call view_delay
movf col_28,0
movwf PORTB
call view_delay
movf col_27,0
movwf PORTB
call view_delay
movf col_26,0
movwf PORTB
call view_delay
movf col_25,0
movwf PORTB
call view_delay
movf col_24,0
movwf PORTB
call view_delay
movf col_23,0
movwf PORTB
call view_delay
movf col_22,0
movwf PORTB
call view_delay
movf col_21,0
movwf PORTB
call view_delay
movf col_20,0
movwf PORTB
call view_delay
movf col_19,0
movwf PORTB
call view_delay
movf col_18,0
movwf PORTB
call view_delay
movf col_17,0
movwf PORTB
call view_delay
movf col_16,0
movwf PORTB
call view_delay
movf col_15,0
movwf PORTB
call view_delay
movf col_14,0
movwf PORTB
call view_delay
movf col_13,0
movwf PORTB
call view_delay
movf col_12,0
movwf PORTB
call view_delay
movf col_11,0
movwf PORTB
call view_delay
movf col_10,0
movwf PORTB
call view_delay
movf col_9,0
movwf PORTB
call view_delay
movf col_8,0
movwf PORTB
call view_delay
movf col_7,0
movwf PORTB
call view_delay
movf col_6,0
movwf PORTB
call view_delay
movf col_5,0
movwf PORTB
call view_delay
movf col_4,0
movwf PORTB
call view_delay
movf col_3,0
movwf PORTB
call view_delay
movf col_2,0
movwf PORTB
call view_delay
movf col_1,0
movwf PORTB
call view_delay
bcf PORTA,0
nop
nop
bsf PORTA,0
return
view_delay:
call delay_2
clrf PORTB
bsf PORTA,1
nop
nop
bcf PORTA,1
return
delay_2:
movlw d'150'
movwf count2
decfsz count2,1
goto $-1
return
table:
addwf 02h,1
retlw 00h
retlw 1Fh ;
retlw 28h ;
retlw 48h ;
retlw 28h ;
retlw 1Fh ;
retlw 00h ; A
retlw 00h
retlw 00h
retlw 00h
retlw 3Eh ;
retlw 41h ;
retlw 41h ;
retlw 41h ;
retlw 22h ;
retlw 00h ; C
retlw 7Fh ;
retlw 48h ;
retlw 48h ;
retlw 48h ;
retlw 37h ;
retlw 00h ; R
retlw 7Fh ;
retlw 49h ;
retlw 49h ;
retlw 41h ;
retlw 00h ; E
retlw 1Fh ;
retlw 28h ;
retlw 48h ;
retlw 28h ;
retlw 1Fh ;
retlw 00h ; A
retlw 40h ;
retlw 40h ;
retlw 7Fh ;
retlw 40h ;
retlw 40h ;
retlw 00h ; T
retlw 00h ;
retlw 00h ;
retlw 7Fh ;
retlw 00h ;
retlw 00h ; I
retlw 3Eh ;
retlw 41h ;
retlw 41h ;
retlw 41h ;
retlw 3Eh ; O
retlw 00h ;
retlw 7Fh ;
retlw 10h ;
retlw 8h ;
retlw 4h ;
retlw 7Fh ;
retlw 00h ; N
retlw 00h
retlw 00h
retlw 00h
retlw 3Eh ;
retlw 41h ;
retlw 41h ;
retlw 41h ;
retlw 3Eh ; O
retlw 00h ;
retlw 7Fh ;
retlw 48h ;
retlw 48h ;
retlw 40h ;
retlw 00h ; F
retlw 00h
retlw 00h
retlw 00h
retlw 32h ;
retlw 49h ;
retlw 49h ;
retlw 49h ;
retlw 26h ;
retlw 00h ; S
retlw 7Fh ;
retlw 02h ;
retlw 04h ;
retlw 02h ;
retlw 7Fh ;
retlw 00h ; W
retlw 1Fh ;
retlw 28h ;
retlw 48h ;
retlw 28h ;
retlw 1Fh ;
retlw 00h ; A
retlw 7Fh ;
retlw 48h ;
retlw 48h ;
retlw 48h ;
retlw 30h ;
retlw 00h ; P
retlw 1Fh ;
retlw 28h ;
retlw 48h ;
retlw 28h ;
retlw 1Fh ;
retlw 00h ; A
retlw 7Fh ;
retlw 10h ;
retlw 8h ;
retlw 4h ;
retlw 7Fh ;
retlw 00h ; N
retlw 00h
retlw 00h
retlw 00h
retlw 00h
retlw 32h ;
retlw 49h ;
retlw 49h ;
retlw 49h ;
retlw 26h ;
retlw 00h ; S
retlw 1Fh ;
retlw 28h ;
retlw 48h ;
retlw 28h ;
retlw 1Fh ;
retlw 00h ; A
retlw 7Fh ;
retlw 48h ;
retlw 48h ;
retlw 48h ;
retlw 37h ;
retlw 00h ; R
retlw 7Fh ;
retlw 08h ;
retlw 14h ;
retlw 22h ;
retlw 41h ; K
retlw 00h
retlw 1Fh ;
retlw 28h ;
retlw 48h ;
retlw 28h ;
retlw 1Fh ;
retlw 00h ; A
retlw 7Fh ;
retlw 48h ;
retlw 48h ;
retlw 48h ;
retlw 37h ;
retlw 00h ; R
retlw 00h
retlw 00h
retlw 08h
retlw 2Ah
retlw 1Ch
retlw 7Fh
retlw 1Ch
retlw 2Ah
retlw 08h
retlw 00h
retlw 00h
retlw 00h
retlw 1Fh ;
retlw 28h ;
retlw 48h ;
retlw 28h ;
retlw 1Fh ;
retlw 00h ; A
retlw 7Fh ;
retlw 10h ;
retlw 8h ;
retlw 4h ;
retlw 7Fh ;
retlw 00h ; N
retlw 00h
retlw 00h
retlw 7Fh ;
retlw 49h ;
retlw 49h ;
retlw 41h ;
retlw 00h ; E
retlw 7Fh ;
retlw 01h ;
retlw 01h ;
retlw 01h ;
retlw 00h ; L
retlw 7Fh ;
retlw 49h ;
retlw 49h ;
retlw 41h ;
retlw 00h ; E
retlw 3Eh ;
retlw 41h ;
retlw 41h ;
retlw 41h ;
retlw 22h ;
retlw 00h ; C
retlw 40h ;
retlw 40h ;
retlw 7Fh ;
retlw 40h ;
retlw 40h ;
retlw 00h ; T
retlw 7Fh ;
retlw 48h ;
retlw 48h ;
retlw 48h ;
retlw 37h ;
retlw 00h ; R
retlw 3Eh ;
retlw 41h ;
retlw 41h ;
retlw 41h ;
retlw 3Eh ; O
retlw 00h ;
retlw 7Fh ;
retlw 10h ;
retlw 8h ;
retlw 4h ;
retlw 7Fh ;
retlw 00h ; N
retlw 7Fh ;
retlw 00h ; I
retlw 3Eh ;
retlw 41h ;
retlw 41h ;
retlw 41h ;
retlw 22h ;
retlw 00h ; C
retlw 32h ;
retlw 49h ;
retlw 49h ;
retlw 49h ;
retlw 26h ;
retlw 00h ; S
retlw 00h
retlw 00h
retlw 7Fh ;
retlw 08h ;
retlw 08h ;
retlw 08h ;
retlw 7Fh ;
retlw 00H ; H
retlw 3Eh ;
retlw 41h ;
retlw 41h ;
retlw 41h ;
retlw 3Eh ; O
retlw 00h ;
retlw 7Fh ;
retlw 49h ;
retlw 49h ;
retlw 49h ;
retlw 30h ;
retlw 00h ; B
retlw 7Fh ;
retlw 49h ;
retlw 49h ;
retlw 49h ;
retlw 30h ;
retlw 00h ; B
retlw 60h ;
retlw 10h ;
retlw 08h ;
retlw 10h ;
retlw 60h ;
retlw 00h ; Y
retlw 00h ;
retlw 00h ;
retlw 7Fh ;
retlw 00h ;
retlw 00h ; I
retlw 32h ;
retlw 49h ;
retlw 49h ;
retlw 49h ;
retlw 26h ;
retlw 00h ; S
retlw 40h ;
retlw 40h ;
retlw 7Fh ;
retlw 40h ;
retlw 40h ;
retlw 00h ; T
retlw 0FFh
END ; directive 'end of program'
Last edited by a moderator: