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

LED SignBoard 64X8 - PIC 16F628A

Discussion in 'Microcontrollers' started by Gayan Soyza, Mar 8, 2009.

  1. Instinct

    Instinct New Member

    Joined:
    Sep 24, 2009
    Messages:
    3
    Likes:
    0
    Hello people!

    I`m absolutely new in uC, and i`m a woman, what maybe explain my misunderstanding ;)

    Sooo, I read whole threat again and again, but still don`t get it how Gayan`s matrix work:( . This things with “only one row light at a time” is so cofusing to me. How long is that time actually.
    Also don`t understand how many are processors at the display, is there 8 for each matrix, or 1 drive all the matrixes ?

    Gays, i`m totally lost ..

    Sorry for my stupid questions, but it`s really interesting to me how it works :) And sorry about my poor engllish too :((
     
  2. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    A dot matrix led display project for an 8x8 or 5x7 led matrix.

    Scroll down until you see:

     
  3. Instinct

    Instinct New Member

    Joined:
    Sep 24, 2009
    Messages:
    3
    Likes:
    0
    Thanks for your quick answer, AtomSoft. I`m starting to read it, and hope to get it already :)
     
  4. dave

    Dave New Member

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


     
  5. birdman0_o

    birdman0_o Active Member

    Joined:
    Feb 23, 2009
    Messages:
    1,370
    Likes:
    18
    Location:
    Montreal, Quebec

    That has absolutely nothing to do with it.

    Persistance of Vision is a very neat concept, think about this: How do cameras take video? How do videos work in theaters or anywhere? It is not constant feed, but a series of pictures!

    I had trouble believing these facts until I had built my own POV led display and saw how wonderfully it worked.

    Actually the best way would be to make one, and adjust the delay from very slow (the columns or rows will appear to be on one at a time) up until the led column or rows appear to be all on!
     
  6. edmondren_89

    edmondren_89 New Member

    Joined:
    Sep 26, 2009
    Messages:
    1
    Likes:
    0
    Dear sir,

    can i have a look at ur source code?

    but i only know Hi-tec c language

    i would like to see your source code as i am doing a project for my diploma
    which is scrolling message which is sent in by sms.

    pls send to my email edmondren_89@hotmail.com
     
  7. thesadman

    thesadman New Member

    Joined:
    Sep 7, 2009
    Messages:
    4
    Likes:
    0
    what did you use to draw the layout
    eagle or what
     
  8. Instinct

    Instinct New Member

    Joined:
    Sep 24, 2009
    Messages:
    3
    Likes:
    0
    Yes, it will be eagle, but still don`t use it. For now only trying to figure out how work so many matrixes.
     
  9. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Jason (AtomSoft),

    Did you ever order any of these 0.7-inch 5x7 displays for 69 cents each? They might be a nice candidate for a 7x40 or 7x80 display using my MacMux™ architecture and relatively inexpensive 74HC595 column driver ICs.

    [​IMG]
     

    Attached Files:

  10. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    hey nice job. Thats exactly how i would do it. Those LEDs are from BGMicro right?

    he 595s are perfect because of the latch feature. My choice of MCU would be:

    PIC18F2455

    Mainly because its cheap and as fast as 48Mhz/12MIPs. which is about 12Mhz really in the pic world. since the max fcy the HC595 can do is 100mhz i say this 12Mhz is really fast and can switch these puppies nice!

    Or you can just a use a dsPIC33FJ64MC802 40MIPS! sure it would be more than enough to control quiet a few leds. Even multiple rows should be ok.

    One thing! how slow can one go before the leds look bad? Like how fast does one need to switch for the whole thing to appear lit?

    i guess a test of my own vision and a few others is in check. Ill make a LED block and see a what speed i can slow it down to before it starts looking funny.

    The whole issue is with more blocks you need more speed but the faster you go the dimmer it gets.
     
  11. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Yeah. BG Micro.

    Almost any 28 pin 18F' would be fine. I only put the 16F690 in that design because the serial port pins aren't on PORTC and I could use all of PORTC for the 8-pin bus.

    You don't need a lot of horsepower with this design. A 4-MHz clock will work fine. Both 40 and 80 column displays run at a 1/7th or 14% duty cycle which provides decent brightness (4-ma "average" current per LED) with 74HC595 sourcing drivers and keeps "peak" power supply requirements managable.

    A static display should be refreshed at 60-Hz or more to avoid flicker which works out to about 2.4-msecs or faster per row update. If you're going to animate the display (scrolling, etc.) then a higher refresh rate is desirable to avoid the 'slanting' you sometimes see when scrolling horizontally at a fast rate. Also, animation should be synchronized to the refresh cycle or "frame rate" and so higher refresh rates allow more frequent animation updates.

    You may be thinking of designs similar to Gayan's original design where adding additional modules will reduce the display duty cycle. That's not the case with these MacMux™ design examples. Both the 40 and 80 column designs run at a 1/7th or 14% duty cycle. The 80 column design just uses a little bit more ISR 'overhead'.

    Regards, Mike
     
  12. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn
    The funny thing here is I took apart a old sign board it had 1050 red leds and you could read it good in the day time. It came out the lunch room at work you could go as fast as you want to scroll or slow and it looked good.
    It's uC only had a 2mhz crystal it was a old 8051. They lost the code setting controller
    so I ended up with it.I played with for some time never could figure how they got to work so good.
     
  13. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Mike looks like it would be a fun project.
     
  14. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    heh yeah. I bet they had a few people to try and code it all. Im sure they plan stuff major before a actual try.

    EDIT

    I was bored and made this little chart:
    Code (text):

    (1THZ) 1,000,000,000,000 hz = 0.000,000,000,001 second per cycle (1 PicoSecond)
    (1GHZ)     1,000,000,000 hz = 0.000,000,001     second per cycle (1 NanoSecond)
    (1MHZ)         1,000,000 hz = 0.000,001         second per cycle (1 MicroSecond)
    (1KHZ)             1,000 hz = 0.001             second per cycle (1 MilliSecond)
    (1HZ)                  1 hz = 1                 seconds per cycle (1 Second)
     
    Can you imagine a 1THz system heh
     
    Last edited: Oct 4, 2009
  15. birdman0_o

    birdman0_o Active Member

    Joined:
    Feb 23, 2009
    Messages:
    1,370
    Likes:
    18
    Location:
    Montreal, Quebec
    The signals would need to move faster than the speed of light ^^
     
  16. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    heh yeah. Im sure we are pretty close to it :D we have to be...
     
  17. Suraj143

    Suraj143 Active Member

    Joined:
    Jan 11, 2007
    Messages:
    1,567
    Likes:
    2
    Location:
    South Mald Isld
    Hi Mike I'm studying your last design 7X40 using 74HC595.

    Can you tell when an timer interrupt occurs I must feed the first row datas.The data is in the 40 column registers.So I must bit mask the column registers & feed the data to the first row one by one.
    After feeding finished the first row, I'must give latch to the latch pin & come out from interrupt

    Likewise in next interrupt I'must feed the 2nd row like above.

    Is this correct?
     
    Last edited: Oct 15, 2009
  18. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Hi Suraj,

    There are some special driver considerations with the MacMux designs. They use the PIC PWM output to modulate the OE (output enable) lines on the driver ICs which allows us to retask the row driver lines temporarily for use as <CLK> and <DAT> lines to load all of the shift registers in parallel during a short blanking interval at the beginning of each row scan interrupt. This method allows us to load 40 bits of column data into the five shift registers by simply writing 8 bytes and clock pulses onto the row driver buss at the beginning of each row scan interrupt;

    Code (text):
    void interrupt()
    { pir1.TMR2IF = 0;                // clear timer 2 interrupt flag
     /*                                                                  *
      *  retask the row driver lines while PWM is hi (display off) as    *
      *  one <clk> and five <ser> lines to update the 74HC595 shift      *
      *  registers on all five driver ICs in parallel (5 chan SPI) then  *
      *  write the new row select bit pattern to portc before PWM goes   *
      *  lo (display on) to resume portc row driver duties.              *
      *                                                                  */
      portc = srbuf[7]; clk = 1;      // clock out SR b7 bits
      portc = srbuf[6]; clk = 1;      // clock out SR b6 bits
      portc = srbuf[5]; clk = 1;      // clock out SR b5 bits
      portc = srbuf[4]; clk = 1;      // clock out SR b4 bits
      portc = srbuf[3]; clk = 1;      // clock out SR b3 bits
      portc = srbuf[2]; clk = 1;      // clock out SR b2 bits
      portc = srbuf[1]; clk = 1;      // clock out SR b1 bits
      portc = srbuf[0]; clk = 1;      // clock out SR b0 bits
      portc = rowsel;                 // select new row

     
    This code loads the shift registers with 40 bits of data in something like 25 instruction cycles. The PIC PWM output turns off the display allowing us to use the buss to load the shift registers and then latches the shift register data onto the driver outputs and turns on the display.

    You need additional "data bender" code in the ISR to build those eight special shift register bytes from your display[] array before each new row scan interrupt.

    I'll throw an example program together and post it for you as soon as possible.

    Take care. Regards, Mike
     
    Last edited: Oct 15, 2009
  19. Suraj143

    Suraj143 Active Member

    Joined:
    Jan 11, 2007
    Messages:
    1,567
    Likes:
    2
    Location:
    South Mald Isld
    Hi mike thanks for the great help.

    Actually the “MAC Mux” is a bit hard. I’ll try to do it later.

    For the time being I’m doing a standard multiplex but I need to do a row scan.
    I have attached my drawing; the positive to the LEDs will supply via the shift registers. & the negative supply to the LEDs will supply via the microcontroller.

    You may notice I have cascaded the shift registers via the QH’ to SDATA.

    This is the method I’m going to use.

    In row scan I need 40 column registers if I have 40 columns.
    When a timer interrupt occurs I must first serve the first row. This is done by sending all lower bits of column registers to the shift registers. After feeding all 40 columns in the first row I must make a “latch” to show in the display. After latching I must return from interrupt.

    Likewise in next interrupt I’ must feed the 2nd row like above.

    Is this correct?
     

    Attached Files:

    Last edited: Oct 15, 2009
  20. Hero.sl

    Hero.sl New Member

    Joined:
    Nov 4, 2008
    Messages:
    44
    Likes:
    0
    Location:
    Colombo
    That's cool Gayan ayya. two thumbs up.. :)
     
  21. Mike - K8LH

    Mike - K8LH Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    3,637
    Likes:
    109
    Location:
    Michigan, USA
    Hi Suraj,

    It seems you have the correct procedure. You need to keep track of the row number and select the correct five bytes (40 bits) of data from your display array during each interrupt. You'll clock out those 40 bits into the daisy-chained shift registers, blank the display, latch the shift register data onto the outputs, then select the new row to turn the display back on. You do this procedure each interrupt to display a new row.

    Regards, Mike
     
    Last edited: Oct 16, 2009

Share This Page