+ Post New Thread
Results 1 to 15 of 15
  1. #1
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    [8051] Matrix Moving Message Display.

    This is the circuit I have been given for reverse engineering.

    It has a 4 feet matrix display.

    It has other features like RS232 input, PS2 Keyboard input, HT1380 RTC, 24C64 EEPROM not shown in circuit.

    Now the issue is only with matrix display code writing. How should I approach ?

    The original board uses P89V51RD2 which is obsolete and the chip on board is defective. I am going to replace it by At89S52 as the code seems to fit in it (checked by creating 16x16 matrix font data for 100 charcaters, uses 1% of ROM)

    As rows are less, should I use row scanning ?

    That is place colums Data on columns and then turn on row 1 for a few ms and then turn off row 1
    then turn on row 2 for a few ms and turn it off
    continue like this till all 16 rows are scanned.

    Is there any better and efficient approach ?

    There are 12 HC595s. They are divided into 2 groups (6 + 6)

    How is data transferred to it ?

    Data to each 6x HC595 blocks gets transferred at the same time using same SH_CP and ST_CP ? I guess, yes.
    Data for the two HC595 bloacks are placed on A4 and A5 (bit by bit) of LS245 and A7 and A6 of LS245 are used for SH_CP and ST_CP clocks. Right ?

    What about Rows ?

    They are just turned ON and OFF that is 2 rows (like row 1 and row 9) at the same time ? So, with 8 different selections of HC138 all 16 rows gets scanned ?


    What about scrolling ? Data is divided into 2 blocks in column. How should I write code for scrolling message. How does data of column block 2 changes to column 1 block data ?

    Looking at the HC138 outputs, cathodes of the displays are connected to rows ?
    Last edited by Okada; 23rd November 2016 at 07:03.

  2. #2
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    Re: [8051] Matrix Moving Message Display.

    There was some mistake. The owner of the display has shipped it. I will receive it in 1 or 2 days.

    For now my calculations are like this.

    There are 16 rows and 12x 74hc595.

    So, there should be 12x8/2 = 48 columns

    So, how should I proceed with the code ?

    I was told that display width is 4 feet and so there should be 16x12 leds in 1 foot. So, there are 48 columns in 4 feet display.

    Total

    16x48 = 768 leds.
    Last edited by Okada; 23rd November 2016 at 10:25.



    •   Alt23rd November 2016, 10:02

      advertising

        
       

  3. #3
    Super Moderator
    Points: 51,881, Level: 55
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    10,412
    Helped
    2475 / 2475
    Points
    51,881
    Level
    55

    Re: [8051] Matrix Moving Message Display.

    Hi,

    I neither think the schematic is correct, nor is it complete.

    ****
    both row selectors are in parallel. So row 1 and 9 (2 and 10, 3 and 11...) are ON at the same time. Why two selectors?

    One row drives at least 48 LEDs so it needs a driver.

    ***
    If your controller has hadware SPI, then I recommend to use it. It is faster and simpler than the bit banging.
    (but you need to connect all 12 HC595 in series, or use time multiplex)

    Klaus


    1 members found this post helpful.

  4. #4
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    Re: [8051] Matrix Moving Message Display.

    I don't know about the actual circuit. I was just given the attached files. He has not provided display board schematic. I am waiting for it. He said the board belongs to someone and he has bricked the microcontroller and hence needs a firmware for new chip but as P89V51RD2 is not available he needs code for At89S52.



  5. #5
    Super Moderator
    Points: 236,290, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    40,849
    Helped
    12488 / 12488
    Points
    236,290
    Level
    100

    Re: [8051] Matrix Moving Message Display.

    It's a standard monochrome LED-board design. There are loads of microcontroller projects showing how to drive similar display boards.

    Presuming the latest decoder circuit is correct, it's a 1:16 mux scheme. Respectively I would expect either 16 rows x 96 columns or 32 rows x 48 columns LED matrix. The difference only matters for data generation, not for scan scheme.

    Using two 6x8 shift registers and two data outputs has the advantage of faster scan speed with bit-banging output. This is useful if the processor has no hardware SPI unit. A processor with one hardware SPI unit would better connect all shift registers in line and run the SPI interface at 8 MHz. The scan line is short enough to achieve useful scan speeds even with a slow processor.

    In case you have a ready-made 32 row module, you can usually expect 2 separate data inputs. Then using two outputs is a must.

    The basic scan algorithm is like this

    Code:
    activate one row select, displays the previously shifted out data
    shift out all bits for the next row
    deactivate current row select
    latch shifted data
    activate next row select
    
    repeat over 16 rows forever


    1 members found this post helpful.

    •   Alt23rd November 2016, 11:07

      advertising

        
       

  6. #6
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    Re: [8051] Matrix Moving Message Display.

    I can't use hardware SPI because hardware SPI pins are not used for connecting to 74HC245. Also HC245 is used for 2 channel serial data transfer. I can only use bit banging spi.

    Right now this is the circuit I have designed by guessing the matrix connections.



    •   Alt23rd November 2016, 11:15

      advertising

        
       

  7. #7
    Super Moderator
    Points: 51,881, Level: 55
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    10,412
    Helped
    2475 / 2475
    Points
    51,881
    Level
    55

    Re: [8051] Matrix Moving Message Display.

    Hi,

    the row decoder of post#4 seems to be correct for 1:16 MUX.

    But still in MMD.PDF it is wrong. Check E1, E2, E3 connections.


    Klaus


    1 members found this post helpful.

  8. #8
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    Re: [8051] Matrix Moving Message Display.

    @FvM

    In my case as two rows are enabled at the same time.

    Code:
    activate two rows (ex: rows 1 and 9), displays the previously shifted out data
    shift out all bits for the next row
    deactivate current rows select
    latch shifted data
    activate next rows select
    
    repeat over 8 rows forever



  9. #9
    Super Moderator
    Points: 51,881, Level: 55
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    10,412
    Helped
    2475 / 2475
    Points
    51,881
    Level
    55

    Re: [8051] Matrix Moving Message Display.

    Hi,

    if your column driver is for 16 rows (like in PDF), then you can not enable two rows at the same time.

    --> either you need to correct row driver circuit in a way that it enables only one row at a time (1: 16 MUX)
    --> or you need to correct column driver circuit in a way that there are just 8 LEDs in one column. (1:8 MUX)

    Your PDF is definitely wrong and can not work properly.

    Klaus



  10. #10
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    Re: [8051] Matrix Moving Message Display.

    Fixed the PDF circuit. JPEG file circuit are correct.

    Why 1:16 ? Explain with an example if possible.

    Edit: Ok. I got it. I can only place 1 row data using 74HC595 at a time and hence I have to use 1:16 that is scan one column at a time.


    Edit2:

    If I have to scan 16 rows then what should be the scan frequency ?
    Last edited by Okada; 23rd November 2016 at 12:08.



  11. #11
    Super Moderator
    Points: 51,881, Level: 55
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    10,412
    Helped
    2475 / 2475
    Points
    51,881
    Level
    55

    Re: [8051] Matrix Moving Message Display.

    Hi,

    you can not simply choose 1:8 or 1:16. You need to use it how the circuit is wired.

    If it is wired for 1:16 then you have to use 1:16.
    If it is wired 1:8 then you have to choose 1:8

    Klaus



  12. #12
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    Re: [8051] Matrix Moving Message Display.

    Ok. I will post the display connections by tomorrow.

    If 1:8 then what should be the scan frequency ?
    If 1:16 then what should be the scan frequency ?

    I will be using timer inturrupts for the complete display code.

    Open collector/drain BJT/FETs are used between 74LS138 and display cathode connections ?

    Can you explain more about how will be the 1:8 and 1:16 wirings ?

    - - - Updated - - -

    If I:8 scheme is used then there will be 96 columns and if 1:16 scheme is used then there will be 48 columns ?
    Last edited by Okada; 23rd November 2016 at 12:37.



  13. #13
    Super Moderator
    Points: 236,290, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    40,849
    Helped
    12488 / 12488
    Points
    236,290
    Level
    100

    Re: [8051] Matrix Moving Message Display.

    I assumed 1:16 because the given circuit has 16 mutual exclusive select outputs. It makes no sense to have 8 outputs that can't be separately controlled.

    But everything depends on the actual hardware multiplex scheme. I'm not motivated to guess about it.

    Regarding scan frequencies, I suggest to make your own calculations. You need to scan through all rows at least 30, better 50 or 100 times per second, scan frequencies depend respectively.



    •   Alt23rd November 2016, 13:18

      advertising

        
       

  14. #14
    Banned
    Points: 5,417, Level: 17

    Join Date
    Jun 2016
    Posts
    1,159
    Helped
    122 / 122
    Points
    5,417
    Level
    17

    Re: [8051] Matrix Moving Message Display.

    625 us per row is the scan frequency I got.



  15. #15
    Newbie level 3
    Points: 189, Level: 2

    Join Date
    Nov 2016
    Posts
    4
    Helped
    0 / 0
    Points
    189
    Level
    2

    Re: [8051] Matrix Moving Message Display.

    Hello Okada..

    Did you know about the code of this circuit?

    Thank you



--[[ ]]--