<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>CPLD Controlled Door Lock - Input Circuit</title><link>/members-area/personalblogs/b/blog/posts/cpld-controlled-door-lock---input-circuit</link><description>Input CircuitThe input circuit is very simple. Consider that 24V is present at the connector X1-1; this will allow 20mA to flow through LED1 and indicate there is an input present. Approximately 2mA will flow via R2 and R3, thereby pulling the ...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: CPLD Controlled Door Lock - Input Circuit</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/cpld-controlled-door-lock---input-circuit</link><pubDate>Sat, 25 Apr 2015 17:28:03 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4d91809f-fb87-4911-a7f5-417e829ce5bd</guid><dc:creator>michaelkellett</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I think I would do it like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x514/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-4d91809f-fb87-4911-a7f5-417e829ce5bd/4073.contentimage_5F00_178888.jpg:620:514]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Much less power wasted in the LED resistor and the input to the CPLD goes from low impedance 0V when button pressed to pull up to its own 3.3V supply. It will be less susceptible to noise and variations in the resistor values.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you will have long wires to the button something else might be needed.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you want to detect a 24V (or other voltage) signal then replace the button with an NPN transistor with a resistor from base to ground and an input resistor to the base, collector to R1 and R2, emitter to ground.&lt;/p&gt;&lt;p&gt;By setting the input resistor correctly you can have almost any input voltage and the CPLD input is quite well protected.&lt;/p&gt;&lt;p&gt;If the electrical environment is awful then add a capacitor from the transistor base to ground.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;You&amp;#39;ll need to debounce the signals but you can do that in logic in the CPLD.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=20592&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: CPLD Controlled Door Lock - Input Circuit</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/cpld-controlled-door-lock---input-circuit</link><pubDate>Sat, 25 Apr 2015 14:14:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4d91809f-fb87-4911-a7f5-417e829ce5bd</guid><dc:creator>oldmanraskers</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I know there is no junction at IN01 but I have since fixed it.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=20592&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: CPLD Controlled Door Lock - Input Circuit</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/cpld-controlled-door-lock---input-circuit</link><pubDate>Sat, 25 Apr 2015 14:10:10 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4d91809f-fb87-4911-a7f5-417e829ce5bd</guid><dc:creator>clem57</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Good now&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=20592&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: CPLD Controlled Door Lock - Input Circuit</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/cpld-controlled-door-lock---input-circuit</link><pubDate>Sat, 25 Apr 2015 11:47:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4d91809f-fb87-4911-a7f5-417e829ce5bd</guid><dc:creator>michaelkellett</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I can&amp;#39;t see anything when I click on your link - can you embed the picture using the little camera icon ?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=20592&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>