(you are viewing a thread; or go back to
list of threads)
7 seg display clock (by frankye)
I have a 4 digit common anode and I want to do a clock with a pic 16f628
I have try your 7 seg display exemple but I have problem to complete it
can you help me? thankyou
(no subject) (by Jonathan Westhues)
Maybe. Can you post the schematic of your circuit, and your program?
7 seg display clock (by frankye)
thanks for reply
7 seg display clock (by frankye)
here is the program
7 seg display clock (by frankye)
here is the program
(no subject) (by Jonathan Westhues)
Are your LEDs common anode or common cathode? You said common anode, but the schematic would be correct for common cathode.
7 seg display clock (by frankye)
excuse me, this is the correct schematic.
my 7 seg display is common catode.
(no subject) (by Jonathan Westhues)
The pins in that program are not assigned, so it won't compile. So that can't possibly be the program that you loaded in the PIC. Can you post the program that you used?
And you added a rung that references digit3, which is not set anywhere else in the program. This correctly causes an error in simulation.
7 seg display clock (by frankye)
the program is icprog106b
(no subject) (by Jonathan Westhues)
See above; the .ld file that you posted does not even compile. So I don't know where you got the .hex file that you programmed into the PIC, but you didn't get it by compiling that program.
Or have you not tried programming the PIC yet? If that is the case, then you should just be able to assign the outputs in the .ld file according to your schematic, add a MOV instruction to set digit3, and see something happen.
7 seg display clock (by frankye)
HI
This is my program,it is too big and Ican not be able to
finisch it. Can you control and correct it?
thank you.
(no subject) (by Salim)
Nice Clock frankye, but one problem
01:59 then 01:00 then 02:01
02:59 then 02:00 then 03:01
Any Idea ?
7 seg display clock (by Frankye)
this is my new project 7seg display clock, it is for common anode.i hope that this project will be useful for you
I want to wish happy holidays to all
error (by Frankye)
excuse me I'm wrong file, this is the right one
(no subject) (by Salim)
Thank you, wish happy holiday
(no subject) (by Salim)
Clock is working. The problem is compare with a citizen chronometer the ladder clock became slow 40 second a day.
(no subject) (by Jonathan Westhues)
There's some propagation delay in all of the logic. Normally, that's irrelevant, but when you're trying to maintain exact timing over a long period, it may introduce significant error. (And since it adds extra delay, it makes the clock run slow, as you observe.)
You can run the program in the simulator, one cycle at a time (Simulate -> Single Cycle), count the number of cycles, and adjust the program until that's correct.
Or, you can write the program in such a way that this is unnecessary, as in the attachment. Here, the variable 'cycle' is incremented every cycle time; so it counts up every 10 ms. It counts from 0 to 99; so it counts with a period of 100*(10 ms), or one second.
Then, the variable 'sec' is incremented only during the single cycle per second when 'cycle' is equal to zero. So it counts up once per second, from 0 to 59. The minute and hour counts are similar.
(no subject) (by Salim)
Thank you Jonathan
(no subject) (by Salim)
Using 10 ms cycle time refresh rate is slow for 7-segment LED display. Please help
(no subject) (by Jonathan Westhues)
Then use a faster cycle time. The attachment was just an example; obviously, if the cycle time is half as long, and the maximum value of the 'cycle' count is twice as large, then the timing is the same. (So with a 5 ms cycle time, and a 'cycle' count period of 200 counts, the period is still (5 ms)*200 = 1 s.)
Be careful with the choice of cycle time, though. Since the cycle timer is derived from the crystal clock with an integer divisor, only certain values are possible. If you specify a value that can't be achieved exactly, then LDmicro will choose the closest possible value. This is usually okay, but not when you care about exact timing over long periods; so check the datasheet to make sure.
(no subject) (by Salim)
Thank you Jonathan, it's working
(no subject) (by Salim)
Using 10 MHz Crystal - 2 ms Cycle time (500*2) still is having error one second an hour.
I am beginner, please excuse me. I am asking too much.
(no subject) (by Salim)
Using (1 to 5)ms Cycle time and (4, 6, 8, 10, 16 & 20)MHz crystal - result is same one second slow an hour.
(no subject) (by Jonathan Westhues)
I'd have to see the exact program to comment. Though note that the way that I coded my example, the order of the rungs does matter; that's not very good form, but it does simplify things here.
If you can't figure it out, then I guess you could always just fudge it, and make the program add one extra second per hour. But it would be better to understand what's actually happening, of course.
(no subject) (by Salim)
Clock
(no subject) (by Jonathan Westhues)
Actually, now that I look at the PIC16 back end, there's an off-by-one: the timer value programmed is one more than it should be. So everything does run slower than it should, by a factor of on the order of one in a thousand.
So the actual cycle time is slightly longer than the specified cycle time. You can work around this for now by specifying a cycle time of, for example, (5 ms)*(1 - 1/3600) = 4.9986 ms, which makes everything run faster by one second per hour. But this is a bug in LDmicro, that must be fixed in the next revision.
(no subject) (by Salim)
Thank you Jonathan
please help me (by meiyazhakan)
how to write variable cycling timer in 7segment display with keypad
display from 1 to 20 on a 7segment 2digit common cathode (by sama)
please can some one help me on how to do this on ldmicro.WRITE FROM 1 TO 20 ON 7 SEGMENT DISPLAY 2 DIGITS COMMON CATHODE
Post a reply to this comment:
|