Prox / RFID
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Resume / Consulting
Contact Me

LDmicro Forum - Preset Counter+Timer

(you are viewing a thread; or go back to list of threads)

Preset Counter+Timer (by amjad)
Dear sir,

i have complete my project and if any kind of mistake in my project please kindly teach me because i will be very happy if you give me time in your busy works.

Thank you.
Mon Aug 22 2011, 02:43:44, download attachment Copy of BCD.Timer1.rar
(no subject) (by Jonathan Westhues)
A lot of the logic could be simplified. For example, rung 5 could be replaced with a check that v == Count AND v >= 1 AND v <= 9, and likewise for rungs 6 and 7.

I'm not sure why you have a separate Count and Csecond; they seem to always be equal. Also, note that their period is 61 counts, since there's 61 numbers between 0 and 60 inclusive. So if that's supposed to be a minute, then it's slightly long.

Beyond that, if you indicate what you're trying to do, and whether something's not working like you expect, then perhaps someone can provide better comments.
Mon Aug 22 2011, 03:10:30
Preset Counter (by amjad)
Dear sir,
i send a file of proteus there i show the diagrame of circuit that what i am trying.
Ok i explain you in a word,i want to use 16f677a, 2 BCD Thumbwheels for setting the input numbers that what i require the numbers of count to the help of proximity sensor,for suppose i set the number on BCD Thumbwheelswitch 40 or45 or50 or 60 whatever and give the pulses to proximity sensor to the pic input, while when the pulses will reach at taget numbers there i have set on BCD Thumbwheel swithch, so the output will go high and there we can also use relay.

My english is very poor so please take care.

Mon Aug 22 2011, 16:58:55, download attachment Copy of BCD.Timer1.rar
(no subject) (by MGP)
Post your schematic as jpeg, gif, or bmp file so we can see your circuit.
I uploaded an example for reading your BCD switches.
Tue Aug 23 2011, 04:53:44, download attachment BCD.Timer1.ld
(no subject) (by MGP)
Sorry, i deleted a rung too many (rung6) and included some minor changes.
This time it's tested ;)
Tue Aug 23 2011, 05:27:02, download attachment BCD[1].Timer_new.ld
4 BCD switches (by amjad)
Dear Sir,
A lots of thanks for teaching that how it will make BCD switches, rely it amazing for me, once again i am very thanks full to you,i want to say you that if you will teach me continuous so i will be able to do works some, besides this, i want to know that how will set the 4 Thumbwheelswitchs at 16f877a port on RD0 RD1 RD2 RD3, because i want add more switches fix on it, if i will use all ports for switching that i could not complete the circuits on PIC.
Kindly teach me with the help of rungs,i attach some sample for explaining.

Thank you
Thu Aug 25 2011, 06:08:49, download attachment BCD samples.rar
(no subject) (by Jonathan Westhues)
You can use the same code, but add a circular counter, and use that to sequence things; take a look at the attachment.
Sat Aug 27 2011, 01:56:24, download attachment matrixed-bcd.ld
(no subject) (by MGP)
I could not reply because my browser is too old I think, now i use a different computer.

Here the program to scan you thumbwheel switches.
It's very hard to simulate this without the hardware.
The scanning sequence cannot be simulated because de outputs are normally connected to the inputs via the switches, but it should work.
Sat Aug 27 2011, 03:31:01, download attachment BCD_scanning_V1.ld
(no subject) (by MGP)
Note: rung 21 must be counter>=valuebcd

I hope that in future we can correct our posts, a wish ;)
Sat Aug 27 2011, 03:59:39
Thanks (by amjad)
Dear Sir,
Once again i wish you very thanks that you replyed me and taught me, your are all very respectable for me who teaching,because i respect my teachers and i hope if i will need knowlege in the days you will help me to know the student.

Thank You
Wed Aug 31 2011, 11:09:45
Post a reply to this comment:
Your Name:
Your Email:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):