1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

How to make snake on LEd display....

Discussion in 'Microcontrollers' started by koolguy, Apr 2, 2013.

  1. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    To select a single LED in a row of eight.....

    10000000 = 128... bit 7
    01000000 = 64 .... bit 6
    00100000 = 32 .... bit 5
    00010000 = 16 .... bit 4
    00001000 = 8 ...... bit 3
    00000100 = 4 ...... bit 2
    00000010 = 2 ...... bit 1
    00000001 = 1 ...... bit 0

    if I want to manipulate bit 3 I can AND ,OR and XOR with...

    Code (C):

    //... lets assume backbuffer location = 0xff.
    mask = backbuffer[location]; // .... get the state of the row of LED's
    x = pow[3]; //... x now equals 8

    mask ^= x;  // XOR 0xff with 0x08;
    mask |= x; // OR 0xff with 0x08;
     
     
  2. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    Hi again,

    The way you were doing row scanning was giving good brightness to LED!
    so, can we do scanning for all fonts which was used in column scanning( i mean to say the buffer created by that method?) ??
     
  3. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Have you been given the font for row scanning? If not I'll post it tonight...
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9

    Anyway but then how to send it through PORTB..because there will be no array so, how we will pick the buffer to PORTB?
    as here it was send like this
    one more question can't we send the buffer data in such away that the connection LEFT to right or it s opp right to left can be changed by software......
     
  6. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    What do you mean... The font IS in an arry... fnt[];..

    When you specify an array with no size... then initialize with the contents, the array can be traversed through like any array..

    I use the method that EVERYONE else uses... That way you can grab fonts of the web and also font creating software has it this way round...
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Ritesh...

    Look at this..... To fully understand "plotting pixels"


    led example.png


    You make a pixel routine to identify the bits (LED's) in a picture so you can turn them off or on

    The LED's are in an array of 32x8... We draw a picture to fit

    help.png

    As you can see the pixels match the screen..

    We we plot the pixels we make the buffer the same shape as the array of LED's ie 4 bytes in a row and 8 rows.

    to locate ANY LED within the array... take 5 across and 3 down from the left.. We normally call the variables x and y..

    y is 3 down so we need 3 rows of 4 bytes.. and as its in the next row we now work out how far across x is there are 8 leds to one byte

    so LED will be in buffer [ 3 * 4 + 5 / 8 ].. so buffer[13]...The pixel is modulus 8 5 mod 8 = 5.. The pow table selects the bit_weight.... pow[5] = bit 4...

    The bits are right to left ( same as the T6963C) to rotate them just mirror the POW table...
     
  8. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    HI,
    I am working on LED display PCB designing so, i need to what will be better for scanning :
    1. The column connected as we were doing originally in past ||||||||| like this?
    2. The Row section connection as you suggest in previous post??
    1 2 3 4
    5 6 7 8 like this??
    and which shift register to be use 74hc164 or any other???
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Both the shift registers... The ones I used AND the ones you used worked fine...
     
  10. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    I need help how to design PCB layout for 16x32 display here it is...i mean to say how to do connection???
     

    Attached Files:

    • 12.jpg
      12.jpg
      File size:
      1.2 MB
      Views:
      61
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    You have started down the route of column scanning again..

    Look at this picture.. If you offset the led's by 45°, you can use straight tracks to make it easier.

    The RED tracks are row connections.. The blue tracks are connected to the shift registers.
    best way.png
     
  12. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    NO no, i am ding ROw scainning please ignore that blue line on layout just tell me for Row scanning which you have suggested!!
     
  13. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    If you connect as the picture I posted you should be good to go ( I suppose it doesn't matter which way you connect them )

    As long as all the columns connect to the DATA and all the rows connect to the shift registers..

    Once you have your LED board working... I'll help you make a snake game...
     
  14. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    OK, I am making 16x32 led display now...!!
     
  15. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Yes ... I saw that.... I'll need to update my sim.. I need to make a device...
     
  16. koolguy

    koolguy Active Member

    Joined:
    Aug 24, 2010
    Messages:
    2,196
    Likes:
    9
    where??

    which Sim and device ??
     
  17. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    ONLINE
    Your PCB post... 31x16 LED's


    ISIS.. I need to make a device with 16x32 LED's so I can sim it...
     

Share This Page