weird problem with dot matrix and shift register


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2009
    Posts
    30

    Default weird problem with dot matrix and shift register

    Hi everyone,

    I m trying to drive 8x8 dot matrix and i m facing a weird problem.

    when i try to display simple pattern like this
    Name:  Capture.JPG
Views: 374
Size:  15.6 KB

    i got

    Name:  ff.jpg
Views: 631
Size:  12.9 KB

    if you notice, the third and eight rows is supposed to be OFF but they are not. instead, they are ON with a little brightness than the second and the seventh ( ON rows )

    i tried to figure out whats the problem. is there any reason that the shift register used to sink column currents isnt able to change its state instantly from logic 1 to logic 0 ? is there some capacitance related to its latch function ?

    ** i used hef4094 to sink columns current and it receives its data serially from PIC16f84
    ** i used 8 transistors to source current to rows. they are connected to portb


    this is the code i used
    Code:
    INCLUDE "MODEDEFS.BAS"
    TRISB = 0
    TRISA = 0
    
    SYMBOL  STRB  = PORTA.0
    SYMBOL  DAT   = PORTA.1
    SYMBOL  CLK   = PORTA.2
    SYMBOL  EN    = PORTA.3
    TEMP    VAR BYTE
    CNTR1   VAR BYTE
    CNTR2   VAR BYTE
    COL     VAR BYTE
    ROW     VAR BYTE
    COLVAR  VAR BYTE[8]
    ROWVAR  VAR BYTE[8]
    PORTB = 0
    PORTA = 0
    CNTR1 = 0
    CNTR2 = 0
    EN = 1
    
    start:
    COLVAR[0] = %11000000:COLVAR[1]=%11000000:COLVAR[2]=0:COLVAR[3]=0
    COLVAR[4] = 0:COLVAR[5] = 0:COLVAR[6] = %11000000:COLVAR[7] = 0 
    
    MAIN:
    
    FOR CNTR2 = 0 TO 100
    PORTB = 1
    FOR CNTR1 = 0 TO 7
     STRB = 0
     COL = COLVAR[CNTR1]^255
    SHIFTOUT DAT,CLK,0,[COL]
    SHIFTOUT DAT,CLK,0,[COL]
    STRB = 1
    
    PAUSE 2
    PORTB = PORTB *2
    
    NEXT CNTR1
    NEXT CNTR2
    'FOR CNTR1 = 0 TO 7
    'COLVAR[CNTR1] = COLVAR[CNTR1]<<1
    'NEXT CNTR1
    
    GOTO MAIN

  2. #2
    Join Date
    Oct 2009
    Posts
    30


    Did you find this post helpful? Yes | No

    Cool

    to summerize the problem here is what is happening

    * i m loading column data to shift register then latch it
    * i m scanning the rows each for 1 ms

    * when moving from a row that has a pattern e.g. (11000000) to the next row with
    pattern ( 00 00 00 00 ) , the bits that were at logic 1 in the previous state dont turn off to logic zero!! instead they are in intermediate state ( i.e. maybe 2.5 volts instead of zero)
    so they still ON but with little brightness

    this problem happens whenever a bit is turned of in the next scan ( i.e. whenever a bit that was 1 turned to be 0 in the next row)

    thats weird.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I think you just need to "Blank" the rows before changing the Column data, then turn the next row on.

    Try it like this ...
    Code:
    FOR CNTR2 = 0 TO 100
      FOR CNTR1 = 0 TO 7
        STRB = 0
        COL = COLVAR[CNTR1]^255
        SHIFTOUT DAT,CLK,0,[COL]
        PORTB = 0                   ; blank all Rows
        STRB = 1                    ; latch the data
        PORTB = DCD CNTR1           ; turn on next Row
    
        PAUSE 2
      NEXT CNTR1
    NEXT CNTR2
    DT

  4. #4
    Join Date
    Oct 2009
    Posts
    30


    Did you find this post helpful? Yes | No

    Smile worked !!

    Darrel,

    thx alot for helping, it worked really well.

    i always wished to thank you in person. cuz from 3 years i enter this forum as a visitor and i always see ur post. you always find the solution. thx much Darrel.

    still i have a problem i didnt mention. the first row always doesnt give full brightness when it is on. i suppose this relates to the previous problem. i will try to work it out.

    thx again Darrel.

    BW

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Thanks Ahmadabuomar, and your welcome.

    First row's dimmer than the others ... ok.
    Let's try moving the "blanking", so that all the rows are ON the same amount of time.
    It should actually dim the other 7 rows to what the first one was.

    Code:
    FOR CNTR2 = 0 TO 100
      FOR CNTR1 = 0 TO 7
        STRB = 0
        COL = COLVAR[CNTR1]^255
        SHIFTOUT DAT,CLK,0,[COL]
    
        STRB = 1                    ; latch the data
        PORTB = DCD CNTR1           ; turn on the Row
        PAUSE 2                     ; LED ON time
        PORTB = 0                   ; blank all Rows
    
      NEXT CNTR1
    NEXT CNTR2
    DT

  6. #6
    Join Date
    Oct 2009
    Posts
    30


    Did you find this post helpful? Yes | No

    Thumbs up solved it

    Hi Darrel,

    in fact, row 1 problem was not related to software!! after i tried your last code. i found nothing changed.

    I then checked all npn transistors used in rows. i found the transistor on portb.0 is not working properly !! i changed the transistor and the problem was solved.

    all portb transistors were bc337 25 npn transistors except portb.0 that was bc337 40

    i dont know if 40 is different than 25 !! but i think the transistor itself is not working

    thx Darrel for your help

    BW

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts