Is there a relation between LED current and speed?

Status
Not open for further replies.
hi Al,
When you said a big display.! that is enormous.

It maybe possible to alter the scan rates in the original program.

E.
 
hi Al,
When you said a big display.! that is enormous.

It maybe possible to alter the scan rates in the original program.

E.

Hi Eric,

Yes mate, I'm going to call it clock kong! If the scan rates could be changed could it be made to work with a 20Mh xtal as it looks beautiful running at that speed, no flicker at all! Also could the dead space be added to get rid of the ghosting?

Regards, Al
 
Last edited:
That's an impressive looking clock!

Well since this is your baby how did you want to proceed? If you want to use a non-multiplexed clock I think that is a classy way to do it, it will give you a good brightness per segment and possibly longer LED life etc.

But if that schematic is the actual clock that you have already built, it's no great problem to write code to work with your existing hardware. I can fix the ghosting and flickering, the 4MHz xtal and 16F628A are not a problem. That is probably the easiest solution for you, and is probably easier for me too in software.
 
Colin, BigAl did mention previously he had a few 16F874 PICs available.

Ok BigAl, i looked through some previous clock projects and I had a multiplexed clock that was easy to adapt the C code for a few small changes to suit your hardware.

I have just made the changes and tested it in hardware on a PIC 16F628A and a 7-seg display (which was easy to do on my old MikroE EasyPIC4 board).

It works fine, and should be ok on your hardware I think. The clock set buttons work at a 0.5 second update rate, and it is a 12:00 clock. At this point it always lights 4 digits so 2:30 appears as 02:30 I hope that is ok with you.

I also added one feature, on your (unused) PORTB7 pin I added a "heartbeat" LED that flashes once per second. That is only one line in code, you can remove it if you like.

The code was written in MikroC (which you can download a free demo version of if you want to make changes to the code). The code is very simple and you should understand it pretty easy.

The zip file contains the C source code, the HEX file, and your schematic.

(edit) I forgot to mention the multiplexing is at 488Hz per digit so there will be no flickering and there is about a 15uS deadzone between each digit to stop ghosting.
 
Last edited:
Hi Roman,

I have just tried your hex and on my display it comes up as "80:88" and just stays at that even though some segments seem to change slightly in brightness.

I think my display must be wired differently to yours. You mentioned that you use the EasyPic4. I have the EasyPic5 and actually burned the PIC in it. The 4 digits on my EasyPic5 don't light at all with your hex, just wondered if they light on yours and if so what do they show? Also the time changing buttons seem to do little but change the brightness of the odd segment, did your circuit have the buttons working on the same pins?

The flicker is gone as you said it would but as I only have one unlit segment on the big clock I can't really tell about the ghosting.

What circuit did your original clock use mate? I can try to adapt mine to suit if possible, or should I go by the other route of 1 seg per pin with the 874?

The 874 way would mean me making a new circuit board but it would be simpler in that it would only need 4 x 2803s to drive the display. I am still unsure if I could leave the common permanantly connected in that sort of circuit but thats the way I imagine it.

I am happy to go either route mate and will be led by your advice.

Thanks, Al
 
Hi Roman,

I am tracing the circuit and believe that my digit drivers are mixed up somehow. I think that this would cause the wierd display I get.

Just working out which goes to which now, I will let you know the result shortly.

Thanks, Al
 
Hi Roman,

Tried swapping the digit drivers but still getting the same thing. May be time to start again I think.

Just don't know what else I can try? Any suggestions mate?

Thanks, Al
 
Last edited:
BigAl, hmm that is weird. I wrote to code to drive EXACTLY the schematic you posted (in post #20) and it is fully tested including the clock set buttons (using the same resistor values in your schematic).

I tested it on EasyPIC4, by using 7 jumper wires to connect PORTB0-6 to PORTD-06 (to work the EasyPIC 4 digit display). You push the 7 jumper wires into the 40pin socket to join the pins, since you are using PIC16F628A in the 18pin socket. I just checked the EasyPIC5, it has the same pins for the 4digit display as my EasyPIC4. You also need to switch the DIP switch SW6 4 switches to turn the digit drivers on.

The code should then work on the EasyPIC5, but the clock set buttons won't work unless you put a 150 ohm (to 270 ohm) resistor to replace the "VCC" jumper left of all the buttons. That is necessary for the code to suit your schematic that needs that important resistor. I soldered a 220 ohm resistor onto a 2pin header and pushed it on that spot where the VCC jumper was. Also you need to set the PORTB pullup resistors to GND (pulldown) which mimics the 10k pulldown resistors in your schematic.

Also, the hex file suits your clock schematic and has the 4 digit drivers reversed, so on the EasyPIC4/5 the 4 digits will be in reversed order ie "12:00" will read "00:21".

That can easily be changed in the C cource file for testing (see my comments in the C file).

Since you have a EasyPIC5 don't be afraid to download a free copy of MikroC and use the C source code I supplied you, it is very simple.

As for your clock not working with the hex code, the only thing I can think of is that your clock differs from the schematic you presented! Please check your wiring compared to that schematic. I'm sure it will be an easy fix either in code or in the wiring.

At this point from my side it's easier to work with the multiplexed clock code rather than a 16F874, as I (we) can simulate it on the EasyPIC4/5 with the 4digit module. And it should be less work for you in terms of modifying your clock.
 
Last edited:
Hi Roman,

DOH! Why didn't I think of the jumper idea on the easypic.

Got it running on the easypic now but it starts at 1201? (allowing for the reversed figures) That is wierd! Does yours definately start at 1200?

Then something even stranger happens! The colon stops flashing and the clock becomes a counter with the seconds counting at about 2 per second.

Can I have got something connected wrong on the easypic? Just try it on yours again and leave it running a few minutes to see if yours is the same, mine was ok at first, only noticed the counting effect after I began typing this reply.

As to the circuit being different, I can't find anything at all and what really baffles me is that if i burn the original hex that I posted then my display works correctly (just looks horrible) so doesn't that prove that the circuit is correct?

Update - this is mad, whats happening? Now whe I turn on the clock (on the easypic) it starts counting straight away and no colons!

I am absolutely baffled! But as writing this I have had a thought! the easypics display is CC and mine is CA. I realise this wouldn't cause the weird counting but could it be the root of the wrong display on my big clock?

Yours baffledly, Al
 
Last edited:
Hi BigAl, don't be worried, you are on the home stretch now!

The clock is counting up because it thinks a button is pressed.

On the right side of the EasyPIC5 you need to set the "PORTB pullups" setting to "pull down". There is a dipswitch for PORTB you set all 8 switches to ON, then there is a jumper next to it you set to GND. That applies a 10k pull down resistor to all 8 PORTB pins.

That should fix the "counting up".

Now I must apologise, I checked your schematic again and I forgot there is an inverter on the 4 digit drivers from PORTA. My code (that you have been testing) has been driving 1 digit HI, which works on EasyPIC but on your hardware would be driving 3 digits on all the time, insetad of 1 on and 3 off!

Please see the new attached ZIP file. The C source code has been updated, and the seg7_clock.hex is for your clock, and the file seg7_clock_EP.hex is for the EasyPIC5.

I think now we are close to done?
 
Hi Roman,

Thats sorted it! Thankyou mate!

I do see what you mean about the first digit being on all the time though, is it something that could be easily fixed?

Really happy to get the clock working at last, and now I can actually make sense of the numbers. Cool.

Thanks, Al
 
Last edited:
Damn damn and triple damn! Still getting the ghosting! Always at least 1 segment just barely flickering on each digit. Not visible much in daylight but very noticable in the dark.

Will this ever go right? Beginning to think I'm cursed but I can't remember being mean to any gypsies or witches. hehehe

Al

Just remembered a black cat did cross my path, but then again it is one of our cats so that shouldn't count!
 
Last edited:
Can you describe the ghosting? Which segment is ghosting compared to what XX:XX display? And is is always the same 1 or 2 segments that ghost?

The code puts a 15uS deadzone where the entire display is off between displaying each digit. It's unlikely your hardware is taking longer than 15uS to turn the drivers off. The 2803 ICs have inbuilt turnoff resistors, and they are both driven from CMOS outputs anyway.

I saw you used 10k resistors (R1) to turn off the 4 digit driver transistors, you could lower these resistors to 1k to give much better turnoff of the 4 digit driver transistors.

But apart from that I am thinking you might be getting some noise, it's a big clock and there are some long wires. Do you have a photo of the back of the clock where the wiring and PCB are shown?

And the PSU? How much noise is on the 12v line and what PSU caps (and where are the PSU caps)?
 
Hi Roman,

Sorry I forgot to mention that the resistors are already different from the schematic, in another post Eric Gibbs advised me to change them to R1 = 2k2 and R2 = 4k7, but this seemed to have had no effect. Also about smoothing, at the moment its just the basic 10 and 100n caps but I am running from a gel cell so there should be no noise from that side of things. I will make the final use PSU very smoothe when I eventually get the gig working right.

Here are some pics of the setup and a mov file that will play in quicktime player.

You can see the minute digit looks like a 9 when it is a 3, the hour 2 segment also looks like a mirrored 9 and other segments seem to be playing up! Mostly A and F segments, but not entirely.

Sorry for the commentary, it is my son who kindly filmed this on his iphone.

Thanks, Al

Edit, the mov file didn't upload, had to zip it. Seems ok now. Al


Al, Cropped as requested. E.
 
Last edited:
Thanks Eric, had a bit of trouble there!

Just put the cropped one one too! great minds eh! I don't think they knew me when they brought that saying out.

Thanks again Eric.

Al
 
BigAl, hmm I'm sure it's not the software causing the ghosting (because it has a nice 15uS deadzone) and I'm fairly sure it's not the electronics after seeing your clock PCB.

Have you thought it might be mechanical? ie light leakage between segments? That would explain the seg A and F relationship (as in the software and electricals A and F are very separated).

I did notice in your photo some corners seem to have gaps, and A and F are both corner segments. Maybe you can light the worst offending A segment with DC, just with a resistor etc to set it at about the right brightness, then look for light leakage. In a dim room. Aluminium foil can be good for stopping light leakage on corners etc and it glues easy with superglue.


That's an impressive lot of work you've done on that clock too!
 
Hi Roman,

I am in the midst of insulating, if you can call it that, all the segments from each other at the rear. Then I will test again and let you know, maybe even a new video eh?

Can I ask one favour though? Could you get the first digit to not show zero? That would be sweet!

Right, back to the insulating!

Thanks again, Al
 
Sure, it's done.

There is a source file; seg7_clock_no0.c
and a hex file; seg7_clock_no0.hex

That suppresses the leading zero on digit0, so 01:00 now displays as 1:00.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…