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.

DS1302 (Parallax SX52) 16x16 LED matrix scrolling clock - additional circuitry??

Status
Not open for further replies.
Mike - You were correct !!!

I got the brightness issue solved!!!

I have solved the brightness issue in the 16x16 LED matrix by going back and reading closely some earlier posts.

1. I am using ULN2803s with current limiting resistors (I have used 22 ohm and 100 ohm and their is no over or under brightning differences like I saw before) on the cathodes.

2. I have replaced the UDN2982s / (or previously used transistor/resistor circuits) on the 16 Anodes and removed the current limiting resistors (now on the ULN2803 outputs going to the 16 cathodes).

3. I am now using 2.4 Amp P channel FETs. They are surface mount (extremely tiny) components on the Anodes. The Source lines are tied to +5vdc. The gates are connected to the SX52 outputs and the Drains are connected to the 16 Anodes. I had to make a PCB (etched from Radio Shack kit) to hold the 16 P-FETs and run wires to the solderless breadboarded test setup with the components and 16x16 LED matrix.



At first I noticed that when scanning the columns (as I did before) that when more than 5 LEDs were on in any row they were dimmer than the rest. However, when I had the rows scanned (Anodes) WOW... ALL THE LEDs were on with the same brightness!!! This is because the P-FETS were drawing more current. It did not seem to matter (as it did before when scanning the collumns) of the current limiting resistor values (e.g. 100 ohm, 10 ohm). I had now set the first 8 columns with 22 ohm and the 2nd 8 columns with 100 ohm resistors but all the LEDs had the same great level of brightness. Not super blinding but a nice consistency accross the board of the 16x16 LED matrix.

It was amazing to me that I needed to replace the row drivers with the P-FETS AND I needed to scroll the rows (Anodes) and not the columns as done before. What a difference!

i still drawing less then an Amp so I can use the Parallax normal 7.5 vdc 1 A supply going into the SX52 Protoboard (regulated to 5vdc).

I hope to have some continuing great progress on my design this weekend - now that the brightness issue is solved completely. The only downside is that I if I want to maintain the constant brightness across all the LEDs then I can not scan the cathode columns (only the rows - Anodes).
 
tdg8934 said:
I got the brightness issue solved!!!

I have solved the brightness issue in the 16x16 LED matrix by going back and reading closely some earlier posts.

1. I am using ULN2803s with current limiting resistors (I have used 22 ohm and 100 ohm and their is no over or under brightning differences like I saw before) on the cathodes.

2. I have replaced the UDN2982s / (or previously used transistor/resistor circuits) on the 16 Anodes and removed the current limiting resistors (now on the ULN2803 outputs going to the 16 cathodes).

3. I am now using 2.4 Amp P channel FETs. They are surface mount (extremely tiny) components on the Anodes. The Source lines are tied to +5vdc. The gates are connected to the SX52 outputs and the Drains are connected to the 16 Anodes. I had to make a PCB (etched from Radio Shack kit) to hold the 16 P-FETs and run wires to the solderless breadboarded test setup with the components and 16x16 LED matrix.



At first I noticed that when scanning the columns (as I did before) that when more than 5 LEDs were on in any row they were dimmer than the rest. However, when I had the rows scanned (Anodes) WOW... ALL THE LEDs were on with the same brightness!!! This is because the P-FETS were drawing more current. It did not seem to matter (as it did before when scanning the collumns) of the current limiting resistor values (e.g. 100 ohm, 10 ohm). I had now set the first 8 columns with 22 ohm and the 2nd 8 columns with 100 ohm resistors but all the LEDs had the same great level of brightness. Not super blinding but a nice consistency accross the board of the 16x16 LED matrix.

It was amazing to me that I needed to replace the row drivers with the P-FETS AND I needed to scroll the rows (Anodes) and not the columns as done before. What a difference!

i still drawing less then an Amp so I can use the Parallax normal 7.5 vdc 1 A supply going into the SX52 Protoboard (regulated to 5vdc).

I hope to have some continuing great progress on my design this weekend - now that the brightness issue is solved completely. The only downside is that I if I want to maintain the constant brightness across all the LEDs then I can not scan the cathode columns (only the rows - Anodes).
Happy to hear you're finally scanning anodes and using P-FETs (ULN2803's instead of MIC5821's are fine).

Mike

<added>
I also wondered awhile back if you were getting thrown off by column and row orientation and I meant to post the drawing below but never quite got around to it (sorry)...
 

Attachments

  • Matrix 16x16 side-ways.PNG
    Matrix 16x16 side-ways.PNG
    32 KB · Views: 3,386
Last edited:
Mike,

I had it all working yesterday with Red, green and yellow (both red and green on at the same time makes yellow??). Anyway, I went to push some of the wires down to make it fit into my case enclosure and the 22 guage solid wires started to break off left and right. I decide to rebuild everthing with Radio Shack 30 guage wire and it worked ok.

After trying to re-wire it all together, I finally got the orientation of the wires correct to match my current coding and then a static shock or something must have gotten my SX52 protoboard as it does not program anymore. Luckily I have 2 more spares (at $10 each their a bargan).

The smiley face scrolls upwards. This is a 16x16 pic that is displayed (or scrolls upwards) between time and date sequences. When adding the P-FETs, the brightness was fixed when only scrolling upwards (not scrolling left to right - e.g. time and date scrolling). I changed the time and date to scroll upwards and re-wired it correctly.

Tomorrow I will replace the SX52 protoboard and the 40 I/O lines. I did not use the A6821 (samples) and do not have any 5821's. I did use 74HC573's (4) to control the colors used (my design not what Wilf suggested with 5 bytes being passed). I did have to use 2 I/O lines for either selecting red, green, or yellow displays. I could have used an invertor and only 1 I/O line if I only wanted red or green - but 3 colors is nicer than 2.

My circuit is similar to yours except I am using the 2.4 Amp P-FETs, 4 ULN2803s and the 4 74HC573 and using the /OE lines on I/O to turn selected chips on or off as it works well. I will of course post a schematic when finished and complete coding - all in a form of BASIC with an interrupt for the display. Not bad - pretty cool. Now If I can keep it all in one piece to put it into the case tomorrow - we will be in good shape.

PS: What do you use for your circuit diagrams? They look really good!

More tomorrow.
 
Mike,

I have been working hard on this new version of the 16x16 LED matrix Real Time Clock. It is now in tri-color (Green, Red and Yellow) using (4) 8x8 LED matrix modules I bought on Ebay. ~$17 for 10 modules. I used (4) 74HC573 to control which color is used. I still need to add some push button switches to automatically control the time and date. Since I only have 3 I/O lines left using an SX52, I will have to use a 74HC165. I have already had some good luck experimenting with it this already.

Eventually I will come up with another design using some serial chips like A6821 or TPIC6C595 to free up a little I/O for use with an SX48 protoboard. The key to my sucess was first your great help on this forum and a couple of others that I have solicited help to understand this concept better.

Here is the YouTube video:

https://www.youtube.com/watch?v=PLGW8knVE1s

More to come...

Let me know what you think. It is certainly one of the hardest projects I have designed and understand.

Thanks!
 
Hi Tim,

The video looks nice. Does your display 'jump' abruptly or is that just my connection?

Since you have this "scanning" row driver bus up-n-runnin' with only 1 pin ever low (or 1 pin ever high) at any given time, why not implement a single-pin row driven switch matrix? You can have one switch for each row in your design. You sample one switch each row "scan" interrupt and this also provides a crude 16-msec 'debounce' interval (sort of).

The Clock below has four switches (and diodes) in a single-pin switch matrix configuration. The code is extremely simple.

**broken link removed**

The ISR code example below is used to process 1 to 16 switches. I apologize in advance if it seems a little overwhelming.

The first four lines sample the switch and update our "live" switch press bits variable. The next section determines if there's been a switch state change, determines if the change is a "press", updates the SWITCH flag bits for MAIN, and updates our switch state latch. It also sends a short 32-msec switch press beep for "new" switch presses.

The column position (COLPOS) variable is a ring counter (only 1 bit on) and would probably be a row position (ROWPOS) variable for your circuit. The bit position in the variable corresponds to the current row being driven low in your hardware. I imagine you already have a variable like this in your software that you send to the latches which drive 1 of 16 rows.

Code:
/*                                                               *
 *  sample switch at COLPOS and update our 'live' switch press   *
 *  data variable SWKEYS                                         *
 *                                                               */
  if (PORTAbits.RA5 = 1)        // if switch at COLPOS off
    SWKEYS &= ~COLPOS;          // turn its 'live' press bit off
  else                          // else
    SWKEYS |= COLPOS;           // turn its 'live' press bit on
/*                                                               *
 *  toggle SWITCH flag bits for processing by MAIN               *
 *                                                               */
  SWTEMP = SWKEYS ^ SLATCH;     // get delta 'press' & 'latch'
  if (SWTEMP &= SWKEYS)         // if "new" switch press
  { SWITCH ^= SWTEMP;           // update SWITCH variable
    BEEPER = 32;                // and send 32-msec "beep"
  }
  SLATCH = SWKEYS;              // update switch state latch
/*                                                               *
 *  beep (500-Hz tone with 1.0-msec interrupts)                  *
 *                                                               */
  if (BEEPER)                   // if beep timer is set
  { LATA ^= 0b00000010;         // toggle piezo speaker pin
    BEEPER--;                   // and decrement beep timer
  }
/*                                                               *
 *  advance column ring counter for next interrupt cycle         *
 *                                                               */
  if (!(COLPOS <<= 1))
  { COLPOS = 1;
  }
 
Last edited:
Mike,

The YouTube video was created on my webcam so it is limited in it's frame rate. Trust me...it runs very smoothly.

Since I only have 3 I/O lines left then I will have to add a 74HC165 to serially accept up to 8 pushbuttons using only 3 lines (clock, data, load). I have it working as a test setup but having problem in incrementing / decrementing as the hex digits of minutes, hours, year, month, day, etc are in a BCD like format and since there are 2 digits for each entity (minutes, hours, etc..) I will need to implement some code to get arround this. It is doable but really think I need to use this chip for more I/O. I need more than 4 pushbuttons because I also need to control the date as well as the time. I will keep you up to date on the progress. The four small soldered boards are tight enough in this casing and adding switches may be difficult as per the limited room.

I will figure something out. Thanks.
 
Sure, throw more hardware at the problem (grin).

BTW, I do everything on my clock with just those four push buttons. In "display" mode I use the up and down arrows to select what I'm displaying as indicated by the display mode LEDs. I press the set push button to "set" or edit the current display (Clock, Alarm, Timer or Calendar) and the up and down arrows are then used to increment or decrement the first flashing display group (hours or month) and the right arrow is used to move to the next display group. Pressing the set switch again takes you back to "display" mode and also saves the edit/work buffer to the correct system buffer (Clock, Alarm, Timer, Calendar).
 
Last edited:
Mike,

Without your help and guidance I would not have finished this. I had to re-read what you said over and over to get "all" of your great message in my head. I did what made the most sense in what I had already done. Since I would have some serious rewrite of my software, I wanted to get it to work first with parallel lines. I will soon look at your serial method using the A6821 since I have these. However, I want to first look into getting some pushbuttons to control date and time. With only 3 I/O pins left (for now), I am prone to using the 74HC165 for 8 inputs into 3 serial I/O lines.

Please commend yourself for your outstanding help. This project is not finished and I want to learn more about expanding on it if you can help.

Thank you!
 
Added pushbuttons to set the time and date

I have added my last update to this cool project!

Pushbuttons to set the time and date:

**broken link removed**
 
Calculations for new LED project

Mike,

I have gathered up all of the comments and think I have calculated correctly for a new matrix (BiColored 8x8 LED Matrix modules). I want 5 of them so it would be 8 x 40 x 2. See the attached for 5v and I also figured it out for an 8.8v PS2 brick supply (50W which is 5.68 A).

However, I was able to get the actual specs of the 8x8 LED modules and the LEDS are 20 mA not 5mA or 10mA as originally calculated. This makes it impossible or (>12 A). Is this realistic to think of? Am I way off on this. Please take a look at the calculations based on 5mA. What am I missing here.

I have it connected without P-FETs (ULN2982 using) and UDN2803/UDN2003's and it looks ok with not much current used. See the YouTube link.

**broken link removed**

It looks not bad (still not SUPER BRIGHT but "ok" considering no P-FETs) but under 500 mA - certainly not ~13 A.

Can this be explained? Are my calculations for this on track?


Thanks again!
 

Attachments

  • 8x8bicolor3mm.pdf
    544.5 KB · Views: 903
  • Temp.zip
    160.5 KB · Views: 505
Last edited:
I got some new dual channel Fairchild 6A P-FETs samples and built a small PCB to hold 4 of them (8 P-FETs). I tested them and they work. I hope to use them in a new design. However, I would like to hear back from Mike about this.
 

Attachments

  • FDS6875.pdf
    62.7 KB · Views: 534
Hi all,

Can someone help me with the attached zip files on the 1 and 2 page. I have unzip the file but its having no extention therefore I am unable to open it.

Thanks,
Karan
 
I also tried downloading these ZIP files to my computer and got the same message. However, I can provide you with Parallax forum links that should provide you with the information you seek.

**broken link removed**

**broken link removed**

Let me know if you have any questions as I am the author of these projects.

Tim Gilmore
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top