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 - ATMega 128

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

ATMega 128 (by Bob)
How to connect AREF pin to work with LD Micro.
AD converter doesn't work.
Wed Jan 5 2011, 18:00:28, download attachment AD test.ld
(no subject) (by Bob)
It's working I didn't know that inputs are opposite (internally ON) negative logic.
Do I have to put inverters on input to have positive logic.
Thu Jan 6 2011, 11:41:19
(no subject) (by Jonathan Westhues)
By default, a more positive voltage on the input pin corresponds to a true Boolean value (i.e., logic level 1 = HIGH). Note that if you've wired a switch to ground with a pull-up resistor, then your input will be LOW when the switch is pressed.

Look at the Instruction -> Make Negated menu item, if you wish to define contacts or a coil where logic level 1 = LOW.
Fri Jan 7 2011, 01:36:22
(no subject) (by Bob)
Yes that is truth, but when You program PLC, PIC and Your simulation is positive logic.
When You pres button than signal is ON.
Yes I can put NC buttons wired to ground.
I can invert all inputs in LD Micro when everything is working in simulation, but if I miss one it will not work.
Usually all buttons are NO except "STOP" which is NC.
For me it is less painful to invert inputs for ATMega I was thinking to put 7414 on input of ATMega, I will try that today.
Maybe You think that I complicate thing but it is easier for me to put one IC more.
Fri Jan 7 2011, 04:36:53
(no subject) (by Jonathan Westhues)
It is conventional to represent logic level 1 with the more positive voltage. There is no reason to deviate from this.

If you want your input to be high when your button is pressed, then wire the button from Vdd (the positive supply rail, for example +5V) to the input, and place a pull-down resistor to ground.
Fri Jan 7 2011, 20:12:25
(no subject) (by Peter)
Thanks, best ideas are simple ones.
In manual doesn't explain the value of pull up resistor.
Which one to put to ground is 1k OK?
Sat Jan 8 2011, 10:43:19
(no subject) (by Jonathan Westhues)
In the tutorial, for example, a switch is wired in this fashion:

http://cq.cx/ladder-tutorial.pl

A 1k resistor is good. If you make the resistor much smaller, then a large current will flow; the circuit will work, but the resistor will generate a lot of heat when the switch is closed. (For example, with 100 ohms and Vdd = 5 V, the resistor burns (5 V)^2/(100 ohms) = 0.25 W, so it will be somewhat warm.)

If you make the resistor much larger, then stray currents, due to coupled noise or due to leakage through gunk on the printed circuit board, may significantly change the voltage at that node. So 1k is a reasonable tradeoff.
Sat Jan 8 2011, 15:24:27
(no subject) (by Peter)
Thanks Jonathan
Sat Jan 8 2011, 15:44:36
(no subject) (by olivier)
i usually put 47k pull-up resistor
Mon Jan 10 2011, 19:00:43
(no subject) (by Jonathan Westhues)
Be careful of the minimum current specification for the switch; with Vdd = 5 V, your 47k resistor supplies just 100 uA. The KSC series of tact switches, for example, has a minimum current rating of 1 mA:

http://www.ck-components.com/14422/ksc_11mar10.pdf/

If you attempt to switch a smaller current, then the circuit will of course work, but the long-term reliability of the part may degrade.
Tue Jan 11 2011, 00:31:10
(no subject) (by Peter)
I tested with 1K pull-down resistor and it works OK!
Tue Jan 11 2011, 13:37:49
(no subject) (by David R)
I use 470R as I like to use A minimum of different components I also use them for LED's and optocouplers other current control around the Micros
Having good current through the switch removes noise and keeps the contacts cleen.

It does use A bit more power but all my systems run off mains.
Regards
David
Tue Jan 11 2011, 20:24:16
request for adding atmega328 (by dian)
hello Jonathan,
thank you so much for this LDmicro.
I am very happy to use it.
I want to ask, is there a possibility to add one more
choice of microcontrollers that can be used, such as atmega328? So that I can also use it with the Arduino,
so no need to make hardware anymore.
Once again, thanks a lot.
Thu Jan 20 2011, 01:09:51
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):