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

LDmicro Forum - Output power problem

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

Output power problem (by ML2697)
Hello,
I wrote a program for my PIC16F88 and i have some issues with it. Program is supposed to light different lights depending on times button A1 was clicked. So simulation works ok and even on my circuit it works ok but the problem is with power output. Only when i press for the third time the lights will shine brightly, otherwise they shine very low. I have no idea how is this happening but i asume its because of button switching states. Simple programs work like a charm. I have file attached so u can see how i made it. If you know how to make it easier I open for suggestions. Thanks.

ML
Wed Dec 24 2014, 10:52:33, download attachment zakomp.txt
(no subject) (by MGP)
Its better if you post de LD file so we can try it.

"Res Cprva" ? I think its "res Cpr".
Wed Dec 24 2014, 11:47:21
sure i can (by ML2697)
yeah here u go.
Yeah that was my mistake that i fixed later. it doesnt even matter :D the power is strange

This LD file has some additional stuff
Wed Dec 24 2014, 16:17:46, download attachment zakomp.ld
(no subject) (by MGP)
I made some minor changes because you use 2 times the same output in different rungs.
I dont know the hardware but i hope this is the solution to your problem.
Wed Dec 24 2014, 19:05:55, download attachment zakomp.ld
Great! Case closed! (by ML2697)
Thanks man,
I guess you shouldnt have more than 1 coil with same name. I changed names of coils and works like a charm. thanks again
Wed Dec 24 2014, 21:21:16
Ah sh*t, I take it back... (by ML2697)
Sry dude.
My bad. I didn't actually figured it out. U cant assign one output pin to more coils in LD micro
Wed Dec 24 2014, 21:33:58
(no subject) (by MGP)
If you run the simulation in de first version, then you can see in the window below the ladderwindow that Y..B3 in rung 3 is not set(active) when Cpr==2.
It does in rung4.
In some cases it works when you assign one ouput pin to more coils, but when??
I try always to avoid it.
Thu Dec 25 2014, 11:00:56
How cna i close this thread? (by ML2697)
It works ok now. I had to limit same output only to 1. See file. I have no idea why it didnt work before but its ok now. It just took me some time to rearrange everything.
Thu Dec 25 2014, 12:34:28, download attachment komp.ld
(no subject) (by David R)
HI the problem is having more than one output coil with the same name.

assuming Cpr=1 then YIzhodB4 on run 2 is set high
as the program scans down at line 4 Cpr is not 3 so YIzhodB4 is sets the outputs.

or in other words a logic high will not over ride logic lows else in the code.

I have attached another way of fixing the problem bu using set coils

at the first line the coil IzhodB4 is reset and through the code it may be set at the end of the scan if it is true then the out puts will be set true.
Kind Regards
David.
Sat Dec 27 2014, 05:09:27, download attachment zakomp_set.ld
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):