Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/25/08 15:21
Modified:
  11/25/08 15:24

Read: times


 
#160295 - where i get stucked!
Responding to: ???'s previous message
greetings!
i`m using an 8x8 led matrix display KingBright where i want to display 7 chracters in 5x7 with diferent effects moving the text,like fast,slow,stop,start and some grafic effects


in this code i display just one character "A" with fast,slow,start stop effects

ADR_INIT  EQU 40H
ADR_FIN   EQU 47H
PORT_COL  EQU 140H ; external port 2
PORT_ROW  EQU 120H ;external port 1

	ORG 8000H
	JMP MAIN
	ORG 800BH
	JMP TIMER0
	ORG 8023H
	JMP SERIAL

CONTOR2 DATA 33H	; CONTOR=COUNTER

BUFF	DATA 40H

	ORG 8100H
MAIN:  	MOV SP,#70H
	MOV IE,#92H    ;serial,timer0
;	MOV TMOD,#02H ;programming the timer

	CALL PRGSER ;programing the serial communication
 	MOV TH0,#00H
	MOV TL0,#00H
	MOV DPTR,#140H
	MOV A,#00h
	MOVX @DPTR,A
	MOV CONTOR2,#ADR_INIT
	CALL INIT_BUFF
	SETB TR0	
LOOP: 	NOP
	JMP LOOP

PRGSER: MOV TMOD,#22H
	MOV TH1,#0FDH
	SETB TR1
	MOV SCON,#5AH
	RET

INIT_BUFF:
	MOV 40H,#0FEH
	MOV 41H,#0FFH
	MOV 42H,#33H
	MOV 43H,#33H
	MOV 44H,#0FFH
	MOV 45H,#0FEH
	MOV 46H,#00H
	MOV 47H,#00H

SEL_COL: MOV 50H,#0FEH
	 MOV 51H,#0FDH
	 MOV 52H,#0FBH
	 MOV 53H,#0F7H
	 MOV 54H,#0EFH
	 MOV 55H,#0DFH
	 MOV 56H,#0BFH
	 MOV 57H,#7FH
	
	RET

TIMER0:  
	CALL CDA_LED

SF1:	RETI


CDA_LED:	
	MOV	A,#00H			;SWITCH OFF
	MOV 	DPTR,#PORT_ROW
	MOVX	@DPTR,A

	MOV	A,#00H			;SWITCH OFF
	MOV 	DPTR,#PORT_COL
	MOVX	@DPTR,A

	MOV 	R0,CONTOR2		;  R0 FOR  CODE ROW
	MOV	A,R0
	ADD	A,#10H
	MOV 	R1,A			; PREG R1 PT SELECTIE COLOANA

	MOV	A,@R1			; SEND CODE SEL COL
	MOV	DPTR,#PORT_COL
	MOVX	@DPTR,A

	MOV	A,@R0			; SEND CODE CONFIG ROW
	MOV	DPTR,#PORT_ROW
	MOVX	@DPTR,A

	INC	CONTOR2
	MOV	A,CONTOR2
	CJNE	A,#ADR_FIN+1,SF2
	MOV 	CONTOR2,#ADR_INIT

SF2:	RET

SERIAL:		JB TI,SF
RECEPTION: 	MOV A,SBUF         ;reading the  character
		CJNE A,#53H,CONTI1 ;  S
START:		SETB TR0
		JMP SF
CONTI1:		CJNE A,#54H,CONTI2 ; character T
STOP:		CLR TR0
		JMP SF
CONTI2:		CJNE A,#46H,CONTI3 ; character F
FAST:		MOV CONTOR,#01H
		JMP SF
CONTI3:		CJNE A,#57H,CONTI4 ; character W
SLOW:		MOV CONTOR,#0FH
		JMP SF
CONTI4:		CJNE A,#41H,CONTI5 ; character A - switch on all the leds 
		MOV A,#0FFH
		MOV DPTR,#PORT_ROW
		MOVX @DPTR,A

		MOV A,#00H
		MOV DPTR,#PORT_COL
		MOVX @DPTR,A

		JMP SF
CONTI5:		CJNE A,#42H,SF 	   ; character B - switch of all the leds
		MOV A,#00H
		MOV DPTR,#PORT_ROW
		MOVX @DPTR,A

		MOV A,#00H
		MOV DPTR,#PORT_COL
		MOVX @DPTR,A

SF:		CLR RI
		CLR TI
		RETI
END



and here i get stucked...now i must insert somehow the rest of the characters in the buffer and multiplexing...i must to use another timer? any ideas?

regards,

List of 23 messages in thread
TopicAuthorDate
8x8 LED Matrix using 8051            01/01/70 00:00      
   What parts?            01/01/70 00:00      
      "sample code" ...            01/01/70 00:00      
   good luck with your product            01/01/70 00:00      
      i`m working on it            01/01/70 00:00      
         some idea about...            01/01/70 00:00      
            a few older posts dealing with the topic            01/01/70 00:00      
               thanx            01/01/70 00:00      
            How big is your display            01/01/70 00:00      
               it's good for a school project            01/01/70 00:00      
   where i get stucked!            01/01/70 00:00      
      multiplexing            01/01/70 00:00      
         But add a short delay while driving a single row            01/01/70 00:00      
            stucked again...            01/01/70 00:00      
               that has nothing to do with timer2            01/01/70 00:00      
                  what?            01/01/70 00:00      
                     It's called a circular buffer and has nothing to do with T2            01/01/70 00:00      
                        could you detail,please?            01/01/70 00:00      
                           Read about display interfaces            01/01/70 00:00      
                              Multiplexing - illustration            01/01/70 00:00      
                                 Speeded up...            01/01/70 00:00      
                                    That is an easy way to do it!            01/01/70 00:00      
      h            01/01/70 00:00      

Back to Subject List