??? 07/27/04 09:07 Read: times |
#74953 - RE: Need help with LED display Responding to: ???'s previous message |
hi,
i intend to use a 7x5 matrix for each charaster while the complete board will have at least 32 or 48 columns. Do you mean 32 or 48 characters when say columns? By other words, complete board will contain 160 or 240 columns, right? If so, I can suggest you to use Allegro LED drivers production. For example, 32-bit serial input latched drivers UCN5832 or UCN5833. For 32 characters you have to buy 32*5/32 = 5 devices. Outputs of these ICs should be connected to 160 columns of LED Dot Matrixes through resistors. As well, you need with 7 power source drivers which may be done with transistors. These source drivers provide power to seven rows of all matrixes. Now the idea is high speed refresh of your LED Dot Matrixes: you shift out 160 bits into UCN, switch off all transistors, strobe shifted data into output latches then switch on the first row. After some time, do the same for second row, then for third, etc upto seven. After all, start the cycle again from the first row. There is speed requirement: I suggest to keep refresh rate at 100Hz or above, i.e. you should run refresh routine at each 1/(7*100) =~1,5 ms. Shifting of 160 bits takes some time: REFRESH_DATA EQU 0x40 RSH_DAT EQU P1.0 RSH_CLK EQU P1.1 ; ... RSH_MATRIX: MOV R0,#REFRESH_DATA RSH_NEXT_BYTE: MOV A,@R0 MOV R7,#8 RSH_NEXT_BIT: CLR RSH_CLK RRC A MOV RSH_DAT,C SETB RSH_CLK DJNZ R7,RSH_NEXT_BIT INC R0 CJNE R0,#(REFRESH_DATA+20),RSH_NEXT_BYTEWith standard 8051 it takes above 1200 machive cycles. As result, with OSC=12MHz such refresh subroutine "eats" 1,2ms and, as result, you lost all productivity of MCU (no time to do something else). Solutions: - use crystal/oscillator with higher frequency; - use high productivity MCU (with x2 mode etc); - use UART at mode 0 (shift register) to shift out refresh data; - use external CPLD+RAM for refresh task; - use "parallel refresh". At last suggestion, I mean that you may replace each UCN5832 with four 6A595 (or TPIC6A595). As result, you will have 20 ICs. Then you group them to 4 streams with 5 chips in each. Now, refresh routine clocks out the nibble instead of bit: REFRESH_DATA EQU 0x40 RSH_OUT EQU P2 ; 4 bits are used RSH_CLK EQU P1.1 ; ... RSH_MATRIX: MOV R0,#REFRESH_DATA RSH_NEXT_BYTE: MOV A,@R0 CLR RSH_CLK MOV RSH_OUT,A SETB RSH_CLK SWAP A CLR RSH_CLK MOV RSH_OUT,A SETB RSH_CLK INC R0 CJNE R0,#(REFRESH_DATA+20),RSH_NEXT_BYTEThis routine takes about 220 machive cycles only. As well, you should think about power: each row contains 160 LEDs; each LED sink about 50mA (or more) in peak. So row current is about 8A. i have just completed reading the assembly language and instruction set of the 8052 Please, I need all the help i can get as i hope to complete this project within the next one month. One month? Good luck then. Schematic, PCB, programming... Regards, Oleg |