Continue to Site

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.

  • 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.

LED SignBoard 64X8 - PIC 16F628A

Status
Not open for further replies.
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 :((
 
A dot matrix led display project for an 8x8 or 5x7 led matrix.

Scroll down until you see:

Multiplexing

If you tried to drive 64 individual LEDs you would need 64 individual output pins (each led connected to a output pin on one side and ground on the other).

Obviously that is a tall order so the way round it is to use persistence of vision which is a way of describing how your eye works.

Your eye reacts slowly to changes in light intensity so that if a light is turned on and off quickly enough then it does not notice that the light is off. Basically your eye remembers a light pulse for a short time.

The approximate time is 20ms so if the light is turned on at a frequency >50Hz (1/20ms) then your eye will not notice any flicker at all.

Multiplexing uses this fact to reduce the number of pins needed to drive an LED display. You can do this by splitting the 64 led display into 8 rows and 8 columns which lets you drive it using 8 row outputs and 8 column outputs. In fact the 8x8 led matrix block used here has all the leds arranged in this way already.
 
I`m absolutely new in uC, and i`m a woman, what maybe explain my misunderstanding

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!
 
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
 
.......and am going to order these next: **broken link removed**

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.

macmux%E2%84%A2-7x40-png.34017
 

Attachments

  • MacMux™ 7x80.PNG
    MacMux™ 7x80.PNG
    43.8 KB · Views: 1,238
  • MacMux™ 7x40.PNG
    MacMux™ 7x40.PNG
    33.8 KB · Views: 14,954
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.
 
Those LEDs are from BGMicro right?

Yeah. BG Micro.

The 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.
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.

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?
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.

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.
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
 
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.
 
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.

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:
(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:
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:
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:
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:
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?
 

Attachments

  • Cascade 595.PNG
    Cascade 595.PNG
    8.3 KB · Views: 779
Last edited:
Hi mike ........ Is this correct?
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:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top