<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8126969217814028272</id><updated>2026-07-08T10:37:23.058-05:00</updated><category term="Programacion PIC"/><category term="Programacion AVR"/><category term="AVR y assembler"/><category term="VHDL"/><category term="atmega8 y assembler"/><category term="HP 50g"/><category term="Programadores PIC"/><category term="Varios"/><category term="atmega8 basic"/><category term="AVR y display"/><category term="Programadores AVR"/><category term="proyecto potencia microcontrolador"/><category term="ABB"/><category term="AVR assembler multiplexaje"/><category term="AVR basic"/><category term="Procesamiento de Señales e Imagenes"/><category term="atmega8 assembler multiplexaje"/><category term="multiplexaje de display AVR"/><category term="multiplexaje display Atmega8"/><category term="2.5G"/><category term="2.75G"/><category term="AVR leds"/><category term="EDGE"/><category term="Enhanced Data rates for GSM Evolution"/><category term="GPRS"/><category term="General Packet Radio Service"/><category term="PI digital iluminación"/><category term="PI discreto iluminación"/><category term="PI iluminación"/><category term="atmega8 leds"/><category term="atmega8 teclado 4x4"/><category term="control PI con microcontrolador"/><category term="control PI digital"/><category term="control PI discreto"/><category term="control de temperatura"/><category term="control digital microcontrolador"/><category term="control pid"/><category term="desplazamiento assembler"/><category term="desplazamiento atmega8"/><category term="dezplazamiento AVR"/><category term="disparo scr"/><category term="disparo tiristor"/><category term="inversor AVR"/><category term="inversor DC bipolar"/><category term="inversor PWM"/><category term="inversor atmega8"/><category term="inversor potencia"/><category term="inversor senoidal"/><category term="inversor sinusoidal"/><category term="labview"/><category term="levitador magnético"/><category term="luz secuencial AVR"/><category term="luz secuencial atmega8"/><category term="magnetic levitation"/><category term="matlab"/><category term="pid con labview"/><category term="pid con matlab"/><category term="pid digital"/><category term="pid discreto"/><category term="scr AVR"/><category term="scr atmega8"/><category term="scr triac AVR"/><category term="scr triac atmega8"/><category term="scr triac microcontrolador"/><category term="selección código y visualizacion display AVR"/><category term="selector hexadecimal AVR"/><category term="selector hexadecimal atmega8"/><category term="semáforo"/><category term="semáforo AVR"/><category term="semáforo assembler AVR"/><category term="semáforo assembler atmega8"/><category term="semáforo atmega8"/><category term="teclado con AVR"/><category term="teclado matricial 4x4"/><category term="temperatura atmega8"/><category term="temperatura avr"/><title type='text'>lonely113</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-3967039759759518876</id><published>2012-10-01T17:16:00.001-05:00</published><updated>2012-10-01T17:16:58.331-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="control pid"/><category scheme="http://www.blogger.com/atom/ns#" term="labview"/><category scheme="http://www.blogger.com/atom/ns#" term="levitador magnético"/><category scheme="http://www.blogger.com/atom/ns#" term="magnetic levitation"/><category scheme="http://www.blogger.com/atom/ns#" term="matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="pid con labview"/><category scheme="http://www.blogger.com/atom/ns#" term="pid con matlab"/><category scheme="http://www.blogger.com/atom/ns#" term="pid digital"/><category scheme="http://www.blogger.com/atom/ns#" term="pid discreto"/><title type='text'>Control PID de un levitador magnético</title><content type='html'>&lt;iframe allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot; height=&quot;511&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/14458989&quot; style=&quot;border-width: 1px 1px 0; border: 1px solid #CCC; margin-bottom: 5px;&quot; width=&quot;479&quot;&gt; &lt;/iframe&gt; &lt;br /&gt;
&lt;div style=&quot;margin-bottom: 5px;&quot;&gt;
&lt;strong&gt; &lt;a href=&quot;http://www.slideshare.net/lonely113/control-pid-de-un-levitador-magntico&quot; target=&quot;_blank&quot; title=&quot;Control PID de un levitador magnético&quot;&gt;Control PID de un levitador magnético&lt;/a&gt; &lt;/strong&gt; from &lt;strong&gt;&lt;a href=&quot;http://www.slideshare.net/lonely113&quot; target=&quot;_blank&quot;&gt;Percy Julio Chambi Pacco&lt;/a&gt;&lt;/strong&gt; &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/3967039759759518876/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2012/10/control-pid-de-un-levitador-magnetico.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/3967039759759518876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/3967039759759518876'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2012/10/control-pid-de-un-levitador-magnetico.html' title='Control PID de un levitador magnético'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-2465738314504810233</id><published>2012-09-25T19:04:00.002-05:00</published><updated>2012-09-25T19:09:40.776-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 basic"/><category scheme="http://www.blogger.com/atom/ns#" term="control PI con microcontrolador"/><category scheme="http://www.blogger.com/atom/ns#" term="control PI digital"/><category scheme="http://www.blogger.com/atom/ns#" term="control PI discreto"/><category scheme="http://www.blogger.com/atom/ns#" term="PI digital iluminación"/><category scheme="http://www.blogger.com/atom/ns#" term="PI discreto iluminación"/><category scheme="http://www.blogger.com/atom/ns#" term="PI iluminación"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><title type='text'>Control PI discreto de iluminacion con ATmega8a</title><content type='html'>La corriente eléctrica es
una señal alterna sinusoidal como la de la figura:&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-MX&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAJTVISkt9ZRtX_0WywaY2EeouXjSXZfvUmOXJQWksp9XoFEevkTw4hvuPzyMO95VX5HCgIT1y5IcnPIDwhZcGJntg-SDgaxTBpBs80qd14fyYEdamK1Z1z-iBkDWETdWGjwHCuUf43IDo/s1600/sin1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAJTVISkt9ZRtX_0WywaY2EeouXjSXZfvUmOXJQWksp9XoFEevkTw4hvuPzyMO95VX5HCgIT1y5IcnPIDwhZcGJntg-SDgaxTBpBs80qd14fyYEdamK1Z1z-iBkDWETdWGjwHCuUf43IDo/s1600/sin1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-MX&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-MX&quot;&gt;Al pasar esta corriente
eléctrica por el bombillo haremos que se ilumine al 100 %.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-MX&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-MX&quot;&gt;Si logramos hacer
que la señal aplicada al bombillo se recorte como se ve en la figura siguiente,
obtendremos valores de iluminación entre un 0% y un 100%.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg0kiBkBG7gQN_xC7MAMF4Hg0blmDQUAcGCKYiX5IJlZ8MYjqi0cDIkKN1hVXuBu5lv5BVwJUlQeQH2vMP7BB8Z0v4-NpsBd9h9BSr2V_3Cq8VvjMz6PXuaTLNq_tav7ACs73QNxhhh5Mk/s1600/sin2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg0kiBkBG7gQN_xC7MAMF4Hg0blmDQUAcGCKYiX5IJlZ8MYjqi0cDIkKN1hVXuBu5lv5BVwJUlQeQH2vMP7BB8Z0v4-NpsBd9h9BSr2V_3Cq8VvjMz6PXuaTLNq_tav7ACs73QNxhhh5Mk/s1600/sin2.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES-MX&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;El objetivo del proyecto es controlar el ángulo de
disparo de un TRIAC que estará conectado en serie con el bombillo, mediante el
controlador PI, de acuerdo a la intensidad de luz que perciba un sensor
LDR. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Etapas&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Sensor y acondicionamiento&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzW7bWmhTX7vyLxJ7aKF7EAiO1gqDEEs8qkUPeZ3T_32vGsOLiryh21kTVhLPe6bEAqIp9oL0JjILwYdsTEX4xI6ndpbNxB-UvvLibSkc1xjTx_xv_mSxJTt5FpTxn2jTflJKPs6eGu_Hf/s1600/sensor2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;137&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzW7bWmhTX7vyLxJ7aKF7EAiO1gqDEEs8qkUPeZ3T_32vGsOLiryh21kTVhLPe6bEAqIp9oL0JjILwYdsTEX4xI6ndpbNxB-UvvLibSkc1xjTx_xv_mSxJTt5FpTxn2jTflJKPs6eGu_Hf/s320/sensor2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;El sensor que se
utiliza es una fotorresistencia, el cual varía su valor, dependiendo de la
intensidad de luz que se le aplique. La señal de salida alta en caso de baja
intensidad de luz, y baja en caso contrario.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;Como la salida del sensor (LDR) varia de
0-2.5v y la entrada del microcontrolador ATMEGA8 recibe voltajes de 0-5v,
amplificamos este valor en un factor de 2 para aprovechar la sensibilidad del
ADC del microcontrolador. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;b&gt;Referencia&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSzJYxgDJ1ySG-Sj7FkHPmAKJWqOUcsc_5eRZEcOSEcx48kZHpQF63sdVi2xAGY9EBAIGnVC7MzDEr75c3tz9eMkJLSHn5r-zYQhLUStsy5hs25LRQNb5I3HvbsAiLHmV-btTwZhk3aodE/s1600/referencia2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSzJYxgDJ1ySG-Sj7FkHPmAKJWqOUcsc_5eRZEcOSEcx48kZHpQF63sdVi2xAGY9EBAIGnVC7MzDEr75c3tz9eMkJLSHn5r-zYQhLUStsy5hs25LRQNb5I3HvbsAiLHmV-btTwZhk3aodE/s320/referencia2.png&quot; width=&quot;252&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;Este potenciómetro se utilizará para
elegir la intensidad de luz de referencia que se requiera mantener. También irá
conectado a uno de los pines ADC del microcontrolador.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;b&gt;Control&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTeiUUJ1CYUS-vrgbRsOp1LV0yJcfu3Ucuasvqm-it6s6xDzbi4vtIutAc3jqVDhsuat0ni1tUtu5K9UCww4Ww0mvTMP-G5B3sWosXG1WzC2xRS3VOIXSM3KXhe1OHD67LYLFXmMQUXpZw/s1600/control2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTeiUUJ1CYUS-vrgbRsOp1LV0yJcfu3Ucuasvqm-it6s6xDzbi4vtIutAc3jqVDhsuat0ni1tUtu5K9UCww4Ww0mvTMP-G5B3sWosXG1WzC2xRS3VOIXSM3KXhe1OHD67LYLFXmMQUXpZw/s320/control2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;El esquema muestra las conexiones de
los pines del microcontrolador.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTxuvwLstxcT2LW_9Y4MIlZmUSLTJCHYHl84cEKalGnGmQkWXLpBJN-modTBaRhNiMossRoi9ybhL8Hssy4JRx6wOPyjJvniIhOTKEbJwD2ix21kENLcAt-cSXABKBtgf4b5lIEoRGK_-N/s1600/deteccion.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTxuvwLstxcT2LW_9Y4MIlZmUSLTJCHYHl84cEKalGnGmQkWXLpBJN-modTBaRhNiMossRoi9ybhL8Hssy4JRx6wOPyjJvniIhOTKEbJwD2ix21kENLcAt-cSXABKBtgf4b5lIEoRGK_-N/s320/deteccion.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES&quot; style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Se utiliza este bloque de
circuito para poder sincronizar el programa con la señal sinusoidal del
circuito de potencia que se quiere controlar. Este circuito enviará un pulso de
interrupción cuando la señal cruce por 0, iniciando la rutina correspondiente
en el programa.&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES&quot; style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span lang=&quot;ES&quot; style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;b&gt;Circuito de Potencia&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDjd38DacOignPYWYRDvQm_SHsUOknbDd19iKOKWDQdamz8WvKRxtMoibXrODIju23FB12Mr-xP3HIZKNp770BsQU9PJz6cBZv_9xZo6OlCOuMsJOda0vX_Nby6nG2Nk2UsewvmpLWzTLO/s1600/potencia2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDjd38DacOignPYWYRDvQm_SHsUOknbDd19iKOKWDQdamz8WvKRxtMoibXrODIju23FB12Mr-xP3HIZKNp770BsQU9PJz6cBZv_9xZo6OlCOuMsJOda0vX_Nby6nG2Nk2UsewvmpLWzTLO/s320/potencia2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;El diodo D1 se utiliza para proteger
al microcontrolador. El MOC3031 es un optotriac que enviará una señal de
activación al triac U6 cuando la salida del circuito de control sea 1 lógico (5
V), lo cual hará que el bombillo se encienda; caso contrario, si la salida del
circuito de control es 0 lógico (0 V) el bombillo no se encenderá.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b style=&quot;text-align: justify;&quot;&gt;Circuito Completo&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibNEXVHzeK_hspPfOHkMtUgoZNHbQx4qALHAczLN95x2o3TUkVi6ORMvSWrE9Qhfnuqn21GC5RbWYBXKIG5t68SH3VGpCYFA3NHgEYu4IFxO45L51CBI16n-CDEiN4Yy4I8EAI0TzDEyqo/s1600/completo2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;224&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibNEXVHzeK_hspPfOHkMtUgoZNHbQx4qALHAczLN95x2o3TUkVi6ORMvSWrE9Qhfnuqn21GC5RbWYBXKIG5t68SH3VGpCYFA3NHgEYu4IFxO45L51CBI16n-CDEiN4Yy4I8EAI0TzDEyqo/s320/completo2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Programa en Basic&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;$regfile = &quot;m8def.dat&quot;     &#39;ATmega8
$crystal = 8000000         &#39;Frecuencia de cristal=8 MHz
$hwstack = 32              &#39;Hardware Stack
$swstack = 10              &#39;Software Stack
Config Portb = Output      &#39;Puerto B como salida
Config Portc = Input       &#39;Puerto C como entrada

&#39;Definicion de variables

Dim Sensor As Word         &#39;Dato medido en ADC1=Sensor
Dim Ref As Word            &#39;Dato medido en ADC0=Referencia
Dim Ek As Single           &#39;Error actual
Dim Ek_1 As Single         &#39;Error anterior
Dim Pk As Single           &#39;Componente Proporcional
Dim Ik As Single           &#39;Componente Integral actual
Dim Ik_1 As Single         &#39;Componente integral anterior
Dim Kp As Single           &#39;Ganancia Proporcional
Dim Ki As Single           &#39;Ganancia Integral
Dim Uk As Single           &#39;Señal de control
Dim Uk_dig As Word
Dim Ukmax As Word          &#39;Límite máximo de Uk
Dim Ukmin As Word          &#39;Límite mínimo de Uk
Dim T As Single            &#39;Periodo de muestreo
Dim Rampa As Word          &#39;Señal escalón

&#39;Configuracion ADC

Config Adc = Single , Prescaler = Auto
&#39;Configuracion de unterrupciones
Config Timer1 = Timer , Prescale = 256                      &#39;Configuración TIMER1, f=31.25 KHz
On Compare1a Int_timer1                                     &#39;Interrupción por comparación
Enable Compare1a                                            &#39;Habilitación interrupción por comparación
Config Int1 = Low Level                                     &#39;INT1, flanco de bajada
On Int1 Int_zc                                              &#39;Interrupción externa INT1
Enable Int1                                                 &#39;Habilitación INT1
Enable Interrupts                                           &#39;Habilitación global de interrupciones

Timer1 = 0
Stop Timer1


&#39;Programa principal
   Ik_1 = 0
   Ek_1 = 0
   T = 0.0083       &#39;Periodo de muestreo T=1/120=0.0083 s
   Kp = 1
   Ki = 0.04
   Ukmax = 32       &#39;Ukmax=32 escalones
   Ukmin = 0        &#39;Ukmin=0 escalones
   Rampa = 0                                                &#39;Reinicialización de Rampa
 Do
   nop              &#39;Bucle infinito
 Loop

&#39;Rutinas de interrupción

&#39;Interrupcion cruce por cero
 Int_zc:
   Stop Timer1
   Timer1 = 0       &#39;Reinicialización de Timer1
   Compare1a = 7                                            &#39;Interrupción cada 7*1/31250= 0.22 ms = 7.5ms/32
   Rampa = 0        &#39;Reiniciar Rampa en cada Interrupción
   Portb.0 = 0      &#39;Señal a Triac =0
   &#39;Obtensión de señales Referencia y Sensor
   Start Adc
   Ref = Getadc(0)
   Sensor = Getadc(1)
   Stop Adc
   &#39;control PI
   Ek = Ref - Sensor
   Pk = Ek * Kp         &#39; P(k)=Kp*e(k)
   Ik = Ek + Ek_1       &#39; I(k)=I(k-1)+Ki*T*(e(k)+e(k-1))/2
   Ik = Ki * Ik
   Ik = Ik * T
   Ik = Ik / 2
   Ik = Ik + Ik_1
   Uk = Pk + Ik         &#39; u(k)=P(k)+I(k)
   Uk_dig = Uk + 1023   &#39; Ajuste en rango 0 - 32 escalones
   Uk_dig = Uk_dig / 63
   Ek_1 = Ek
   Ik_1 = Ik

   &#39;limitación de rango de señal de control
   If Uk_dig &amp;gt; Ukmax Then
      Uk_dig = Ukmax
   Elseif Uk_dig &amp;lt; Ukmin Then
      Uk_dig = Ukmin
   End If

   Start Timer1
   Return

&#39;Interrupcion Timer  cada 0.22 ms 32 escalones por semiciclo
  Int_timer1:
   Stop Timer1
   Timer1 = 0         &#39;Reiniciar Timer1
   Rampa = Rampa + 1                                             &#39;Incrementar rampa por cada interrupción

   &#39;Determinar instante en que se envia señal al TRIAC
   If Uk_dig &amp;gt; Rampa Then
      Portb.0 = 0     &#39;Señal a Triac = 0
   Else
      Portb.0 = 1     &#39;Señal a Triac =1
   End If

   Return

End&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Funcionamiento:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
El funcionamiento del programa es el siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Se establece un nivel de iluminación deseado en un ambiente mediante el potenciómetro RV1.&lt;/li&gt;
&lt;li&gt;La iluminación se debe mantener en el nivel deseado, ya sea por acción del bombillo o por fuentes externas, como por ejemplo luz solar.&lt;/li&gt;
&lt;li&gt;El programa principal no realiza ninguna operación (se puede implementar alguna rutina). El control se realiza mediante una rutina de interrupción, por lo que no se tendrá al microcontrolador ocupado todo el tiempo.&lt;/li&gt;
&lt;li&gt;La rutina de interrupción, que se ejecuta en cada cruce por cero de la señal de potencia, consiste en un control PI discreto, en el que se implementan los siguientes algoritmos:&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX_CrzgiU2yXpuHqHHOO58JRQE3XH4_8OP3LRpVUOSWANPNXLu0SLyM5rcJzbQS04GAczD8Xeo7BGWeuBpvOnaYfBRHmZPX1fGQi0M29RXNCEbRWG_aRTdB5yGaJ0XXLJGBu4N3gXRUX2D/s1600/pi.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;138&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX_CrzgiU2yXpuHqHHOO58JRQE3XH4_8OP3LRpVUOSWANPNXLu0SLyM5rcJzbQS04GAczD8Xeo7BGWeuBpvOnaYfBRHmZPX1fGQi0M29RXNCEbRWG_aRTdB5yGaJ0XXLJGBu4N3gXRUX2D/s320/pi.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Se debe determinar el periodo de muestreo:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 21.3pt; mso-add-space: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 21.3pt; mso-add-space: auto;&quot;&gt;
&amp;nbsp; La
señal de interrupción se genera en los cruces por cero. En la rutina de
interrupción se obtienen las &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 21.3pt; mso-add-space: auto;&quot;&gt;
&amp;nbsp; señales del ADC, por lo tanto el periodo de
muestreo es igual al periodo de los pulsos de interrupción:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 21.3pt; mso-add-space: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 21.3pt; mso-add-space: auto;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; T=1 / (120 Hz) = 8.33 ms&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;margin-left: 21.3pt; mso-add-space: auto;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Se implementa una segunda rutina de interrupción por comparación que se ejecuta 32 veces en cada semiciclo de la señal de potencia. En cada interrupción una señal rampa se incrementa en una unidad y se reinicia en cada interrupcion de cruce por cero.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr90_SMn8meChHYxKeaM2Iin_3DlrcUCThnL-wKk80rr8pIbRjK9dJdrJtaKa0YE24SQReU2owRmdALOh6ZLQc8UoNRy1Um0aWRemAtoFDLA4d0ielImv_vtKEkFAMq4HPnd1hjzGX6DW0/s1600/rampa.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr90_SMn8meChHYxKeaM2Iin_3DlrcUCThnL-wKk80rr8pIbRjK9dJdrJtaKa0YE24SQReU2owRmdALOh6ZLQc8UoNRy1Um0aWRemAtoFDLA4d0ielImv_vtKEkFAMq4HPnd1hjzGX6DW0/s320/rampa.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Se determina el valor en Compare1a:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;El programa debe ejecutar una interrupción por comparación cada:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; t = 7.5 ms / (32 escalones) = 0.23 ms&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Frecuencia de Tiner1:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;f = 8 MHz/256 = 31.25 KHz&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Valor numérico en Compare1a:&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Compare1a = 0.23 · 10^(-3) · 31.25 · 10^(3) = 7.18&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Compare1a = 7&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;Esta señal rampa se utiliza junto a la señal de control para determinar el ángulo de disparo del TRIAC.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 3.3pt; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;La
señal de control “Uk” puede tomar un valor 0 -32 dependiendo de la intensidad
de&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;ES&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iluminación&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;ES&quot; style=&quot;line-height: 12pt;&quot;&gt;(mayor intensidad &lt;/span&gt;&lt;span lang=&quot;ES&quot; style=&quot;font-family: Wingdings; line-height: 12pt;&quot;&gt;à&lt;/span&gt;&lt;span style=&quot;line-height: 12pt;&quot;&gt;U&lt;/span&gt;&lt;span style=&quot;line-height: 12pt;&quot;&gt;k mayor y viceversa).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Si Uk &amp;gt; Rampa entonces el TRIAC no se dispara, el bombillo no se enciende.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Si Uk &amp;lt;= Rampa entonces el TRIAC se dispara, el bombillo se enciende.&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;La forma de la señal en el bombillo, que varía según el ángulo de disparo, hace que el&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;voltaje eficáz&amp;nbsp;también varíe; en consecuencia la intensidad de iluminación se controla.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPoCUKOceseTl0rujG-XeuXXkWJqotLpUaqz0RDq1PLs-kwqfNOOtVMlufi_N96N22x5S3om6b7geacVTkydd-HC9la-NnoEhdRxISyMZS-E_-SsrwZxDy_RqQPePHA7G97mX3grr3OMbI/s1600/salida.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPoCUKOceseTl0rujG-XeuXXkWJqotLpUaqz0RDq1PLs-kwqfNOOtVMlufi_N96N22x5S3om6b7geacVTkydd-HC9la-NnoEhdRxISyMZS-E_-SsrwZxDy_RqQPePHA7G97mX3grr3OMbI/s320/salida.png&quot; width=&quot;156&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/2465738314504810233/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2012/09/control-pi-discreto-de-iluminacion-con.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/2465738314504810233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/2465738314504810233'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2012/09/control-pi-discreto-de-iluminacion-con.html' title='Control PI discreto de iluminacion con ATmega8a'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAJTVISkt9ZRtX_0WywaY2EeouXjSXZfvUmOXJQWksp9XoFEevkTw4hvuPzyMO95VX5HCgIT1y5IcnPIDwhZcGJntg-SDgaxTBpBs80qd14fyYEdamK1Z1z-iBkDWETdWGjwHCuUf43IDo/s72-c/sin1.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-2269973938676659666</id><published>2012-09-25T17:38:00.000-05:00</published><updated>2012-09-25T19:07:42.138-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 basic"/><category scheme="http://www.blogger.com/atom/ns#" term="control de temperatura"/><category scheme="http://www.blogger.com/atom/ns#" term="control digital microcontrolador"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="proyecto potencia microcontrolador"/><category scheme="http://www.blogger.com/atom/ns#" term="temperatura atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="temperatura avr"/><title type='text'>Control de Temperatura con ATmega8a</title><content type='html'>&lt;span style=&quot;text-align: justify;&quot;&gt;Este circuito se implementa para
mantener un ambiente dentro de un rango de temperatura, el caso más práctico es
una incubadora. El controlador se encargará de hacer las correcciones
necesarias cuando el sistema no cumpla las condiciones deseadas.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;En este caso, el controlador de
temperatura tendrá el papel de calefactor; ya que cuando el ambiente disminuya su
temperatura respecto de la mínima del rango, el controlador se activará y lo calentará
hasta que la temperatura regrese al intervalo. Ahora, cuando el sector aumente
su temperatura respecto de la máxima del rango, el circuito se desactivará
dejando de calentarlo para que éste se enfríe con el ambiente.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;Para proveer de calor el sector
mencionado se utilizará un bombillo incandescente el cuál se encenderá y
apagará según sea el caso.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;Etapas&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;Sensor de temperatura y acondicionamiento:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwSGHr2jPPOCY1-nqKV1neiNxhe1GZpKGFb6j-r2qqrl-RZUNm-JEpN65lBBuurlBcQjc9U9tzVbc7Txvj0tBHrdqy5VjwFpa7ueyc4u9rxLAgRM89uzJZm0QHWgPdqS5ulSH18n40WF2h/s1600/sensor.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;229&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwSGHr2jPPOCY1-nqKV1neiNxhe1GZpKGFb6j-r2qqrl-RZUNm-JEpN65lBBuurlBcQjc9U9tzVbc7Txvj0tBHrdqy5VjwFpa7ueyc4u9rxLAgRM89uzJZm0QHWgPdqS5ulSH18n40WF2h/s320/sensor.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;El LM35 es un sensor de temperatura
que, según la configuración utilizada, entrega en su salida 10mV/&lt;sup&gt;o&lt;/sup&gt;C;
es decir, si la temperatura es de 25&lt;sup&gt;o&lt;/sup&gt;C entonces la salida será 0.25
V. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;El ADC del microcontrolador trabaja
en el rango 0 – 5V, por lo tanto, para aprovechar mejor su sensibilidad, debemos
amplificar la señal del LM35 10 veces. Es por ello que se utiliza el
amplificador activo que puede implementarse en la configuración mostrada o
utilizar la configuración básica con un LM741.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;b&gt;Referencia&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjurRstDRxuqqms0P6WxZV0n1TI4vavMVtfhtM08U7OLYzBaXIal9WYlxFVjnbdpOuIkwqSQb7FbkSLrEpB988bOIDiaHWQizAibz5QTJEAvEpyk_8YNRIZsivnZN1KVAEwCTzbjeyCATKc/s1600/referencia.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjurRstDRxuqqms0P6WxZV0n1TI4vavMVtfhtM08U7OLYzBaXIal9WYlxFVjnbdpOuIkwqSQb7FbkSLrEpB988bOIDiaHWQizAibz5QTJEAvEpyk_8YNRIZsivnZN1KVAEwCTzbjeyCATKc/s320/referencia.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;Este potenciómetro se utilizará para
elegir la temperatura de referencia que se requiera mantener. También irá
conectado a uno de los pines ADC del microcontrolador.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;Control&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT_GWezrfGl-yvK0ALfA4bpAI93kwfZvHBrA1chOifsOoR7BmCDCy_ZYsa5c_Fc9E4TMmh9Jf-rbPLcPNwLq1QXtgGi8UmS4FvvQzdXc5opZ_Bb7FL98PBql_yr7NqzesK7GB3NdeJRX3u/s1600/control.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;204&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT_GWezrfGl-yvK0ALfA4bpAI93kwfZvHBrA1chOifsOoR7BmCDCy_ZYsa5c_Fc9E4TMmh9Jf-rbPLcPNwLq1QXtgGi8UmS4FvvQzdXc5opZ_Bb7FL98PBql_yr7NqzesK7GB3NdeJRX3u/s320/control.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;El esquema muestra las conexiones de
los pines del microcontrolador.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b style=&quot;text-align: justify;&quot;&gt;Circuito de potencia&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqD5WC5GdMY0UffE4OgHzkvuDozx8YeqTb-cJomDQylpPwO_Zj1cMPM2PMYuHImH8ZppcFjXZNZKjqVx0hmdtzz9zI0clkpzGEw3xbRFQoWFwSEKQ8s-cPeiGvQRdsn1Hx3LfiyNwBT6kg/s1600/potencia.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqD5WC5GdMY0UffE4OgHzkvuDozx8YeqTb-cJomDQylpPwO_Zj1cMPM2PMYuHImH8ZppcFjXZNZKjqVx0hmdtzz9zI0clkpzGEw3xbRFQoWFwSEKQ8s-cPeiGvQRdsn1Hx3LfiyNwBT6kg/s320/potencia.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;El diodo D1 se utiliza para proteger
al microcontrolador. El MOC3031 es un optotriac que enviará una señal de
activación al triac U6 cuando la salida del circuito de control sea 1 lógico (5
V), lo cual hará que el bombillo se encienda; caso contrario, si la salida del
circuito de control es 0 lógico (0 V), el bombillo no se encenderá.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;Circuito Completo&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLrjaZZaJVH_13pOZ_wPG6mDOwbVTGPo0_ZJaHjo1p6807Kgj-amleueiiIU8V6g1zD2QzIh3xGqJSzey7pQqnpQmEgJM8232u4Eda3AiKcndMqi1ZBuU39XIeJnKCph43DQdl5egjUUNy/s1600/completo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLrjaZZaJVH_13pOZ_wPG6mDOwbVTGPo0_ZJaHjo1p6807Kgj-amleueiiIU8V6g1zD2QzIh3xGqJSzey7pQqnpQmEgJM8232u4Eda3AiKcndMqi1ZBuU39XIeJnKCph43DQdl5egjUUNy/s320/completo.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;Programa en Basic&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&#39;configuracion de microcontrolador
$regfile = &quot;m8def.dat&quot;                                      &#39;Microcontrolador a utilizar
$crystal = 8000000                                          &#39;Frecuencia de oscilador interno =8 MHz
$hwstack = 32                                               &#39;Hardware stack
$swstack = 10                                               &#39;Software stack
Config Timer1 = Timer , Prescale = 64                       &#39;Configuracion de TIMER1 F=Fosc/64
Config Portb = Output                                       &#39;Puerto B como salida
Config Adc = Single , Prescaler = Auto                      &#39;Configuracion de ADC

&#39;Definicion de variables
Dim Vsensor As Word
Dim Vref As Word
Dim Tmin As Single
Dim Tmax As Single
Dim Tempref As Single
Dim Temp As Single

&#39;Habilitacion de interrupcion por comparacion
Enable Interrupts
On Compare1a Interrupcion
Enable Compare1a

&#39;Inicializacion de registros para comparacion
Timer1 = 0
Compare1a = 62500

&#39;Programa principal
Do
   nop                                                      &#39;Ninguna operacion
Loop

&#39;Rutina de interrupcion
Interrupcion:

 &#39;Rutina de ADC
 Start Adc                                                  &#39;Iniciar ADC
 Vsensor = Getadc(1)                                        &#39;Vsensor= Canal 1 de ADC
 Vref = Getadc(0)                                           &#39;Vref= Canal 0 de ADC
 Stop Adc

 &#39;Convertir valor obtenido de ADC a valor de temperatura
 Temp = Vsensor / 1023
 Temp = Temp * 50
 Tempref = Vref / 1023
 Tempref = Tempref * 50

 &#39;Establecimiento de rango de temperatura
 Tmin = Tempref - .5
 Tmax = Tempref + .5

 &#39;Control de temperatura en rango Tempref +/- 2
 If Temp &amp;lt; Tmin Then                                        &#39;Si Temp&amp;lt;Tmin encender foco
   Portb.6 = 1
   Portb.5 = 0
 Elseif Temp &amp;gt; Tmax Then                                    &#39;Si Temp&amp;gt;Tmax apagar foco
   Portb.6 = 0
   Portb.5 = 0
   If Temp &amp;gt; 32 Then
      Portb.5 = 1
   End If
 End If

 &#39;Reinicializacion de registros para comparacion
 Timer1 = 0
 Return                                                     &#39;Retorno de interrupción

End                                                         &#39;Fin de programa&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Funcionamiento&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
El funcionamiento del programa es el siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Se establece una temperatura de referencia mediante el potenciómetro RV2.&lt;/li&gt;
&lt;li&gt;la temperatura se mantendrá en el rango Trmpref +/- 0.1ºC.&lt;/li&gt;
&lt;li&gt;La rutina principal no realiza ninguna operación, en este caso, pero si se desea se podría mantener al microcontrolador realizando alguna tarea y el control de temperatura sólo será una rutina de interrupción que no lo mantendrá ocupado todo el tiempo.&lt;/li&gt;
&lt;li&gt;La rutina de interrupción se ejcutará cada 0.5s, hace falta calcular el valor en Comapare1a: &amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Symbol; line-height: 12pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-align: justify; text-indent: -18pt;&quot;&gt;Se requiere que la rutina de interrupción se ejecute cada 0.5 s.&lt;/span&gt;&lt;span style=&quot;font-size: 7pt; text-align: justify; text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;font-size: 7pt; line-height: normal; text-indent: -18pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-bottom: 0cm; text-align: justify; text-indent: -18pt;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; line-height: 12pt; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;La frecuencia del TIMER1 es:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;f=fosc/64=8 MHz / 64 = 125 KHz&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;La cuenta en el TIMER1debe llegar hasta un
cierto valor, inicializado en COMPARE1A&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; line-height: 12pt; text-indent: -18pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;en
0.5 s&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;para &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;que se ejecute la rutina de interrupción.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 16px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; N·T = N / f = 0.5 s&lt;/span&gt;&lt;span style=&quot;line-height: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l1 level1 lfo2; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;N = 0.5 · f=0.5 · 125000&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span lang=&quot;ES&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;N = 62500&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 12pt;&quot;&gt;Se sensa la temperatura de referencia y de salida del sistema. El ADC lo convierte a un valor digital de 0 - 1023. Es necesario llevarlo al rango 0 - 50ºC:&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Symbol; line-height: 12pt; text-align: justify; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-align: justify; text-indent: -18pt;&quot;&gt;El ADC entrega un valor 0 – 1023d
correspondiente a 0 – 5 V respectivamente, entonces:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoListParagraph&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Vadc=Vin · 1023 / 5&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Vin = 5·Vadc / 1023&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;margin-bottom: 0cm; text-align: justify; text-indent: -18pt;&quot;&gt;
&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;line-height: 16px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt;&quot;&gt;En este caso el valor numérico de
temperatura es 10 veces el valor numérico de voltaje,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; es decir:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Temp = 10· Vin&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; line-height: 12pt; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; line-height: 12pt; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;font-family: Symbol; line-height: 12pt; text-indent: -18pt;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; line-height: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;Por lo tanto para obtener el valor
numérico de temperatura&lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;line-height: 12pt; text-indent: -18pt;&quot;&gt;se realizan las
operaciones:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l0 level1 lfo1; text-align: justify; text-indent: -18.0pt;&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Temp=50·Vadc/1023&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 12pt;&quot;&gt;En la rutina de interrupción se observa &amp;nbsp;que se crea un rango Tmin - Tmax. en el que se quiere mantener al sistema.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 12pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Si Temp&amp;lt;Tmin entonces se enciende el bombillo para que actúe como calefactor.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Si Temp&amp;gt;Tmax entonces se apaga el bombillo para que el ambiente baje de temperatura.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;span style=&quot;line-height: 12pt;&quot;&gt;El proceso se repite indefinidamente, pero si por alguna razón se sobrepasara una temperatura máxima,&lt;/span&gt;&lt;span style=&quot;line-height: 12pt;&quot;&gt;&amp;nbsp;en este caso 32ºC, se activará una alarma en el pin 5 del Puerto B.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.0pt; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/2269973938676659666/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2012/09/control-de-temperatura-con-atmega8a.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/2269973938676659666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/2269973938676659666'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2012/09/control-de-temperatura-con-atmega8a.html' title='Control de Temperatura con ATmega8a'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwSGHr2jPPOCY1-nqKV1neiNxhe1GZpKGFb6j-r2qqrl-RZUNm-JEpN65lBBuurlBcQjc9U9tzVbc7Txvj0tBHrdqy5VjwFpa7ueyc4u9rxLAgRM89uzJZm0QHWgPdqS5ulSH18n40WF2h/s72-c/sensor.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-1779287801222668579</id><published>2011-12-20T21:20:00.002-05:00</published><updated>2011-12-20T21:20:06.100-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="2.5G"/><category scheme="http://www.blogger.com/atom/ns#" term="2.75G"/><category scheme="http://www.blogger.com/atom/ns#" term="EDGE"/><category scheme="http://www.blogger.com/atom/ns#" term="Enhanced Data rates for GSM Evolution"/><category scheme="http://www.blogger.com/atom/ns#" term="General Packet Radio Service"/><category scheme="http://www.blogger.com/atom/ns#" term="GPRS"/><category scheme="http://www.blogger.com/atom/ns#" term="Varios"/><title type='text'></title><content type='html'>&lt;div id=&quot;__ss_10642934&quot; style=&quot;width: 425px;&quot;&gt;
&lt;strong style=&quot;display: block; margin: 12px 0 4px;&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/lonely113/general-packet-radio-service-10642934&quot; target=&quot;_blank&quot; title=&quot;General packet radio service&quot;&gt;General packet radio service&lt;/a&gt;&lt;/strong&gt; &lt;iframe frameborder=&quot;0&quot; height=&quot;355&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/10642934&quot; width=&quot;425&quot;&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;div style=&quot;padding: 5px 0 12px;&quot;&gt;
View more &lt;a href=&quot;http://www.slideshare.net/&quot; target=&quot;_blank&quot;&gt;presentations&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/lonely113&quot; target=&quot;_blank&quot;&gt;Percy Julio Chambi Pacco&lt;/a&gt; &lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/1779287801222668579/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/12/general-packet-radio-service-view-more.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1779287801222668579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1779287801222668579'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/12/general-packet-radio-service-view-more.html' title=''/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-4926720921507593238</id><published>2011-10-08T11:13:00.000-05:00</published><updated>2012-03-05T23:26:44.565-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 teclado 4x4"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="teclado con AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="teclado matricial 4x4"/><title type='text'>Teclado Matricial 4x4</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://1.bp.blogspot.com/-1zUcP8tDNCU/TpByc8S5XJI/AAAAAAAAAKk/urDqCQtO0uY/s1600/teclado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
Es
 un dispositivo de entrada que consiste en un arreglo matricial de 16 
teclas (pulsadores). Dispone de un conector SIL (Single In Line) de 8 
pines: 4 filas y 4 columnas. La interconexión de los pulsadores es como 
se muestra en la imagen:&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVZLP9enz8qKGY_Y-DVohBnp7Rfx_jihTRqG2tG5wfaRPwuGOVm235FXCQbj6sYwYqg-IJNeCHZe7-t46A9AadxNvztHXAf23TOBGj3qKhWDsBsPJCo60yvSIHNL0_AqxrkSsYijJ4Uuo/s1600/Teclado.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVZLP9enz8qKGY_Y-DVohBnp7Rfx_jihTRqG2tG5wfaRPwuGOVm235FXCQbj6sYwYqg-IJNeCHZe7-t46A9AadxNvztHXAf23TOBGj3qKhWDsBsPJCo60yvSIHNL0_AqxrkSsYijJ4Uuo/s320/Teclado.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
Cuando
 se presiona una tecla se conecta una fila con una columna. La manera de
 averiguar la tecla presionada consiste en enviar un nivel lógico a una 
de las filas (diferente al nivel de las filas restantes) y buscar la 
columna por la que se recibe el mismo nivel lógico. De esta manera se 
obtiene la fila y columna al igual que en una matriz.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
El diagrama de conexión típico al ATmega8 es el siguiente:&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi05vrFDyCM4LFKCDpe19-TqclkC4y2vTEZl54tpBJvI-UOYRvLXYyGOacR_l7DL_d_cJU3okaVl63_zY4LCqE17m-YIeebru-fuI35tTAsSxr1hzzUllvnY_I_1RPSclEMVFv2yJvlgB4a/s1600/teclado.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;174&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi05vrFDyCM4LFKCDpe19-TqclkC4y2vTEZl54tpBJvI-UOYRvLXYyGOacR_l7DL_d_cJU3okaVl63_zY4LCqE17m-YIeebru-fuI35tTAsSxr1hzzUllvnY_I_1RPSclEMVFv2yJvlgB4a/s320/teclado.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
Las
 resistencias de 1K son necesarias para evitar hacer un cortocircuito 
accidental si se comparten los mismos pines del PIC con otro periférico,
 como por ejemplo un Display o un LCD.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
Las resistencias de 10K son necesarias para asegurar el nivel lógico 0 en las entradas del ATmega8.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;Algoritmo de búsqueda:&lt;/b&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Los pines PD0-PD3 se configuran como Salidas. Los pines PD4-PD7 se configuran como Entradas.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Las filas del teclado se conectan a los pines PD0-PD3 y las columnas a los pines PD4-PD7.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se envía “0” a todas las filas. &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se envía “1” a la primera fila.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se
 verifica el nivel lógico en cada una de las columnas. Si se pulsó una 
tecla de la primera fila se obtendrá un “1” en la columna 
correspondiente.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Si no se encuentra un “1” (no se pulsó tecla en la primera fila) se envía un&amp;nbsp; “1” a la siguiente fila (a las filas restantes se envía “0”).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se verifican las columnas en busca del nivel lógico “1”.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;El procedimiento continúa hasta completar las 4 filas.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Conociendo la fila por la que se envió “1” y conociendo la columna por la que se recibe “1” se puede conocer la tecla pulsada.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;Programa Para ATmega8:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
El
 programa lee la tecla pulsada en un teclado matricial 4x4 y 
simultáneamente muestra la última tecla pulsada en un display de 7 
segmentos. &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;Diagrama de Conexión: &lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVO5mMSvXbruxqPDYuI6pjubuq5szhzI6uPf62ES6bcJC5dItq-lCN3ZWde3n87GeTwn6_PawQKJl_gDcX4Z3w3Y1bAcDBc68A0BVn3-euYN0RTWkYJ6Nc5vr_7iiXNfeBR36pNMqD3Mpt/s1600/teclado_display.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVO5mMSvXbruxqPDYuI6pjubuq5szhzI6uPf62ES6bcJC5dItq-lCN3ZWde3n87GeTwn6_PawQKJl_gDcX4Z3w3Y1bAcDBc68A0BVn3-euYN0RTWkYJ6Nc5vr_7iiXNfeBR36pNMqD3Mpt/s320/teclado_display.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;Programa en Assembler:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;---------------------------------------------------------
;Autor: LONELY113
; http://lonely113.blogspot.com
;
;Programa para control de teclado matricial 4x4 
;Adicionalmente muestra la tecla pulsada en un display
;Para teclado: Salida: PD0-PD3
;        Entradas: PD4-PD7
;Para Display: Salidas: PD1-PD7 (7 segmentos)
;        PC0 (Habilitacion catodo comun)
;Oscilador interno de 8 MHz
;---------------------------------------------------------
.nolist
.include &quot;m8def.inc&quot;
.list
.device  atmega8

.def KEY=r17
.def TEMP=r18
.def COUNT=r19
.def CHAR=r20
.def ROW=r21

.org 0x0000

; Inicializacion de stack

 ldi r16,HIGH(RAMEND)
 out SPH,r16
 ldi r16,LOW(RAMEND)
 out SPL,r16

; Fin inicializacion de Stack

; Inicio de programa

 ldi r16,0x01
 out DDRC,r16  ; PC0 como salida
 ldi r16,0x0F
 out DDRD,r16  ; PD7-PD4 como entradas, PD3-PD0 como salidas
 sbi PORTC,0
 clr TEMP
BEGIN: clr KEY
 inc KEY
 ldi ROW,0x01
 out PORTD,ROW
KEY_V: nop
 sbic PIND,4         ; Verifica tecla pulsada en columna 1
 rjmp CON2  ; Ir a CON2 si se pulsa tecla
 inc KEY  ; Incrementar KEY si no se pulsa tecla
 sbic PIND,5  ; Verifica tecla pulsada en columna 2
 rjmp CON2  ; Ir a CON2 si se pulsa tecla
 inc KEY  ; Incrementar KEY si no se pulsa tecla
 sbic PIND,6  ; Verifica tecla pulsada en columna 3
 rjmp CON2  ; Ir a CON2 si se pulsa tecla
 inc KEY  ; Incrementar KEY si no se pulsa tecla
 sbic PIND,7  ; Verifica tecla pulsada en columna 4
 rjmp CON2  ; Ir a CON2 si se pulsa tecla
 inc KEY  ; Incrementar KEY si no se pulsa tecla
 cpi KEY,0x11
 brbs 1,CON1  ; Comprueba si llego a ultima tecla
 lsl ROW
 out PORTD,ROW
 rjmp KEY_V
CON1: clr KEY
 rjmp DISP
CON2: mov TEMP,KEY ; Retiene ultima tecla pulsada
DISP: ldi r16,0xFF
 out DDRD,r16 ; PORTD como salida
 rcall CONV
 out PORTD,CHAR
 cbi PORTC,0
 nop
 sbi PORTC,0
 ldi r16,0x0F
 out DDRD,r16 ; PD7-PD4 como entradas, PD3-PD0 como salidas
 clr r16
 out PORTD,r16
 out PIND,r16
 rjmp BEGIN

; Subrutinas

CONV: ldi ZH,HIGH(2*TABLE)
 ldi ZL,LOW(2*TABLE)
 add ZL,TEMP
 lpm
 mov CHAR,r0
 ret

; Tabla de datos

TABLE:
.DB 0x00,0x0C,0xB6,0x9E,0xE2,0xCC,0xDA,0xFA,0xF2,0x0E,0xFE,0xDE,0xBC,0xEE,0x7E,0xF8,0x72&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt; &lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt; &lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt; &lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;b&gt;Archivos de Programa:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12pt; margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;a href=&quot;http://www.mediafire.com/?14siquityii8a72&quot;&gt;Descargar&lt;/a&gt;&lt;b&gt; &lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/4926720921507593238/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/10/teclado-matricial-4x4.html#comment-form' title='10 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/4926720921507593238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/4926720921507593238'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/10/teclado-matricial-4x4.html' title='Teclado Matricial 4x4'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVZLP9enz8qKGY_Y-DVohBnp7Rfx_jihTRqG2tG5wfaRPwuGOVm235FXCQbj6sYwYqg-IJNeCHZe7-t46A9AadxNvztHXAf23TOBGj3qKhWDsBsPJCo60yvSIHNL0_AqxrkSsYijJ4Uuo/s72-c/Teclado.jpg" height="72" width="72"/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-5012532853128877045</id><published>2011-10-08T10:48:00.002-05:00</published><updated>2012-03-05T23:25:58.242-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 assembler multiplexaje"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR assembler multiplexaje"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y display"/><category scheme="http://www.blogger.com/atom/ns#" term="multiplexaje de display AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="multiplexaje display Atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><title type='text'>Multiplexaje de Display con Desplazamiento de Caracteres</title><content type='html'>Programa para ATmega8&lt;br /&gt;
&lt;br /&gt;
El programa consiste en mostrar una serie caracteres en 4 display multiplexados.&lt;br /&gt;
los caracteres se muestran en grupos de 4 y se desplazan a la izquierda.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Diagrama de Conexión:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8no8rRAis1hrk3L7HgNhGT7oB0IHN11-SmzElwRIJijzZJhiDZxs8zNBcoQR6zgTsQ7JUpEUlQY_dE1Vh8QJbRxX8PJQHunLWnSRg1Kgg0jaY5luGsczNVOdjAGxiSXw3OcpK-55Qu32/s1600/multiplexaje.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8no8rRAis1hrk3L7HgNhGT7oB0IHN11-SmzElwRIJijzZJhiDZxs8zNBcoQR6zgTsQ7JUpEUlQY_dE1Vh8QJbRxX8PJQHunLWnSRg1Kgg0jaY5luGsczNVOdjAGxiSXw3OcpK-55Qu32/s320/multiplexaje.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Funcionamiento:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;
&lt;li&gt;Aplicando un procedimiento de multiplexaje se muestran los primeros 4 caraceres (CHAR1, CHAR2, CHAR3 y CHAR4).&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;
&lt;li&gt;transcurrido un tiempo tal que
 el ojo pueda captar los caracteres se desplaza la cadena hacia la 
izquierda y se muestran los siguientes 4 caracteres (CHAR2, CHAR3, 
CHAR4, CHAR5).&amp;nbsp; &lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;
&lt;li&gt; El programa comprueba si se mostraron todos los caracteres y cuando esto ocurre el proceso se repite.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Programa en Assembler:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;;-----------------------------------------------------------
;Autor: LONELY113
;  http://lonely113.blogspot.com
;
;Programa para multiplexar 4 display
;Muestra mensaje LONELY113 con desplazamiento a la izquierda
;Salidas: Puerto D (PD1-PD7) 7 segmentos de display
;   Puerto A (PB0-PB3) habilitacion de display 
;Tipo de display: Catodo comun
;Calibrado para oscilador interno de 8 MHz
;-----------------------------------------------------------
.nolist
.include &quot;m8def.inc&quot;
.list
.device  atmega8

.def CHAR=r1
.def COUNT1=r20
.def COUNT2=r21
.def COUNT3=r22
.def TEMP=r18

.org 0x0000

;Inicializacion de Stack
 ldi r16,HIGH(RAMEND)
 out SPH,r16
 ldi r16,LOW(RAMEND)
 out SPL,r16
; Fin inicializacion de Stack

; Inicio de programa

 ldi r16,0xFF
 out DDRB,r16  ;PORTB como salida de habilitacion
 ldi r16,0xFF
 out DDRD,r16  ;PORTD como salida a displays
 ldi r16,0x0F
 out PORTB,r16 ;Deshabilitacion de displays
 clr r16
 out PORTD,r16
 clr CHAR
 ldi COUNT1,0xFF ; Inicia contadores
 ldi COUNT2,0x20
 ldi COUNT3,0x10
BEGIN: rcall CONVER
 out PORTD,TEMP
 cbi PORTB,3
 nop   ; Habilita display 4
 sbi PORTB,3
 inc CHAR
 rcall CONVER
 out PORTD,TEMP
 cbi PORTB,2
 nop   ; Habilita display 3
 sbi PORTB,2
 inc CHAR
 rcall CONVER
 out PORTD,TEMP
 cbi PORTB,1
 nop                ; Habilita display 2
 sbi PORTB,1
 inc CHAR
 rcall CONVER
 out PORTD,TEMP
 cbi PORTB,0
 nop   ; Habilita display 1
 sbi PORTB,0
 ldi r16,0x03
 sub CHAR,r16 
 dec COUNT1  ; Rutina de repeticion de 
 brne BEGIN  ; visualizacion de los 
 ldi COUNT1,0xFF ; 4 caracteres
 dec COUNT2
 brne BEGIN
 ldi COUNT1,0xFF
 ldi COUNT2,0x20
 dec COUNT3
 brne BEGIN
 ldi COUNT1,0xFF     ; Reinicia contadores
 ldi COUNT2,0x20
 ldi COUNT3,0x10
 inc CHAR         ; 4 siguientes caracteres
 ldi r16,0x0D
 cp r16,CHAR
 brne BEGIN
 clr CHAR
 rjmp BEGIN

; Subrutinas

CONVER: ldi ZH,HIGH(2*TABLE)
 ldi ZL,LOW(2*TABLE)
 add ZL,CHAR
 lpm
 mov TEMP,r0
 ret

TABLE:
.DB 0x00,0x00,0x00,0x70,0x7E,0x6E,0xF3,0x70
.DB 0xDC,0x0C,0x0C,0x9E,0x00,0x00,0x00,0x00&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Archivos de Programa:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?zialbu7ljlglj7y&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/5012532853128877045/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/10/multiplexaje-de-display-con.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5012532853128877045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5012532853128877045'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/10/multiplexaje-de-display-con.html' title='Multiplexaje de Display con Desplazamiento de Caracteres'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8no8rRAis1hrk3L7HgNhGT7oB0IHN11-SmzElwRIJijzZJhiDZxs8zNBcoQR6zgTsQ7JUpEUlQY_dE1Vh8QJbRxX8PJQHunLWnSRg1Kgg0jaY5luGsczNVOdjAGxiSXw3OcpK-55Qu32/s72-c/multiplexaje.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-5550314684291093749</id><published>2011-10-08T10:35:00.001-05:00</published><updated>2012-03-05T23:25:33.715-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 assembler multiplexaje"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR assembler multiplexaje"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y display"/><category scheme="http://www.blogger.com/atom/ns#" term="multiplexaje de display AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="multiplexaje display Atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><title type='text'>Multiplexaje de Display</title><content type='html'>Programa para ATmega8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
El programa consiste en controlar la 
visualización simultánea en 4 display cátodo común de 7 segmentos 
utilizando el método de multiplexaje para optimizar el uso de pines del ATmega8 .&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Diagrama de Conexión:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8no8rRAis1hrk3L7HgNhGT7oB0IHN11-SmzElwRIJijzZJhiDZxs8zNBcoQR6zgTsQ7JUpEUlQY_dE1Vh8QJbRxX8PJQHunLWnSRg1Kgg0jaY5luGsczNVOdjAGxiSXw3OcpK-55Qu32/s1600/multiplexaje.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;147&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8no8rRAis1hrk3L7HgNhGT7oB0IHN11-SmzElwRIJijzZJhiDZxs8zNBcoQR6zgTsQ7JUpEUlQY_dE1Vh8QJbRxX8PJQHunLWnSRg1Kgg0jaY5luGsczNVOdjAGxiSXw3OcpK-55Qu32/s320/multiplexaje.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Funcionamiento:&lt;/b&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se deshabilitan todos los displays (PB3-PB0=1111).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se envía dato a mostrar al Puerto D (PD1-PD7).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se habilita el display que mostrará el dato (Por ejemplo Display 1 &lt;span style=&quot;font-family: Wingdings;&quot;&gt;a&lt;/span&gt; PB0=0).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se deshabilita Display (Por ejemplo Display 1 &lt;span style=&quot;font-family: Wingdings;&quot;&gt;a&lt;/span&gt; PB0=1).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;Se envía nuevo dato al Puerto D.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se habilita el display que mostrará el dato.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se deshabilita el display.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;El procedimiento continúa hasta enviar 4 datos a los 4 displays.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Todo
 el proceso se repite endefinidamente. El ojo humano no llega a notar el
 parpadeo de los displays pues ocurre a muy alta frecuencia, por lo 
tanto se percibe como si los 4 displays estuvieran iluminados y 
mostrando los 4 datos simultáneamente.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;El diagrama siguiente muestra el funcionamiento: &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOHvpGVU2nhw_rJt73X9SJrJCEpZpnanf9XZdpXHYp_eKAYJyAYq5z_TeDVT5JBG541hQA4eBhYANpEelqSupUIAMwHxcydWNam2FxIkUCEMAqoXLs5Gmd2h_cwVQP3FrPBtttqCAAJpw/s1600/multiplexaje.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOHvpGVU2nhw_rJt73X9SJrJCEpZpnanf9XZdpXHYp_eKAYJyAYq5z_TeDVT5JBG541hQA4eBhYANpEelqSupUIAMwHxcydWNam2FxIkUCEMAqoXLs5Gmd2h_cwVQP3FrPBtttqCAAJpw/s320/multiplexaje.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Programa en Assembler:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;;-------------------------------------------------------
;Autor: LONELY113
; http://lonely113.blogspot.com
;
;Programa para multiplexar 4 display 
;y mostrar el mensaje HOLA
;Salidas: Puerto D (PD1-PD7) 7 segmentos de display
;   Puerto B (PB0-PB3) habilitacion de display 
;Tipo de display: Catodo comun
;Oscilador interno de 8 MHz
;-------------------------------------------------------
.nolist
.include &quot;m8def.inc&quot;
.list
.device  atmega8

.def TEMP=r17
.def DISP=r18

.org 0x0000
; Inicializacion de Stack
 ldi r16,HIGH(RAMEND)
 out SPH,r16
 ldi r16, LOW(RAMEND)
 out SPL,r16
; Fin inicializacion de Stack

; Inicio de programa
  
 ldi r16,0x0F  ; PORTB habilitacion de displays
 out DDRB,r16  ; PB3-PB0
 ldi r16,0xFF 
 out DDRD,r16  ; PORTB salida a displays
 ldi r16,0x0F
 out PORTB,r16 ; Deshabilita displays
BEGIN: ldi DISP,0x00
 rcall CONVER
 out PORTD,TEMP
 cbi PORTB,3
 nop
 sbi PORTB,3
 inc DISP
 rcall CONVER
 out PORTD,TEMP
 cbi PORTB,2
 nop
 sbi PORTB,2
 inc DISP
 rcall CONVER
 out PORTD,TEMP
 cbi PORTB,1
 nop
 sbi PORTB,1
 inc DISP
 rcall CONVER
 out PORTD,TEMP
 cbi PORTB,0
 nop
 sbi PORTB,0
 rjmp BEGIN

; subrutinas

CONVER: ldi ZH,HIGH(TABLE*2)
 ldi ZL,LOW(TABLE*2)
 add ZL,DISP
 lpm
 mov TEMP,r0
 ret

; Tabla en memoria de programa
TABLE:
.DB 0xEC,0x7E,0x70,0xEE
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Archivos de programa:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?saw8ymiyk780dca&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/5550314684291093749/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/10/multiplexaje-de-display.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5550314684291093749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5550314684291093749'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/10/multiplexaje-de-display.html' title='Multiplexaje de Display'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr8no8rRAis1hrk3L7HgNhGT7oB0IHN11-SmzElwRIJijzZJhiDZxs8zNBcoQR6zgTsQ7JUpEUlQY_dE1Vh8QJbRxX8PJQHunLWnSRg1Kgg0jaY5luGsczNVOdjAGxiSXw3OcpK-55Qu32/s72-c/multiplexaje.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-5145093037710258987</id><published>2011-10-08T10:22:00.000-05:00</published><updated>2012-03-05T23:25:19.467-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="semáforo"/><category scheme="http://www.blogger.com/atom/ns#" term="semáforo assembler atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="semáforo assembler AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="semáforo atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="semáforo AVR"/><title type='text'>Semáforo</title><content type='html'>Programa para ATmega8&lt;br /&gt;
&lt;br /&gt;
Control de 2 semáforos.&lt;br /&gt;
&lt;br /&gt;
-Uso de contadores&lt;br /&gt;
-Subrutina de retardo calibrado a 1 s para oscilador interno de 8 MHz&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Diagrama de conexión:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2ZRjrgCCmVMD7svUckt5nEi1xPgvhVM-YLmZx3a24rHwNW6iqLanLWkW5G15e3OakHykaaSkwouVuJdLr8n0ziNDSuIfc1FGwSdkKyjekmHXjrQk5lt2LRUp_yZpPS2mdQ_kFO8TL1MpD/s1600/semaforo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2ZRjrgCCmVMD7svUckt5nEi1xPgvhVM-YLmZx3a24rHwNW6iqLanLWkW5G15e3OakHykaaSkwouVuJdLr8n0ziNDSuIfc1FGwSdkKyjekmHXjrQk5lt2LRUp_yZpPS2mdQ_kFO8TL1MpD/s320/semaforo.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSLC07Ozt8QdglhqSkL2VdS-Hajgik6iYbrhjZllz2arq_w4Jsdrd7kclvGUgMqVpK5QTRjgFw6zqe5fpTULreKSxUK4wYMoD4tlPHZ__he2lhb0iSo1CkA8wShHe1d66v_BIdyO_dPHQ/s1600/4.+Semaforo.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Funcionamiento:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; La luz Verde dura 25 segundos.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; La Luz Ámbar dura 5 segundos.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; La Luz Roja dura 30 segundos.&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Se crea una variable TIME que se incrementa cada 1 segundo (calibrado mediante contadores para un cristal de 10 MHz).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Symbol;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;Se verifica la variable TIME para cambiar el estado de las luces según el siguiente diagrama:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyEv0HSLGq4KjY6m_WNp5s4J0Kw369PItLfmR7PlrzLZu6CzuJg3Fyx2_3KQu_MHQqMBDr-k9V0Uz2WxD-meWU9Lis5j_Ull3XAtGuSCKT86Y1vMjR54Bc7-mQfsiXwvGjsaZK3aeb7M/s1600/semaforo_tiempos.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;82&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDyEv0HSLGq4KjY6m_WNp5s4J0Kw369PItLfmR7PlrzLZu6CzuJg3Fyx2_3KQu_MHQqMBDr-k9V0Uz2WxD-meWU9Lis5j_Ull3XAtGuSCKT86Y1vMjR54Bc7-mQfsiXwvGjsaZK3aeb7M/s320/semaforo_tiempos.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;Programa en Assembler:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;;---------------------------------------------------------
;Autor: LONELY113
; http://lonely113.blogspot.com
;
;Programa de control de 2 semaforos 
;Salidas: Puerto D (RD0-RD5)
;    RD0=Verde1, RD1=Ambar1, RD2=Rojo1
;   RD3=Verde2, RD4=Ambar2, RD5=Rojo2
;Para reloj interno de 8 MHz
;---------------------------------------------------------

.nolist
.include &quot;m8def.inc&quot;
.list
.device  atmega8

.def COUNT1=r20
.def COUNT2=r21
.def COUNT3=r22
.def TIME=r4
.def STATE=r17

.org 0x0000

; Inicializacion de Stack
 ldi r16,LOW(RAMEND)
 out SPL,r16
 ldi r16,HIGH(RAMEND)
 out SPH,r16
; Fin inicializacion de Stack

; Inicio de programa

 ldi r16,0xFF
 out DDRD,r16 ; Puerto B como salida
 clr TIME
BEGIN: ldi r16,0x00 ; 00 segundos
 cp r16,TIME
 brbs 1,FIRST
 ldi r16,0x19 ; 25 segundos
 cp r16,TIME
 brbs 1,SECOND
 ldi r16,0x1E ; 30 segundos
 cp r16,TIME
 brbs 1,THIRD
 ldi r16,0x37 ; 55 segundos
 cp r16,TIME
 brbs 1,FOURTH
 rjmp FINISH
FIRST: ldi STATE,0x21 ; &#39;00100001&#39;b
 out PORTD,STATE
 rjmp FINISH
SECOND: ldi STATE,0x22 ; &#39;00100010&#39;b
 out PORTD,STATE
 rjmp FINISH
THIRD: ldi STATE,0x0C ; &#39;00001100&#39;b
 out PORTD,STATE
 rjmp FINISH 
FOURTH: ldi STATE,0x14 ; &#39;00010100&#39;b
 out PORTD,STATE
FINISH: nop
 rcall DELAY
 rjmp BEGIN

; Subrutinas

DELAY: ldi COUNT1,0xFF ; Retardo de 1 segundo
 ldi COUNT2,0xFF
 ldi COUNT3,0x29
LOOP: dec COUNT1
 brne LOOP
 ldi COUNT1,0xFF
 dec COUNT2
 brne LOOP
 ldi COUNT1,0xFF
 ldi COUNT2,0xFF
 dec COUNT3
 brne LOOP
 inc TIME
 ldi r16,0x3C ; reiniciar en 60 segundos
 cp r16,TIME
 brne RETURN
 clr  TIME
RETURN: ret&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Archivos de programa:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?e1a5xta0xiarbat&quot;&gt;Descargar&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/5145093037710258987/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/10/semaforo.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5145093037710258987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5145093037710258987'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/10/semaforo.html' title='Semáforo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2ZRjrgCCmVMD7svUckt5nEi1xPgvhVM-YLmZx3a24rHwNW6iqLanLWkW5G15e3OakHykaaSkwouVuJdLr8n0ziNDSuIfc1FGwSdkKyjekmHXjrQk5lt2LRUp_yZpPS2mdQ_kFO8TL1MpD/s72-c/semaforo.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-1659560121153505986</id><published>2011-10-08T10:08:00.001-05:00</published><updated>2012-03-05T23:24:58.295-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y display"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="selección código y visualizacion display AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="selector hexadecimal atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="selector hexadecimal AVR"/><title type='text'>Selección de Código Binario y Visualización</title><content type='html'>Programa para ATmega8&lt;br /&gt;
&lt;br /&gt;
Monitorea la entrada de un código binario (4 bits) y muestra la 
selección en decimal mediante un display.&lt;br /&gt;
&lt;br /&gt;
-Aplicación de Tabla de datos para conversión Hexadecimal a 7 segmentos&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Diagrama de conexión:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK3btIYIDk1KBwYvIUJxKRelp9Feaczjk2pOYprh-5iCEzApbEiZTaEzNSGcpYg9ZVAND4SY91l2k98i8UtHrJF3kcy7oegwM53x6Sv-ZUsN0jWi6kAmP1GwAvi3oIkNYu31LKVk0ovmCy/s1600/display.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;208&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK3btIYIDk1KBwYvIUJxKRelp9Feaczjk2pOYprh-5iCEzApbEiZTaEzNSGcpYg9ZVAND4SY91l2k98i8UtHrJF3kcy7oegwM53x6Sv-ZUsN0jWi6kAmP1GwAvi3oIkNYu31LKVk0ovmCy/s320/display.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Programa en Assembler:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;;---------------------------------------------------------&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;Autor: LONELY113&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;; http://lonely113.blogspot.com&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;Programa que muestra codigo seleccionado en binario&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;en un display catodo comun de 7 segmentos&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;Entradas: Puerto B (Pines PB0-PB3)&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;Salidas: Puerto D (Pines PD1-PD7)&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;Oscilador interno de 8 MHz&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;---------------------------------------------------------&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;.nolist&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;.include &quot;m8def.inc&quot;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;.list&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;.device  atmega8&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;.org 0x0000&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;;Definicion de stack&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; ldi  r25,HIGH(RAMEND)&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; out  SPH,r25&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; ldi  r25,LOW(RAMEND)&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; out  SPL,r25&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;fin definicion de stack&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;BEGIN: ldi r18,0x00 ;RB7-RB0 como entradas&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; out DDRB,r18 &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; ldi r18,0xFF ;RD7-RD0 como salidas&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; out DDRD,r18&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;LOOP: in r17,PINB&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; andi r17,0x0F&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; rcall SAVE&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; out PORTD,r16&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; rjmp LOOP&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;;Subrutinas&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;SAVE: ldi ZH,HIGH(2*TABLA)&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; ldi ZL,LOW(2*TABLA)&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; add ZL,r17&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; lpm&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; mov r16,r0&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; ret&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;;Tabla de conversion hex a 7 segmentos&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;TABLA:&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;.DB 0x7E,0x0C,0xB6,0x9E,0xCC,0xDA,0xFA,0x0E &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;.DB 0xFE,0xDE,0xEE,0xF8,0x72,0xBC,0xF2,0xE2&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;;Fin de tabla&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://www.blogger.com/goog_801260953&quot;&gt;Archivos de Programa:&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?qr3y452nrqrgdlz&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/1659560121153505986/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/10/seleccion-de-codigo-binario-y.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1659560121153505986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1659560121153505986'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/10/seleccion-de-codigo-binario-y.html' title='Selección de Código Binario y Visualización'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK3btIYIDk1KBwYvIUJxKRelp9Feaczjk2pOYprh-5iCEzApbEiZTaEzNSGcpYg9ZVAND4SY91l2k98i8UtHrJF3kcy7oegwM53x6Sv-ZUsN0jWi6kAmP1GwAvi3oIkNYu31LKVk0ovmCy/s72-c/display.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-1140405861911307938</id><published>2011-10-08T09:55:00.000-05:00</published><updated>2012-03-05T23:24:23.942-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 leds"/><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR leds"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR y assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="desplazamiento assembler"/><category scheme="http://www.blogger.com/atom/ns#" term="desplazamiento atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="dezplazamiento AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="luz secuencial atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="luz secuencial AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><title type='text'>Luz Secuencial</title><content type='html'>Programa para ATmega8&lt;br /&gt;
&lt;br /&gt;
Desplaza una luz en el Puerto B de derecha a izquierda y de izquierda a derecha.&lt;br /&gt;
&lt;br /&gt;
-Comandos de rotación LSL y LSR&lt;br /&gt;
-Subrutina de retardo&lt;br /&gt;
-Calibrado para cristal interno de 8 MHZ&lt;br /&gt;
&lt;br /&gt;
Esquema de conexión:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD_VBiaUOd4sPXqR6_jwLUeq4Lt1UtWknOiRjxUoi5HAjlu-8KG_GB7d0g3SQT6KRMGAvFiK9VuZmC30LZhIVREHEvr8gNIf6zuJEdRy5HPXOquMZxSTaBBfBxBggnCDQg7ueTwLxXBuvN/s1600/desplazamiento.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD_VBiaUOd4sPXqR6_jwLUeq4Lt1UtWknOiRjxUoi5HAjlu-8KG_GB7d0g3SQT6KRMGAvFiK9VuZmC30LZhIVREHEvr8gNIf6zuJEdRy5HPXOquMZxSTaBBfBxBggnCDQg7ueTwLxXBuvN/s320/desplazamiento.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;Programa en Assembler:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; color: black; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;;-----------------------------------------------------------
;Autor: LONELY113
;  http://lonely113.blogspot.com
;
;Programa para desplazamiento de luz en el puerto B

;Desplazamiento cada 1 s (Para oscilador interno de 8 MHz). 
;Salidas: Puerto B (PB0-PB7)
;-----------------------------------------------------------

;Para reloj interno de 8 MHz
.nolist
.include    &quot;m8def.inc&quot;
.list
.device     atmega8
.org     0x0000

.def COUNT1=r20
.def COUNT2=r21
.def COUNT3=r22
.def NUMBER=r4
.def TEMP=r17
; Inicializacion de stack
 ldi r16,LOW(RAMEND)
 out SPL,r16
 ldi r16,HIGH(RAMEND)
 out SPH,r16
; Fin inicializacion de stack

; Inicio de programa
 ldi r16,0xFF   ; Puerto B como salida
 out DDRB,r16
 clr r16   
 out PORTB,r16  ; Borrar PORTB 
 ldi r16,0x07 
 mov NUMBER,r16 ; Desplazar 7 posiciones
 ldi TEMP,0x01  ; &#39;00000001&#39;b
 out PORTB,TEMP  
FIRST: rcall DELAY
 lsl TEMP
 out PORTB,TEMP
 dec NUMBER
 brne FIRST    ; Desplaza 7 veces a la izquierda
 ldi r16,0x07
 mov NUMBER,r16
SECOND: rcall DELAY
 lsr TEMP
 out PORTB,TEMP
 dec NUMBER
 brne SECOND    ; Desplaza 7 veces a la derecha
 ldi r16,0x07
 mov NUMBER,r16
 rjmp FIRST    ; Bucle infinito

; Subrutinas

DELAY: ldi COUNT1,0xFF ; Retardo de 1 segundo
 ldi COUNT2,0xFF
 ldi COUNT3,0x29
LOOP: dec COUNT1
 brne LOOP
 ldi COUNT1,0xFF
 dec COUNT2
 brne LOOP
 ldi COUNT1,0xFF
 ldi COUNT2,0xFF
 dec COUNT3
 brne LOOP
 ret&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Archivos de programa:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?a3f0aanwcjqt0q6&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/1140405861911307938/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/10/luz-secuencial.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1140405861911307938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1140405861911307938'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/10/luz-secuencial.html' title='Luz Secuencial'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD_VBiaUOd4sPXqR6_jwLUeq4Lt1UtWknOiRjxUoi5HAjlu-8KG_GB7d0g3SQT6KRMGAvFiK9VuZmC30LZhIVREHEvr8gNIf6zuJEdRy5HPXOquMZxSTaBBfBxBggnCDQg7ueTwLxXBuvN/s72-c/desplazamiento.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-8934977818251574146</id><published>2011-08-29T12:58:00.011-05:00</published><updated>2012-03-05T23:29:00.973-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 basic"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR basic"/><category scheme="http://www.blogger.com/atom/ns#" term="inversor atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="inversor AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="inversor DC bipolar"/><category scheme="http://www.blogger.com/atom/ns#" term="inversor potencia"/><category scheme="http://www.blogger.com/atom/ns#" term="inversor PWM"/><category scheme="http://www.blogger.com/atom/ns#" term="inversor senoidal"/><category scheme="http://www.blogger.com/atom/ns#" term="inversor sinusoidal"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="proyecto potencia microcontrolador"/><title type='text'>Inversor Señal Sinusoidal</title><content type='html'>Este proyecto consiste en obtener una señal sinusoidal a partir de un voltaje DC bipolar.
&lt;br /&gt;
El funcionamiento se fundamenta en una modulación SPWM que se obtiene mediante un microcontrolador.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHQstl90bFrLxYa0g-8dHc51uxWJJiYpfIokWBucP4kxMjjaZ22E-fxd_cCcWCHBjHNeTAm6xjPFlqE2QM84sU-1qHjCQcMdSDZEMvJjyMSPSHUWN2GV-p_LpjLSbBww4x16ZmYmnz5U5K/s1600/Sin+t%25C3%25ADtulo.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646346365900709394&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHQstl90bFrLxYa0g-8dHc51uxWJJiYpfIokWBucP4kxMjjaZ22E-fxd_cCcWCHBjHNeTAm6xjPFlqE2QM84sU-1qHjCQcMdSDZEMvJjyMSPSHUWN2GV-p_LpjLSbBww4x16ZmYmnz5U5K/s320/Sin+t%25C3%25ADtulo.png&quot; style=&quot;cursor: pointer; display: block; height: 219px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;ETAPAS&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Circuito de control:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
El circuito de control se implementa con un microcontrolador ATmega8. Genera dos señales SPWM desfasadas como se muestra en la figura. El programa está ajustado para que la señal sinusoidal de salida sea de 60 Hz.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47T1RnG-ICov9OYmsNvE51QFw2a3rmMwA8JkYuuFo7U5DDm323tLSRUqQ-tp-IH1v8rhgZtwikg-hkxjYmKwvZ05-E8HC9EIvr42KVZwxGR4iHgPJFiuhfzLYOWAEkHLPR-pU0NDFfdbW/s1600/control2.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646346781963560834&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47T1RnG-ICov9OYmsNvE51QFw2a3rmMwA8JkYuuFo7U5DDm323tLSRUqQ-tp-IH1v8rhgZtwikg-hkxjYmKwvZ05-E8HC9EIvr42KVZwxGR4iHgPJFiuhfzLYOWAEkHLPR-pU0NDFfdbW/s320/control2.png&quot; style=&quot;cursor: pointer; display: block; height: 209px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Circuito de Aislamiento Control - Potencia:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Se utilizan dos optoacopladores 4N35 en la configuración que se muestra en la imagen. Notar que se requieren dos fuentes DC adicionales de  5V con tierras separadas (Señales de control independientes) Se puede obtener mediante un transformador de múltiples salidas, rectificadores y filtros.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKDiHFuoCzxehyphenhyphen3GdF92-iD5Z33SZCI7iHVrC-4rIxftuEEZln0jEcn-4sPE4j_iNpx8-rJHNOj5wYdfp2mNUu71n36M2B5ZLzMJ096YGS5Z23RfO1QOZB_HURxhDgnocqO35LFdkAdZB2/s1600/aislamiento2.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646347046266869458&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKDiHFuoCzxehyphenhyphen3GdF92-iD5Z33SZCI7iHVrC-4rIxftuEEZln0jEcn-4sPE4j_iNpx8-rJHNOj5wYdfp2mNUu71n36M2B5ZLzMJ096YGS5Z23RfO1QOZB_HURxhDgnocqO35LFdkAdZB2/s320/aislamiento2.png&quot; style=&quot;cursor: pointer; display: block; height: 85px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Circuito de Potencia:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Se utilizan transistores NMOS como conmutadores de alta potencia. Se puede utilizar tiembién IGBT.  También se requiere un filtro pasabajos con frecuencia de corte mayor a 60 Hz. No se requiere que sea de alta pendiente, pues la mosulación utilizada, SPWM, hace que los armónicos se encuentren muy alejados de la frecuencia fundamental.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2YwwgPHPhAaL8xfgv6rWySIKNY8nfhdBZ-Ex2Wd5dBhu9Fgs96SIYzdaigT8S28yTpe3rlbqTlxQ1eq6ri4VMZGPocyXYJboYKkRfaSc4yR6bWL6Z5Uo6eEaj8XQqpDoWa_ZQlGvYC2i5/s1600/potencia2.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646347396396025458&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2YwwgPHPhAaL8xfgv6rWySIKNY8nfhdBZ-Ex2Wd5dBhu9Fgs96SIYzdaigT8S28yTpe3rlbqTlxQ1eq6ri4VMZGPocyXYJboYKkRfaSc4yR6bWL6Z5Uo6eEaj8XQqpDoWa_ZQlGvYC2i5/s320/potencia2.png&quot; style=&quot;cursor: pointer; display: block; height: 154px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Fuente Bipolar:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Como se observa en el circuito anterior, se requiere una fuente bipolar del voltaje deseado, en este caso 145 V. Se puede utilizar un tranformador o se puede tomar directamente de la red con el circuito que se muestra a continuación:
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC5fJvk_4pW7UumhJu3onkab-_lR_DtE8ORhWW0QYwKezBHhEfw_Rk4TNxz0-Hr2oA5L6GGXNiYxNjd405r5RxscQRoYxOVi-o2kJ_TwtoM4paDwkdjB3IxEf7OCJcOKE7lFfkSpRSENC7/s1600/fuente.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646348212244518642&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC5fJvk_4pW7UumhJu3onkab-_lR_DtE8ORhWW0QYwKezBHhEfw_Rk4TNxz0-Hr2oA5L6GGXNiYxNjd405r5RxscQRoYxOVi-o2kJ_TwtoM4paDwkdjB3IxEf7OCJcOKE7lFfkSpRSENC7/s320/fuente.png&quot; style=&quot;cursor: pointer; display: block; height: 122px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;Funcionamiento&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Modulación PWM
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUgRyBNzMYaJj2umT1ADDT0iM0Zhyphenhyphenx5pamHI7gMfLpuOf1QeNxCwfX-V-4llF2SEX_7MpTOyrNzJjW4QCNZPN9x2AEqZwehrG_JZsrScM8HoMzYykbCaXQW4MOHorne6dzvoryByRZCykz/s1600/pwm.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646349396096306418&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUgRyBNzMYaJj2umT1ADDT0iM0Zhyphenhyphenx5pamHI7gMfLpuOf1QeNxCwfX-V-4llF2SEX_7MpTOyrNzJjW4QCNZPN9x2AEqZwehrG_JZsrScM8HoMzYykbCaXQW4MOHorne6dzvoryByRZCykz/s320/pwm.png&quot; style=&quot;cursor: pointer; display: block; height: 242px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
Señales de control
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimkfztRiIp7-1vaeclvjg73rauMmDnCChFitqwO5xGNcoq_mn4v2BCVZNBwfmZxDuFO7vU4twol8MOjPFSC9WmnhC_wSNnLkPlSNG3Jcncce7BJ4XVBrgiM4PE9X9JKdGhJC8mviwSyTbR/s1600/func1.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646349567845825890&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimkfztRiIp7-1vaeclvjg73rauMmDnCChFitqwO5xGNcoq_mn4v2BCVZNBwfmZxDuFO7vU4twol8MOjPFSC9WmnhC_wSNnLkPlSNG3Jcncce7BJ4XVBrgiM4PE9X9JKdGhJC8mviwSyTbR/s320/func1.png&quot; style=&quot;cursor: pointer; display: block; height: 245px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
Señal de salida sin filtro
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZQQx7cdlEwJ4zbKacs7zduTbUPam1HNbsWW8DyUNNYMXc13EiWqK9h564mL7CAbPpzDozQ6SxSxTCYZh9WsQpCH7e74L5JIDlD55m7DbQfRFpqakAHrdmZELNcEj0g_CkZLgl7Pb-yf48/s1600/func2.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646349788591393970&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZQQx7cdlEwJ4zbKacs7zduTbUPam1HNbsWW8DyUNNYMXc13EiWqK9h564mL7CAbPpzDozQ6SxSxTCYZh9WsQpCH7e74L5JIDlD55m7DbQfRFpqakAHrdmZELNcEj0g_CkZLgl7Pb-yf48/s320/func2.png&quot; style=&quot;cursor: pointer; display: block; height: 246px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
Señal de salida filtrada
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZCgP4azB77poyd5rz4Bg49iKrY1hTp1jO7YpAntvgdnii0MtgOFyNSp0wwJ3yAYpqYjyEuN88iNH1kDzWQ_6JrRDZpSye3gG54aEOyAUOYnGmMhyphenhyphenme2GlZe4DPv1RF8EjSIgBe5M25XDh/s1600/func3.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646350954760189682&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZCgP4azB77poyd5rz4Bg49iKrY1hTp1jO7YpAntvgdnii0MtgOFyNSp0wwJ3yAYpqYjyEuN88iNH1kDzWQ_6JrRDZpSye3gG54aEOyAUOYnGmMhyphenhyphenme2GlZe4DPv1RF8EjSIgBe5M25XDh/s320/func3.png&quot; style=&quot;cursor: pointer; display: block; height: 248px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Programa en Basic&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;$regfile = &quot;m8def.dat&quot;          &#39;Microcontrolador ATmega8&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;$crystal = 8000000              &#39;Reloj 8 MHz&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;$hwstack = 32                   &#39;Hardware Stack&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;$swstack = 10                   &#39;Software Stack&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Config Portb = Output           &#39;Puerto B como salida&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;Configuración del módulo PWM&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Config Timer1 = Pwm , Pwm = 10 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 1&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;Variables&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Dim T As Single                  &#39;Tiempo&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Dim D As Single                  &lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Dim Duty As Word                 &#39;Duty cycle (Word)&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;Inicio de programa&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;T = 0                            &#39;Reinicialización de variables&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;Loop1:                           &#39;Bucle infinito&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Do&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; If T &amp;lt; 0.00833 Then             &#39;Para semiciclo positivo&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  D = T * 376.992                &#39;Tiempo a radianes&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  D = Sin(d)                     &#39;Valor senoidal entre 0 - 1&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  Duty = D * 1023&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Pwm1a = Duty                  &#39;señal PWM1 con Duty Cycle  calculado&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Pwm1b = 0                     &#39;Señal PWM2=0&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  T = T + 0.0006                 &#39;Incrementar T1 en 0.6 ms&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; Elseif T &amp;lt; 0.01666 Then         &#39;Para el semiciclo negativo&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  D = T * 376.992                &#39;Tiempo a radianes&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  D = Sin(d)                     &#39;Valor senoidal entre 0 - 1&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  D = D * -1&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  Duty = D * 1023&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Pwm1a = 0                     &#39;Señal PWM1=0&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Pwm1b = Duty                  &#39;Señal PWM2 con duty cicle calculado&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  T = T + 0.0006                 &#39;Incrementar T en 0.6 ms&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; Else                            &#39;reiniciar si se completaron los dos ciclos&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;  T = 0&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; End If&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Loop&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;End&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;a href=&quot;http://www.mediafire.com/?5oz6jzuyoa41to5&quot;&gt;Descargar&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/8934977818251574146/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/08/inversor-senal-sinusoidal.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/8934977818251574146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/8934977818251574146'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/08/inversor-senal-sinusoidal.html' title='Inversor Señal Sinusoidal'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHQstl90bFrLxYa0g-8dHc51uxWJJiYpfIokWBucP4kxMjjaZ22E-fxd_cCcWCHBjHNeTAm6xjPFlqE2QM84sU-1qHjCQcMdSDZEMvJjyMSPSHUWN2GV-p_LpjLSbBww4x16ZmYmnz5U5K/s72-c/Sin+t%25C3%25ADtulo.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-5464351398404196344</id><published>2011-08-29T10:30:00.011-05:00</published><updated>2012-03-05T23:29:19.684-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="atmega8 basic"/><category scheme="http://www.blogger.com/atom/ns#" term="AVR basic"/><category scheme="http://www.blogger.com/atom/ns#" term="disparo scr"/><category scheme="http://www.blogger.com/atom/ns#" term="disparo tiristor"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="proyecto potencia microcontrolador"/><category scheme="http://www.blogger.com/atom/ns#" term="scr atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="scr AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="scr triac atmega8"/><category scheme="http://www.blogger.com/atom/ns#" term="scr triac AVR"/><category scheme="http://www.blogger.com/atom/ns#" term="scr triac microcontrolador"/><title type='text'>Arreglo de SCR como Triac</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5NQyXl8qIn6fUuSa6sB-vDU6LHwX4PJMl0-Vhu64kHhnTW4vFAZvMOvdlXf4RTZpyqy1B_bx5X0vQkKa_47-hIGwUDSO7_REcCytO50tXhcOf3HjHfmF_O27qX6u49IpONAgxzIRnl5mU/s1600/circuito.png&quot;&gt;
&lt;/a&gt;El siguiente proyecto consiste en implementar el funcionamiento de un Triac mediante 2 SCR con la finaliadad de poder manejar mayor potencia de la que permiten los Triac.
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;ETAPAS&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Circuito de Control:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Para el disparo de los Triac se utiliza el microntrolador Atmega8 programado en lenguaje Basic. Para introducir el ángulo de disparo deseado se utiliza un portenciómetro conectado a un ADC. El ángulo de disparo va de 0º a 180º correspondiente a un semiciclo. El otro semicilo es simétrico.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibH3Asv0bGctKRDr6NxshB2rxk7go7zyQ-GqMFSR6U1oonC1q71T-wWAqrqVavM1b5tjeEkV1M9GyeJ65JH1tn79C_ZzwELBEancjh8nj0YNveqHc161xx2J4XHlEYgXwEi0rnhVHIlvLn/s1600/control.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646319114764988066&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibH3Asv0bGctKRDr6NxshB2rxk7go7zyQ-GqMFSR6U1oonC1q71T-wWAqrqVavM1b5tjeEkV1M9GyeJ65JH1tn79C_ZzwELBEancjh8nj0YNveqHc161xx2J4XHlEYgXwEi0rnhVHIlvLn/s320/control.png&quot; style=&quot;cursor: pointer; display: block; height: 120px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Detector de Cruce por Cero:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Se utiliza este bloque de circuito para poder sincronizar el programa con la señal senoidal de potencia que se quiere controlar. Este circuito enviará un  pulso de interrupción cuando la señal cruce por 0, iniciando la rutina correspondiente en el programa.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGTOpBgMkffiQEeu3fh2ESYHQWPwZZeB31AnXj-jHYSLrXNDThzGrPT1z4UYmaDQua0iVFhynwqCwLVQpdHkjVgmsd8mZYMFW1LojMoRloaDrTg-nO0lPsdbIi4lX4-MucjSF44b11xMha/s1600/cruce_cero.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646319306149077154&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGTOpBgMkffiQEeu3fh2ESYHQWPwZZeB31AnXj-jHYSLrXNDThzGrPT1z4UYmaDQua0iVFhynwqCwLVQpdHkjVgmsd8mZYMFW1LojMoRloaDrTg-nO0lPsdbIi4lX4-MucjSF44b11xMha/s320/cruce_cero.png&quot; style=&quot;cursor: pointer; display: block; height: 120px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Aislamiento Control - Potencia:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Se utiliza un optoacoplador 4N35, con la configuración mostrada en la imagen.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9nOtdyeVlwQfy6wDHFOOCWlwO-GwQ7RWaqDyvTxwk9uSm053jCpnXKJQ6QFCHkC9sj5kIlKpM2lmU-Gdoxwoa5HCAp8bmUYVYdYSIVCzj5R8rNrdOceOPaFJZnT-Kx7nwxt4U2gGZOUT6/s1600/aislamiento.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646319580878331266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9nOtdyeVlwQfy6wDHFOOCWlwO-GwQ7RWaqDyvTxwk9uSm053jCpnXKJQ6QFCHkC9sj5kIlKpM2lmU-Gdoxwoa5HCAp8bmUYVYdYSIVCzj5R8rNrdOceOPaFJZnT-Kx7nwxt4U2gGZOUT6/s320/aislamiento.png&quot; style=&quot;cursor: pointer; display: block; height: 220px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Circuito de Potencia:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
la configuración de los SCR es como se muestra en la imagen. Esta configuración (2 SCR y 2 Diodos) permite tener un un punto común, utilizada como GND, a diferencia de conectar sólo dos SCR en antiparalelo en el que se requeriría dos señales de control con tierras separadas.
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC0ftDKbaLuNtLyLl5iiEkIo6wWo8kGU2Wi2J2CXbuE1IWzQ5hDo4Fn9jKJFxw7bJxpjNEaWBuYD5ZhfEwqIqYaBCL38jOJPfd-GAA9Xs0RuVU52jB1XkwD5pXwZFUik-xCsqfJxNdc-Rv/s1600/potencia.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646319747673299394&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC0ftDKbaLuNtLyLl5iiEkIo6wWo8kGU2Wi2J2CXbuE1IWzQ5hDo4Fn9jKJFxw7bJxpjNEaWBuYD5ZhfEwqIqYaBCL38jOJPfd-GAA9Xs0RuVU52jB1XkwD5pXwZFUik-xCsqfJxNdc-Rv/s320/potencia.png&quot; style=&quot;cursor: pointer; display: block; height: 144px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Circuito Completo:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEPWG8DgP9O1_AAm1Cv1OsQP5F1GZzNnFa8tjIA-susWvEm4zew7i2kp5wdssmh8CEODhHL8nuHDVLnT_cenihDMvmV3RzULpeA0nlEjUQ-Nl9lSfrR9SvcAQTTPnWLqa-44bHdzwmm5t5/s1600/circuito.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646320497862437858&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEPWG8DgP9O1_AAm1Cv1OsQP5F1GZzNnFa8tjIA-susWvEm4zew7i2kp5wdssmh8CEODhHL8nuHDVLnT_cenihDMvmV3RzULpeA0nlEjUQ-Nl9lSfrR9SvcAQTTPnWLqa-44bHdzwmm5t5/s320/circuito.png&quot; style=&quot;cursor: pointer; display: block; height: 234px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Programa en lenguaje Basic:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;$regfile = &quot;m8def.dat&quot;          &#39;Microcontrolador Atmega8&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;$crystal = 8000000              &#39;Reloj interno 8 MHz&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;$hwstack = 32                   &#39;Hardware Stack&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;$swstack = 10                   &#39;Software Stack&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Config Portb = Output           &#39;Puerto B como salida&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;variables&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;Dim D As Word                   &#39;Variable para lectura de potenciómetro&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Dim T As Single                 &#39;Variable para cálculos&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Dim Rampa As Single             &#39;Señal rampa&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;configuracion ADC&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;Config Adc = Single , Prescaler = Auto&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;configuracion de interrupciones&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Config Int0 = Low Level          &#39;Int. externa. Flanco de bajada&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Enable Int0&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;On Int0 Int_zc&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Config Timer1 = Timer , Prescale = 256   &#39;Int. por comparación  31.25 KHz&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;On Compare1a Int_timer1&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Enable Compare1a&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;Enable Interrupts                &#39;Habilitación de interrupciones&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt; Timer1 = 0                      &#39;Reinicialización de contador&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; Compare1a = 1                   &#39;Interrupción cada 32 us&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; Stop Timer1&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; Rampa = 0                       &#39;Reiniciar Rampa&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;Programa principal&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; Do&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   nop&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; Loop&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;Interrupcion cruce por cero&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;Int_zc:&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Stop Timer1                    &#39;Deterner contador&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Timer1 = 0                     &#39;Reinicializar contador&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Rampa = 0&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Portb.0 = 0                    &#39;Desactivar SCR&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Start Adc&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   D = Getadc(0)                  &#39;Leer dato ADC (Potenciómetro)&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Stop Adc&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   T = D / 1023&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   T = T * 360                    &#39;Rango 0 - 360 =&amp;gt; precisión 0.5 grados.&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Start Timer1&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Return&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;&#39;Interrupción por comparación&lt;/span&gt;



&lt;span style=&quot;color: black;&quot;&gt;Int_timer1:&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Timer1 = 0&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Rampa = Rampa + 2.8           &#39;Incrementar rampa en 2.8&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   If T &amp;gt; Rampa Then&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;      Portb.0 = 0                &#39;Desactivar SCR mientras Rampa &amp;lt; T&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Else&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;      Portb.0 = 1                &#39;Activar SCR si Rampa &amp;gt; T&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   End If&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;   Return                        &#39;Retorno de interrupción&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;End&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Funcionamiento&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Generación de pulsos de interrupción:
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjeI7lATQSzPSzaO1RfileXIl8D9KYSQswYsGBy-0N5iFhbVTYukYGDnYygfdJT0YShFnSRkuKFhTHYJDaqazlLF3hjdyu7pX4NBz_1Fl0uYS0cvj34LdyTv372PHBfeQt8-Ps9tSpBROj/s1600/funcionamiento1.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646328495809185778&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjeI7lATQSzPSzaO1RfileXIl8D9KYSQswYsGBy-0N5iFhbVTYukYGDnYygfdJT0YShFnSRkuKFhTHYJDaqazlLF3hjdyu7pX4NBz_1Fl0uYS0cvj34LdyTv372PHBfeQt8-Ps9tSpBROj/s320/funcionamiento1.png&quot; style=&quot;cursor: pointer; display: block; height: 187px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;Señal en la carga:
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFndnXmML6T3SAeu7LaWjUO6uDAFJOnlZ9afSpscKhBOI4UzmCbQM_GCs9Vkxn5IImNX_TiUG2xXsnnScR-LhLZQXEkPhnmnxkWiQC7EtWyAxBEvMxci45xT06mMzFb1cdUO7DMdtEUXFg/s1600/funcionamiento2.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5646328722342567170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFndnXmML6T3SAeu7LaWjUO6uDAFJOnlZ9afSpscKhBOI4UzmCbQM_GCs9Vkxn5IImNX_TiUG2xXsnnScR-LhLZQXEkPhnmnxkWiQC7EtWyAxBEvMxci45xT06mMzFb1cdUO7DMdtEUXFg/s320/funcionamiento2.png&quot; style=&quot;cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 158px;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.mediafire.com/?an6m69dwoa99byv&quot;&gt;Descargar&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/5464351398404196344/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/08/arreglo-de-scr-como-triac.html#comment-form' title='13 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5464351398404196344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5464351398404196344'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/08/arreglo-de-scr-como-triac.html' title='Arreglo de SCR como Triac'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibH3Asv0bGctKRDr6NxshB2rxk7go7zyQ-GqMFSR6U1oonC1q71T-wWAqrqVavM1b5tjeEkV1M9GyeJ65JH1tn79C_ZzwELBEancjh8nj0YNveqHc161xx2J4XHlEYgXwEi0rnhVHIlvLn/s72-c/control.png" height="72" width="72"/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-7926670288456657887</id><published>2011-08-08T19:38:00.002-05:00</published><updated>2011-08-08T19:39:26.425-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Varios"/><title type='text'>Diseño de Antena Microstrip Para TV Digital ISDB-T</title><content type='html'>&lt;div style=&quot;width:477px&quot; id=&quot;__ss_8801785&quot;&gt; &lt;strong style=&quot;display:block;margin:12px 0 4px&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/lonely113/diseo-de-antena-microstrip&quot; title=&quot;Diseño de antena microstrip&quot; target=&quot;_blank&quot;&gt;Diseño de antena microstrip&lt;/a&gt;&lt;/strong&gt; &lt;iframe src=&quot;http://www.slideshare.net/slideshow/embed_code/8801785&quot; width=&quot;477&quot; height=&quot;510&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt; &lt;div style=&quot;padding:5px 0 12px&quot;&gt; View more &lt;a href=&quot;http://www.slideshare.net/&quot; target=&quot;_blank&quot;&gt;documents&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/lonely113&quot; target=&quot;_blank&quot;&gt;Percy Julio Chambi Pacco&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/7926670288456657887/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/08/diseno-de-antena-microstrip-para-tv.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/7926670288456657887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/7926670288456657887'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/08/diseno-de-antena-microstrip-para-tv.html' title='Diseño de Antena Microstrip Para TV Digital ISDB-T'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-6768346725186253585</id><published>2011-08-08T19:37:00.000-05:00</published><updated>2011-08-08T19:38:05.660-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Varios"/><title type='text'>Sensores Inductivos - Completo</title><content type='html'>&lt;div style=&quot;width:477px&quot; id=&quot;__ss_8801776&quot;&gt; &lt;strong style=&quot;display:block;margin:12px 0 4px&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/lonely113/sensores-inductivos-8801776&quot; title=&quot;Sensores Inductivos&quot; target=&quot;_blank&quot;&gt;Sensores Inductivos&lt;/a&gt;&lt;/strong&gt; &lt;iframe src=&quot;http://www.slideshare.net/slideshow/embed_code/8801776&quot; width=&quot;477&quot; height=&quot;510&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt; &lt;div style=&quot;padding:5px 0 12px&quot;&gt; View more &lt;a href=&quot;http://www.slideshare.net/&quot; target=&quot;_blank&quot;&gt;documents&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/lonely113&quot; target=&quot;_blank&quot;&gt;Percy Julio Chambi Pacco&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/6768346725186253585/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/08/sensores-inductivos-completo.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/6768346725186253585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/6768346725186253585'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/08/sensores-inductivos-completo.html' title='Sensores Inductivos - Completo'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-4510227806924308477</id><published>2011-08-08T19:33:00.000-05:00</published><updated>2011-08-08T19:36:39.282-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Varios"/><title type='text'>Sensores Inductivos - Resúmen</title><content type='html'>&lt;div style=&quot;width:425px&quot; id=&quot;__ss_8801752&quot;&gt; &lt;strong style=&quot;display:block;margin:12px 0 4px&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/lonely113/sensores-inductivos&quot; title=&quot;Sensores inductivos&quot; target=&quot;_blank&quot;&gt;Sensores inductivos&lt;/a&gt;&lt;/strong&gt; &lt;iframe src=&quot;http://www.slideshare.net/slideshow/embed_code/8801752&quot; width=&quot;425&quot; height=&quot;355&quot; frameborder=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; scrolling=&quot;no&quot;&gt;&lt;/iframe&gt; &lt;div style=&quot;padding:5px 0 12px&quot;&gt; View more &lt;a href=&quot;http://www.slideshare.net/&quot; target=&quot;_blank&quot;&gt;presentations&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/lonely113&quot; target=&quot;_blank&quot;&gt;Percy Julio Chambi Pacco&lt;/a&gt; &lt;/div&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/4510227806924308477/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/08/sensores-inductivos-resumen.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/4510227806924308477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/4510227806924308477'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/08/sensores-inductivos-resumen.html' title='Sensores Inductivos - Resúmen'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-7699749654371094045</id><published>2011-07-23T21:11:00.004-05:00</published><updated>2012-03-05T22:30:23.020-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programacion PIC"/><title type='text'>Placa de entrenamiento PIC18F4550</title><content type='html'>Placa de entrenamiento para microcontrolador PIC18F4550.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL1bOZeACuwlSOPhzgHUY5toGbf8JBgYoIiS5kG4CGlsKUatMlFdIuey0iWGsgMVY4qf1J2lNavKGh6FwFvEay3m3p6mfXVsc6FAj7pz5cz_ZpDgXxZdZaVoOx4si8F3o4ty2SRW8T0AYI/s1600/Placa+de+entrenamientp+PIC18F4550.jpg&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5632736570761014098&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL1bOZeACuwlSOPhzgHUY5toGbf8JBgYoIiS5kG4CGlsKUatMlFdIuey0iWGsgMVY4qf1J2lNavKGh6FwFvEay3m3p6mfXVsc6FAj7pz5cz_ZpDgXxZdZaVoOx4si8F3o4ty2SRW8T0AYI/s320/Placa+de+entrenamientp+PIC18F4550.jpg&quot; style=&quot;cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 242px;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Incluye:&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Conector ICSP 6 pines para programación.&lt;/li&gt;
&lt;li&gt;Conector Para USART.&lt;/li&gt;
&lt;li&gt;Conector USB tipo B.&lt;/li&gt;
&lt;li&gt;Pines de puertos I/O (2 x pin).&lt;/li&gt;
&lt;li&gt;Cristal.&lt;/li&gt;
&lt;li&gt;Botón de reset.&lt;/li&gt;
&lt;li&gt;Regulador 5 V.&lt;/li&gt;
&lt;li&gt;Pines VDD/GND (4).&lt;/li&gt;
&lt;li&gt;Switch ON/OFF (Push de 6 pines). &lt;/li&gt;
&lt;li&gt;VDD regulador o puerto USB.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Circuito, Diseño de placa:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?m7wzsudud6yi3e1&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/7699749654371094045/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/07/placa-de-entrenamiento-pic18f4550.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/7699749654371094045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/7699749654371094045'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/07/placa-de-entrenamiento-pic18f4550.html' title='Placa de entrenamiento PIC18F4550'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL1bOZeACuwlSOPhzgHUY5toGbf8JBgYoIiS5kG4CGlsKUatMlFdIuey0iWGsgMVY4qf1J2lNavKGh6FwFvEay3m3p6mfXVsc6FAj7pz5cz_ZpDgXxZdZaVoOx4si8F3o4ty2SRW8T0AYI/s72-c/Placa+de+entrenamientp+PIC18F4550.jpg" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-871515778059103326</id><published>2011-07-23T00:53:00.000-05:00</published><updated>2012-03-05T22:43:01.189-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programadores PIC"/><title type='text'>Programador Pickit 2 Clone</title><content type='html'>Programador de Pic por USB (Pickit 2 clone)&lt;br /&gt;
&lt;br /&gt;
-Pic 5V&lt;br /&gt;
-8/14/18/28/40 pines&lt;br /&gt;
-Memorias 24C&lt;br /&gt;
&lt;br /&gt;
Probado con 16F84A / 16F877A / 18f2550 / 18f4550.&lt;br /&gt;
&lt;br /&gt;
Para Programar el PIC18F2550 se utilizó el programador por puerto serial.&lt;br /&gt;
Firmware v2.32 y Software Pickit 2 v2.61 disponibles en la página de &lt;a href=&quot;http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;amp;nodeId=1406&amp;amp;dDocName=en023805&quot;&gt;Microchip&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij2CGUOOBUrqrSZXpLdFOEx8xf9JRyXib0AratsN9faLeK3GdE9OIzNirbEHrGNwBBH7OTQHuu5VOOq7Kn2lHBg2uwF6_BlhRTQVtwpx3bq_UozlIb6TyLFS1Xx4aAEVGmcGfNEaTX6Vg/s1600/Programador+Pickit+2+Clone.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnWkkXtjFz3CtiM9m0v_omJzymS3Ge-5m9B-KyjHz98nNTusNJwcnr3oPPwnldBshNDEFPZe_wiKyJj96AQIWXKz39lpCjlhpiAo0uz60lorDDlZAUNPqOfZe-eQ7LpHNmPAwjxL40uul5/s1600/Pickit+2+Clone.jpg&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5632422147455623330&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnWkkXtjFz3CtiM9m0v_omJzymS3Ge-5m9B-KyjHz98nNTusNJwcnr3oPPwnldBshNDEFPZe_wiKyJj96AQIWXKz39lpCjlhpiAo0uz60lorDDlZAUNPqOfZe-eQ7LpHNmPAwjxL40uul5/s320/Pickit+2+Clone.jpg&quot; style=&quot;cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 267px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Esquema Listo para imprimir y lista de componentes:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?e5ry3sl6o1t5d52&quot;&gt;Pickit 2 Clone&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.megaupload.com/?d=SQUY4CYZ&quot;&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/871515778059103326/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/07/programador-pickit-2-clone.html#comment-form' title='8 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/871515778059103326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/871515778059103326'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/07/programador-pickit-2-clone.html' title='Programador Pickit 2 Clone'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/05301406364607041558</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnWkkXtjFz3CtiM9m0v_omJzymS3Ge-5m9B-KyjHz98nNTusNJwcnr3oPPwnldBshNDEFPZe_wiKyJj96AQIWXKz39lpCjlhpiAo0uz60lorDDlZAUNPqOfZe-eQ7LpHNmPAwjxL40uul5/s72-c/Pickit+2+Clone.jpg" height="72" width="72"/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-5603471577803098913</id><published>2011-05-13T20:54:00.003-05:00</published><updated>2012-03-05T23:12:08.155-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HP 50g"/><title type='text'>Gráfico de señales eviadas por PIC16F877a en Hp50g</title><content type='html'>El siguiente programa consiste en:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1.&lt;/b&gt; Muestrear una señal analógica de 0 a 5 V con periodo de muestreo&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; de 1 segundo por 1 minuto.&lt;br /&gt;
&lt;b&gt;2.&lt;/b&gt; Convertir las muestras analógicas a digitales.&lt;br /&gt;
&lt;b&gt;3.&lt;/b&gt; Enviar las muestras digitales a la calculadora HP50g. Transmisión en serie.&lt;br /&gt;
&lt;b&gt;4.&lt;/b&gt; Convertir las muestras digitales a valores analógicos correspondientes 0-5 V.&lt;br /&gt;
&lt;b&gt;5.&lt;/b&gt;Graficar la señal continua en tiempo discreto(cada segundo).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;En el PIC16F877a&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1.&lt;/b&gt; La señal analógica se muestrea y se digitaliza utilizando el módulo ADC.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; - Periodo de muestro=1 s&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 8 bits/muestra&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2. &lt;/b&gt;Al completarse 60 muestras se pasa a otra rutina de envio de datos por&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; USART.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; - 9600 baudios&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; - 8 bits de datos&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 2 bit Stop&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; - No paridad&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. &lt;/b&gt;Se enciende un Led por 0.5 s indicando transferencia completa.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4.&lt;/b&gt; En seguida se toman muestras nuevamente por 1 minuto.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;En la calculadora HP50g&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1.&lt;/b&gt; Los datos se reciben en la HP50g en forma de cadena.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;2.&lt;/b&gt; La cadena se separa en caracteres utilizando los comandos &lt;b&gt;HEAD&lt;/b&gt; y &lt;b&gt;TAIL&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3.&lt;/b&gt; Los caracteres se convierten a valores numéricos (0 - 255) utilizando el&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; comando &lt;b&gt;NUM&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;4.&lt;/b&gt; Los números obtenidos se agrupan en una matríz 1x60.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;5.&lt;/b&gt; Se convierten los valores digitales a los analógicos correspondientes (0- 5V).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;6.&lt;/b&gt; Se genera una matríz [0 1 2 ... 59] 1x60 (base de tiempo).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;7.&lt;/b&gt; La matríz de datos y la matríz base de tiempo forman una matríz 60x2 con los&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; comandos &lt;b&gt;AUGMENT &lt;/b&gt;y &lt;b&gt;TRAN&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;8.&lt;/b&gt; Se grafica las muestras (Dispersión) con el comando &lt;b&gt;SCATTER&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;9. &lt;/b&gt;Se unen los puntos graficados con líneas para un gráfico continuo con el&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; comando &lt;b&gt;LINE&lt;/b&gt;.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Esquema de circuito:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY8rkCVPsXsEuneFITZ8sEFeDhySzoMmU3mRgH4v0G_3-PbIATd4AvslIepvIkEN42CVZ3wqYYqmiEQsG9r_v-6whUUEcB7fGuL_nYZIbQv6qbj_MXB177swhFXyd_sIbeTcU011ljf0k/s1600/Gr%25C3%25A1fico+de+se%25C3%25B1ales+pic16f877a_hp50g.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY8rkCVPsXsEuneFITZ8sEFeDhySzoMmU3mRgH4v0G_3-PbIATd4AvslIepvIkEN42CVZ3wqYYqmiEQsG9r_v-6whUUEcB7fGuL_nYZIbQv6qbj_MXB177swhFXyd_sIbeTcU011ljf0k/s320/Gr%25C3%25A1fico+de+se%25C3%25B1ales+pic16f877a_hp50g.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Programa para PIC16F877a en Pic Basic (Microcode)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 300px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;****************************************************************
&#39;*  Name    : graficar_hp50g.BAS                                      *
&#39;*  Author  : LONELY113                                         *
&#39;*  Notice  : Copyright (c) 2011 LONELY113                      *
&#39;*          : All Rights Reserved                               *
&#39;*  Date    : 13/05/2011                                        *
&#39;*  Version : 1.0                                               *
&#39;*  Notes   : PIC16F877a                                        *
&#39;*          : 9600 baudios con cristal de 10 MHz                *
&#39;*          : Pin RC6/Tx a pin RxD de Hp50g                     *
&#39;*          : Pin GND de Hp50g a GND de circuito                *
&#39;*          : Requiere adaptador de nivel 5V a 3.3V             *
&#39;*          : Led en Pin RB4                                    *
&#39;****************************************************************
&lt;span style=&quot;color: #38761d;&quot;&gt;
@ __CONFIG _WDT_OFF &amp;amp; _PWRTE_OFF &amp;amp; _CP_OFF &amp;amp; _HS_OSC &amp;amp; _BODEN_OFF &amp;amp; _LVP_OFF&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;DEFINE OSC 10          &lt;span style=&quot;color: blue;&quot;&gt;; 10 MHz&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: blue;&quot;&gt;&#39;Definiciones USART&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_RCSTA 90h  &lt;span style=&quot;color: blue;&quot;&gt;&#39; Habilitar registro de recepción&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_TXSTA 20h  &lt;span style=&quot;color: blue;&quot;&gt;&#39; Habilitar registro de trsnsmisión&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_BAUD 9600  &lt;span style=&quot;color: blue;&quot;&gt;&#39; 9600 baudios&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: blue;&quot;&gt;&#39;Definiciones ADC&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE ADC_BITS 8      &lt;span style=&quot;color: blue;&quot;&gt;&#39; Número de bits/muestra&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE ADC_CLOCK 3     &lt;span style=&quot;color: blue;&quot;&gt;&#39; Fuente de reloj (RC=3)&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE ADC_SAMPLEUS 50 &lt;span style=&quot;color: blue;&quot;&gt;&#39; Periodo de muestreo en us&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;TRISB.4=0              &lt;span style=&quot;color: blue;&quot;&gt;&#39;Pin RB4 como salida&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;i VAR BYTE&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;volt VAR BYTE          &lt;span style=&quot;color: blue;&quot;&gt;&#39;Variable que almacena temporalmente una muestra&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;signal VAR BYTE[60]    &lt;span style=&quot;color: blue;&quot;&gt;&#39;Variable que almacena 60 muestras&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;TRISA = 255            &lt;span style=&quot;color: blue;&quot;&gt;&#39;Puerto A como entradas&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;ADCON1 = 2             &lt;span style=&quot;color: blue;&quot;&gt;&#39;PORTA analógico&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;PAUSE 5000             &lt;span style=&quot;color: blue;&quot;&gt;&#39;Retardo de 5 segundos&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: blue;&quot;&gt;&#39;Inicio de programa&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;loop1:&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; FOR i=0 TO 59          &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;  ADCIN 0, volt         &lt;span style=&quot;color: blue;&quot;&gt;&#39;Muestrea y guarda en volt&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;  signal[i]= volt       &lt;span style=&quot;color: blue;&quot;&gt;&#39;signal almacena todas las muestras&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;  PAUSE 1000            &lt;span style=&quot;color: blue;&quot;&gt;&#39;Muestrear cada segundo&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; NEXT&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt; HSEROUT [STR signal \60] &lt;span style=&quot;color: blue;&quot;&gt;&#39;Enviar cadena por Tx&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; PORTB.4=1                &lt;span style=&quot;color: blue;&quot;&gt;&#39;Encender LED (envio completo)&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; PAUSE 500&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; PORTB.4=0                &lt;span style=&quot;color: blue;&quot;&gt;&#39;Apagar LED&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;GOTO loop1&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;END&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Programas para HP50g en UserRPL&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;b&gt;Configurar puerto serie&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 100px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt; @Configuracion puerto serie&lt;/span&gt;
  &amp;lt;&amp;lt;
    9600 BAUD 0 PARITY
    -33 CF -78 SF
    CLOSEIO OPENIO 1 STIME
  &amp;gt;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Graficar señal&lt;/b&gt;&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; color: black; height: 300px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&amp;lt;&amp;lt;
  {X1 X2 Y1 Y2 j1 j2 m n DATA} PURGE
&lt;span style=&quot;color: blue;&quot;&gt;&lt;/span&gt;  
&lt;span style=&quot;color: blue;&quot;&gt; @Leer datos de Buffer&lt;/span&gt;
  BUFLEN
  DROP SRECV DROP 

 &lt;span style=&quot;color: blue;&quot;&gt;@guardar datos en matriz fila &lt;/span&gt;
  DATA STO 
  DATA
  1 60
  FOR i
   DUP HEAD NUM SWAP TAIL
  NEXT
  DROP 60 ROW→ 

&lt;span style=&quot;color: blue;&quot;&gt; @Convertir a niveles analogicos 0-5V&lt;/span&gt;
  255 / 5 *

 &lt;span style=&quot;color: blue;&quot;&gt;@Generar una matriz fila [0 1 2 ...59]&lt;/span&gt;
  1 60
  FOR i
   i 1 -
  NEXT 
  60 ROW→ 

&lt;span style=&quot;color: blue;&quot;&gt; @Formar una matriz 60x2 datos y base de tiempo&lt;/span&gt;
  SWAP AUGMENT TRAN
  DUP &#39;DATA&#39; STO 

&lt;span style=&quot;color: blue;&quot;&gt; @Graficar muestras (dispersion) &lt;/span&gt;
  ΣDAT STO
  ERASE SCATTER AUTO DRAX DRAW

&lt;span style=&quot;color: blue;&quot;&gt; @Unir puntos (grafica continua)&lt;/span&gt;
  DATA SIZE {m n} STO
  1 m 1 -
  FOR j1
   j1 1 + &#39;j2&#39; STO
   DATA {j1 1} GET &#39;X1&#39; STO
   DATA {j1 2} GET &#39;Y1&#39; STO
   DATA {j2 1} GET &#39;X2&#39; STO
   DATA {j2 2} GET &#39;Y2&#39; STO
   X1 Y1 R→C X2 Y2 R→C LINE
 NEXT
 PICTURE
{X1 X2 Y1 Y2 j1 j2 m n ΣDAT ΣPAR PPAR} PURGE
&amp;gt;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Capturas en pantalla de Hp50g:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlhCZCnGUMXcFQKcSE2qSbN5zUZtXyQwVCbong6rsZvWxyw5IR-xFHKnyljRWbippdh2CGei7n0V9ZG3uPDKzEJl8d09J0zrq3QGgzuAPFLYeK4jY7X__xS8bMgxGHPZ5hDtghSQs5-Uo/s1600/pic0.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlhCZCnGUMXcFQKcSE2qSbN5zUZtXyQwVCbong6rsZvWxyw5IR-xFHKnyljRWbippdh2CGei7n0V9ZG3uPDKzEJl8d09J0zrq3QGgzuAPFLYeK4jY7X__xS8bMgxGHPZ5hDtghSQs5-Uo/s1600/pic0.JPG&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjFPxeFsUUTPOtQK7yoyTjCozQ7v9jHBUMBgDxpcOwW_gmTen-_HTROCD25czeA2NSO3zjkDYB4PcSBzv9T-R6gGlVoW4BqrPz57vc0NhJ3jlFmxmcV_DUtmiW8ykAN16Qyf8NkgJ7Lvs/s1600/pic2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjFPxeFsUUTPOtQK7yoyTjCozQ7v9jHBUMBgDxpcOwW_gmTen-_HTROCD25czeA2NSO3zjkDYB4PcSBzv9T-R6gGlVoW4BqrPz57vc0NhJ3jlFmxmcV_DUtmiW8ykAN16Qyf8NkgJ7Lvs/s1600/pic2.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Programas *.BAS y HP UserRPL:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?zsx7hcice866d71&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/5603471577803098913/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/05/grafico-de-senales-eviadas-por.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5603471577803098913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5603471577803098913'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/05/grafico-de-senales-eviadas-por.html' title='Gráfico de señales eviadas por PIC16F877a en Hp50g'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY8rkCVPsXsEuneFITZ8sEFeDhySzoMmU3mRgH4v0G_3-PbIATd4AvslIepvIkEN42CVZ3wqYYqmiEQsG9r_v-6whUUEcB7fGuL_nYZIbQv6qbj_MXB177swhFXyd_sIbeTcU011ljf0k/s72-c/Gr%25C3%25A1fico+de+se%25C3%25B1ales+pic16f877a_hp50g.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-1734029459003632808</id><published>2011-05-02T23:15:00.003-05:00</published><updated>2012-03-05T22:29:44.008-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programacion PIC"/><title type='text'>Placa de entrenamiento PIC16F877A</title><content type='html'>Placa de entrenamiento para microcontrolador PIC16F877A.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWnQb6_7bNKVKPeHTMbV5K-uBuNKhQL1UqitqPVcyeYV0Ow83ro6RtCyXDvF0XNAPI0i3e57dLB6392jRXdc3Kme91G75W_R_N_zn4SCAaFyOH-tcm_PWsglp3ejYA2WPYNp9GVw5yN9CM/s1600/Placa+de+entrenamiento.jpg&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5632635284555816130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWnQb6_7bNKVKPeHTMbV5K-uBuNKhQL1UqitqPVcyeYV0Ow83ro6RtCyXDvF0XNAPI0i3e57dLB6392jRXdc3Kme91G75W_R_N_zn4SCAaFyOH-tcm_PWsglp3ejYA2WPYNp9GVw5yN9CM/s320/Placa+de+entrenamiento.jpg&quot; style=&quot;cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 258px;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1_kcBH4bdHekQVHqlPAyoKAsgddHIrjzRGf-taLJ3Y-LjAKZj4RNH2KhjSuc1s6F5ONt18Af7NM-1WfO9As48WVJig2z9DvYSjj6rHMrCbYiwQsRCEnw8NURPzL_my90X0K5DdksZOmU/s1600/Placa+de+entrenamiento.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Incluye:&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Conector ICSP 6 pines para programación.&lt;/li&gt;
&lt;li&gt;Conector Para USART.&lt;/li&gt;
&lt;li&gt;Pines de puertos I/O (2 x pin).&lt;/li&gt;
&lt;li&gt;Cristal.&lt;/li&gt;
&lt;li&gt;Botón de reset.&lt;/li&gt;
&lt;li&gt;Regulador 5 V.&lt;/li&gt;
&lt;li&gt;Pines VDD/GND (4).&lt;/li&gt;
&lt;li&gt;Switch ON/OFF (Push de 6 pines). &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Circuito, Diseño de placa:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/goog_801260826&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?e752v6r6f61b36f&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/1734029459003632808/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/05/placa-de-entrenamiento-pic16f877a.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1734029459003632808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1734029459003632808'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/05/placa-de-entrenamiento-pic16f877a.html' title='Placa de entrenamiento PIC16F877A'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWnQb6_7bNKVKPeHTMbV5K-uBuNKhQL1UqitqPVcyeYV0Ow83ro6RtCyXDvF0XNAPI0i3e57dLB6392jRXdc3Kme91G75W_R_N_zn4SCAaFyOH-tcm_PWsglp3ejYA2WPYNp9GVw5yN9CM/s72-c/Placa+de+entrenamiento.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-6256734706339486954</id><published>2011-04-29T23:51:00.003-05:00</published><updated>2012-03-05T23:32:09.694-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programacion AVR"/><title type='text'>Placa de entrenamiento ATmega8</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1Jp8KEpahKlalZr9CqoQdwNlRwsKl4igr7f_0iZUjX10zYmqq6YVSmZXbM03Op8PTXlZ5w-ShlDYQMLdgAb6PG_TFUX7m5gB7PVWz7OBujfx6A7rGAHB-WTt9AietIsCdCQNxGJ93_jWY/s1600/Placa+de+entrenamiento.jpg&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5632636207069625810&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1Jp8KEpahKlalZr9CqoQdwNlRwsKl4igr7f_0iZUjX10zYmqq6YVSmZXbM03Op8PTXlZ5w-ShlDYQMLdgAb6PG_TFUX7m5gB7PVWz7OBujfx6A7rGAHB-WTt9AietIsCdCQNxGJ93_jWY/s320/Placa+de+entrenamiento.jpg&quot; style=&quot;cursor: pointer; display: block; height: 274px; margin: 0px auto 10px; text-align: center; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Placa de entrenamiento para microcontrolador ATmega8.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Incluye:&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Conector IDC 2x5 pines para programación.&lt;/li&gt;
&lt;li&gt;Pines de puertos I/O (2 x pin).&lt;/li&gt;
&lt;li&gt;Cristal externo.&lt;/li&gt;
&lt;li&gt;Botón de reset.&lt;/li&gt;
&lt;li&gt;Regulador 5 V.&lt;/li&gt;
&lt;li&gt;Pines VDD/GND (4).&lt;/li&gt;
&lt;li&gt;Pin AREF (opcional 5 V). &lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Circuito, Diseño de placa:&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.megaupload.com/?d=3RS9B8S0&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.mediafire.com/?3g91d6w0z4i33e7&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/6256734706339486954/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/04/placa-de-entrenamiento-atmega8.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/6256734706339486954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/6256734706339486954'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/04/placa-de-entrenamiento-atmega8.html' title='Placa de entrenamiento ATmega8'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1Jp8KEpahKlalZr9CqoQdwNlRwsKl4igr7f_0iZUjX10zYmqq6YVSmZXbM03Op8PTXlZ5w-ShlDYQMLdgAb6PG_TFUX7m5gB7PVWz7OBujfx6A7rGAHB-WTt9AietIsCdCQNxGJ93_jWY/s72-c/Placa+de+entrenamiento.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-3669252260768200988</id><published>2011-04-29T21:59:00.001-05:00</published><updated>2011-04-29T22:00:12.169-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programadores AVR"/><title type='text'>Programación del ATmega8 para el programador USBASP</title><content type='html'>&lt;div id=&quot;__ss_7783513&quot; style=&quot;width: 477px;&quot;&gt;&lt;b style=&quot;display: block; margin: 12px 0pt 4px;&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/lonely113/programacin-del-atmega8&quot; title=&quot;Programación del atmega8&quot;&gt;Programación del atmega8&lt;/a&gt;&lt;/b&gt; &lt;iframe frameborder=&quot;0&quot; height=&quot;510&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;http://www.slideshare.net/slideshow/embed_code/7783513&quot; width=&quot;477&quot;&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;div style=&quot;padding: 5px 0pt 12px;&quot;&gt;View more &lt;a href=&quot;http://www.slideshare.net/&quot;&gt;documents&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/lonely113&quot;&gt;Percy Chambi Pacco&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/3669252260768200988/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/04/programacion-del-atmega8-para-el.html#comment-form' title='11 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/3669252260768200988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/3669252260768200988'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/04/programacion-del-atmega8-para-el.html' title='Programación del ATmega8 para el programador USBASP'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-419973537215927216</id><published>2011-04-22T00:28:00.002-05:00</published><updated>2012-03-05T23:38:58.462-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programadores AVR"/><title type='text'>Programador AVR USBASP</title><content type='html'>Programador de AVR USBASP con ATmega8&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6eqD5xpiJ07pjBb24rD10S1nMU028vjhcvnH9lHCmfQq-vFjMHUApOBIQk6B_9quBi9m8MsARp8nlzySY9lyXffAQbPlPDrPDv5H7CqyeNM8L2EwaJw9bgQEsImWViEOSgtxMM8EOHnI/s1600/USBASP.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6eqD5xpiJ07pjBb24rD10S1nMU028vjhcvnH9lHCmfQq-vFjMHUApOBIQk6B_9quBi9m8MsARp8nlzySY9lyXffAQbPlPDrPDv5H7CqyeNM8L2EwaJw9bgQEsImWViEOSgtxMM8EOHnI/s320/USBASP.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Se requiere programar el ATmega8 previamente usando otro programador como puede ser el programador serial junto con Ponyprog2000.&lt;br /&gt;
&lt;br /&gt;
Configuración de fusibles:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;HFUSE=0xc9  LFUSE=0xef&lt;/pre&gt;
&lt;pre&gt;&lt;/pre&gt;
&lt;br /&gt;
firmware, Driver para windows XP: &lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?jji3idd56we6ouz&quot;&gt;Descargar&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Driver para Windows 7 - 32 / 64 bit:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?2cj68vvx3qjxbwn&quot;&gt;Descargar&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Layout listo para imprimir y lista de componentes:&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?vyk24o6vt48dls4&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/419973537215927216/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/04/programador-avr-usbasp.html#comment-form' title='24 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/419973537215927216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/419973537215927216'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/04/programador-avr-usbasp.html' title='Programador AVR USBASP'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6eqD5xpiJ07pjBb24rD10S1nMU028vjhcvnH9lHCmfQq-vFjMHUApOBIQk6B_9quBi9m8MsARp8nlzySY9lyXffAQbPlPDrPDv5H7CqyeNM8L2EwaJw9bgQEsImWViEOSgtxMM8EOHnI/s72-c/USBASP.jpg" height="72" width="72"/><thr:total>24</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-5329296978427564690</id><published>2011-04-22T00:21:00.004-05:00</published><updated>2012-03-05T22:48:48.418-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programadores AVR"/><title type='text'>Programador AVR Serial</title><content type='html'>Programdor AVR por puerto serial.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Usar con Ponyprog2000: &lt;a href=&quot;http://www.lancos.com/prog.html&quot;&gt;www.lancos.com/prog.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Requiere fuente externa de 5V. Conectar entre VDD y GND.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaZNL0ND676hcqmp4T922ZAdnI-q88gRFAG2h_BNMF7YekwBmABu0Zc5tZCgm2nzEYTXHd2mhya94hi6fVimVPsvXcDcCnXIT56bajMk3kwULjqBYXNTkyLPE3ImAc-5Rv2QejTITial8/s1600/Programador+AVR+Serial.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;217&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaZNL0ND676hcqmp4T922ZAdnI-q88gRFAG2h_BNMF7YekwBmABu0Zc5tZCgm2nzEYTXHd2mhya94hi6fVimVPsvXcDcCnXIT56bajMk3kwULjqBYXNTkyLPE3ImAc-5Rv2QejTITial8/s320/Programador+AVR+Serial.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Layout listo para imprimir y lista de componentes:&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?at0t8q3bibohg1o&quot;&gt;Descargar&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/5329296978427564690/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/04/progrmador-avr-serial.html#comment-form' title='14 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5329296978427564690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/5329296978427564690'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/04/progrmador-avr-serial.html' title='Programador AVR Serial'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaZNL0ND676hcqmp4T922ZAdnI-q88gRFAG2h_BNMF7YekwBmABu0Zc5tZCgm2nzEYTXHd2mhya94hi6fVimVPsvXcDcCnXIT56bajMk3kwULjqBYXNTkyLPE3ImAc-5Rv2QejTITial8/s72-c/Programador+AVR+Serial.jpg" height="72" width="72"/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-4158698374020186651</id><published>2011-04-11T21:49:00.002-05:00</published><updated>2012-03-05T23:11:06.594-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HP 50g"/><title type='text'>Envio de caracteres de PIC16F877A a calculadora HP50g</title><content type='html'>Programa para PIC16F877A&lt;br /&gt;
&lt;br /&gt;
Este programa envía una cadena de 10 caracteres a 9600 baudios utilizando transmisión USART.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuH1bNgb1AG6vFKmU5EXSslEAp7kFsdnAk_vRjg8V6FR99fGts7EJuuiqsMP8LeQaaGrIEwrFzVD9NzL5sDhEZc8KWfyUwHoqBfIyAxCeBWF-seTja23NkGW-OmB2KCrMuo9foRwiLuAU/s1600/hp50g_Tx_pic16f877a.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;181&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuH1bNgb1AG6vFKmU5EXSslEAp7kFsdnAk_vRjg8V6FR99fGts7EJuuiqsMP8LeQaaGrIEwrFzVD9NzL5sDhEZc8KWfyUwHoqBfIyAxCeBWF-seTja23NkGW-OmB2KCrMuo9foRwiLuAU/s320/hp50g_Tx_pic16f877a.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp; Funcionamiento&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Los datos a enviar se encuentran en una tabla de datos en la memoria de programa, en este caso una cadena de 10 caracteres &quot;HOLA MUNDO&quot;. &lt;/li&gt;
&lt;li&gt;Se configura el microcontrolador para transmisión serial asíncrona a 9600 baudios (mayor detalle en el archivo . ASM). &lt;/li&gt;
&lt;li&gt;El programa incluye una rutina de retardo antes de enviar los caracteres para poder inicializar la configuración en la calculadora HP50g.&lt;/li&gt;
&lt;li&gt;Se puede conectar un led en el pin RA0. Cuando se conecta la alimentación al pic el led se enciende y se ejecuta la rutina de retardo. Finalizada ésta el led se apaga indicando el inicio de la transmisiñon de datos. &lt;/li&gt;
&lt;li&gt;Los carateres se envian y se almacenan automáticamente en el buffer de entrada de la HP50g una vez abierto el puerto serial con el comando OPENIO.&lt;/li&gt;
&lt;li&gt;El circuito formado por los transistores 2N2222A es un adaptador de nivel de tensión. El PIC trabaja a 0 - 5 V pero la calculadora opera 0 - 3.3 V.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;Crear el siguiente programa en la calculadora y almacenar en una variable. Ejecutar una vez que se conecta la alimetación al PIC16F877A o luego de resetearlo.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&amp;lt;9600 BAUD&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0 PARITY&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; -33 CF&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; -78 SF&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; CLOSEIO&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; OPENIO&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10 STIME&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BUFLEN&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DROP&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SRECV&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DROP&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&amp;gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;Archivos .ASM y .HEX&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?ha3hhiavfs7a3c1&quot;&gt;Descargar&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;****Programa en Pic Basic (Microcode)****&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&#39;****************************************************************
&#39;*  Name    : UNTITLED.BAS                                      *
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*  Author  : LONELY113                                         *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*  Notice  : Copyright (c) 2011 LONELY113                      *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*          : All Rights Reserved                               *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*  Date    : 12/05/2011                                        *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*  Version : 1.0                                               *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*  Notes   : PIC16F877a                                        *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*          : 9600 baudios con cristal de 10 MHz                *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*          : Pin RC6/Tx a pin RxD de Hp50g                     *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*          : Pin GND de Hp50g a GND de circuito                *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;*          : Requiere adaptador de nivel 5V a 3.3V             *&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&#39;****************************************************************&lt;/span&gt;

&lt;span style=&quot;color: #38761d;&quot;&gt;@ __CONFIG _WDT_OFF &amp;amp; _PWRTE_OFF &amp;amp; _CP_OFF &amp;amp; _HS_OSC &amp;amp; _BODEN_OFF &amp;amp; _LVP_OFF&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;DEFINE OSC 10         &lt;span style=&quot;color: blue;&quot;&gt;&#39;10 MHz&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: blue;&quot;&gt;&#39;Definiciones para USART&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_RCSTA 90h &lt;span style=&quot;color: blue;&quot;&gt;&#39;Habilitar registro de recepción&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_TXSTA 20h &lt;span style=&quot;color: blue;&quot;&gt;&#39;Habilitar registro de transmisión&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_BAUD 9600 &lt;span style=&quot;color: blue;&quot;&gt;&#39;9600 baudios&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: blue;&quot;&gt;&#39;Inicio de programa&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;PAUSE 5000            &lt;span style=&quot;color: blue;&quot;&gt;&#39;Retardo de 5 segundos&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;HSEROUT [&lt;span style=&quot;color: red;&quot;&gt;&quot;Hola Mundo!!!!!!&quot;&lt;/span&gt;,13,10] &lt;span style=&quot;color: blue;&quot;&gt;&#39;Enviar cadena&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;END&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/4158698374020186651/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/04/envio-de-caracteres-de-pic16f877a.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/4158698374020186651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/4158698374020186651'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/04/envio-de-caracteres-de-pic16f877a.html' title='Envio de caracteres de PIC16F877A a calculadora HP50g'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuH1bNgb1AG6vFKmU5EXSslEAp7kFsdnAk_vRjg8V6FR99fGts7EJuuiqsMP8LeQaaGrIEwrFzVD9NzL5sDhEZc8KWfyUwHoqBfIyAxCeBWF-seTja23NkGW-OmB2KCrMuo9foRwiLuAU/s72-c/hp50g_Tx_pic16f877a.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8126969217814028272.post-1078312610443451971</id><published>2011-04-08T18:29:00.004-05:00</published><updated>2012-03-05T23:13:55.800-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HP 50g"/><title type='text'>Envio de cadena de caracteres de hp50g a PIC16F877A</title><content type='html'>Programa para PIC16F877A&lt;br /&gt;
&lt;br /&gt;
Estos dos programas cumplen la misma función que los publicados anteriormente. La diferencia es que se aprovecha la comunicación USART de la que dispone el pic16f877a.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Envio de caracter y visualización en Leds (ASCII)&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiamNTk09kBI85QA7LVuY0tBZRDTd4Z1Gug3WbQXiFpndfA_p2YXda3EtDymOfx0-KafqR6xEx9d-qjj923_cXTU3lCPODVI3REWFBLiDx0sP2YI-O9yOsQfycZVtLro7f2xCHR-UKWTNo/s1600/hp50g_16f877a.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;199&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiamNTk09kBI85QA7LVuY0tBZRDTd4Z1Gug3WbQXiFpndfA_p2YXda3EtDymOfx0-KafqR6xEx9d-qjj923_cXTU3lCPODVI3REWFBLiDx0sP2YI-O9yOsQfycZVtLro7f2xCHR-UKWTNo/s320/hp50g_16f877a.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&amp;nbsp; Funcionamiento&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; El caracter se recibe en el registro RCREG, se mueve al acumulador y se envia al Puerto D para la&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visualización.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Envio de una cadena de 16 caracteres&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC8oQ1UaaHSxrxz0rKeFuU8VFNto-KcswkErOyz_Q0z6LVurbODqk_nxHbO8nZ0WWBb8QI7VjQ_KSMTnSs2HBlzlNPq4RgFZuNFr4B0c4xRU2va0ENqdMUOMWjhzZJFZfFl7FsLWzBQIQ/s1600/hp50g_USART.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;261&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC8oQ1UaaHSxrxz0rKeFuU8VFNto-KcswkErOyz_Q0z6LVurbODqk_nxHbO8nZ0WWBb8QI7VjQ_KSMTnSs2HBlzlNPq4RgFZuNFr4B0c4xRU2va0ENqdMUOMWjhzZJFZfFl7FsLWzBQIQ/s320/hp50g_USART.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp; Funcionamiento&lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Se genera una interrupción cada vez que se recibe un caracter.&lt;/li&gt;
&lt;li&gt;La rutina de interrupción guarda los caracteres recibidos en posiciones de memoria sucesivas, mediante direccionamiento indirecto, hasta que se reciben 16 caracteres.&lt;/li&gt;
&lt;li&gt;Una vez recibidos 16 caracteres se pasa a la rutina de visualización en LCD, finalizada ésta se reinicia el programa a la espera de una nueva cadena.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Archivos .ASM y HEX&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?j8xksck5t0p1syw&quot;&gt;Envio de caracter&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.mediafire.com/?888282j4lbdp4vb&quot;&gt;Envio de cadena&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Programa para hp50g:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&amp;lt;&amp;lt; &#39;a&#39;&amp;nbsp;&amp;nbsp;&amp;nbsp; PURGE&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FOR &amp;nbsp; j&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &quot;CADENA&amp;nbsp;&amp;nbsp; A &amp;nbsp; ENVIAR&quot;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&quot;:a:&quot;&amp;nbsp; {0 0}&amp;nbsp;&amp;nbsp; V}&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; INPUT&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OBJ→ &amp;nbsp;&amp;nbsp; &#39;a&#39;&amp;nbsp;&amp;nbsp;&amp;nbsp; STO &amp;nbsp;&amp;nbsp; a &lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9600 BAUD&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XMIT&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DROP&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NEXT&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;a&#39;&amp;nbsp;&amp;nbsp; PURGE &amp;gt;&amp;gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;****Programa en Pic Basic (Microcode)****&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;smallfont&quot; style=&quot;margin-bottom: 2px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;alt1&quot; dir=&quot;ltr&quot; style=&quot;border: 1px inset; height: 178px; margin: 0px; overflow: auto; padding: 6px; text-align: left; width: 500px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;
&#39;****************************************************************
&#39;*  Name    : UNTITLED.BAS                                      *
&#39;*  Author  : LONELY113                                         *
&#39;*  Notice  : Copyright (c) 2011 LONELY113                      *
&#39;*          : All Rights Reserved                               *
&#39;*  Date    : 12/05/2011                                        *
&#39;*  Version : 1.0                                               *
&#39;*  Notes   : PIC16F877a                                        *
&#39;*          : Pines de LCD:  RD7-RD4=D7-D4  (Modo de 4 bits)    *
&#39;*          :               RB0=RS, RB1=RW, RB2=E               *  
&#39;*          : Pin RC7/Rx=TxD de Hp50g                           *
&#39;*          : unir GND de Hp50g a GND de circuito               *
&#39;*          : Requiere adaptador de nivel 5V a 3.3V             *
&#39;****************************************************************

&lt;span style=&quot;color: #38761d;&quot;&gt;@ __CONFIG _WDT_OFF &amp;amp; _PWRTE_OFF &amp;amp; _CP_OFF &amp;amp; _HS_OSC &amp;amp; _BODEN_OFF &amp;amp; _LVP_OFF&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;DEFINE OSC 10 &lt;span style=&quot;color: blue;&quot;&gt;&#39;10 MHz&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;&#39;Definiciones para módulo LCD&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_BITS 4      &lt;span style=&quot;color: blue;&quot;&gt;&#39;Bus de 4 bits&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_LINES 2     &lt;span style=&quot;color: blue;&quot;&gt;&#39;LCD de 2 filas &lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_DREG PORTD  &lt;span style=&quot;color: blue;&quot;&gt;&#39;Puerto de datos a LCD&lt;/span&gt; &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_DBIT 4      &lt;span style=&quot;color: blue;&quot;&gt;&#39;Bits 4 a 7 de PORTD&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_RSREG PORTB &lt;span style=&quot;color: blue;&quot;&gt;&#39;Puerto B seleccion de registro &lt;/span&gt; &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_RSBIT 0     &lt;span style=&quot;color: blue;&quot;&gt;&#39;RB0=RS de LCD&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_RWREG PORTB &lt;span style=&quot;color: blue;&quot;&gt;&#39;Puerto B Lectura/Escritura&lt;/span&gt;  &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_RWBIT 1     &lt;span style=&quot;color: blue;&quot;&gt;&#39;RB1=RW de LCD &lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_EREG PORTB  &lt;span style=&quot;color: blue;&quot;&gt;&#39;Puerto B Habilitacionde LCD &lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_EBIT 2      &lt;span style=&quot;color: blue;&quot;&gt;&#39;RB2=E de LCD &lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_COMMANDUS 2000 &lt;span style=&quot;color: blue;&quot;&gt;&#39;Retardo ente comandos en us&lt;/span&gt; &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE LCD_DATAUS 50      &lt;span style=&quot;color: blue;&quot;&gt;&#39;Retardo entre datos en us &lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;&#39;Definiciones USART&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_RCSTA 90h  &lt;span style=&quot;color: blue;&quot;&gt;&#39;Habilitar registro de recepción&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_TXSTA 20h  &lt;span style=&quot;color: blue;&quot;&gt;&#39;Habilitar registro de transmisión&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;DEFINE HSER_BAUD 9600  &lt;span style=&quot;color: blue;&quot;&gt;&#39;9600 baudios&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color: black;&quot;&gt;dato VAR BYTE[16]&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;i VAR BYTE&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;loop1:&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; HSERIN [sTR dato\16] &lt;span style=&quot;color: blue;&quot;&gt;&#39;Espera 16 caracteres y guarda en dato&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; LCDOUT $FE,1         &lt;span style=&quot;color: blue;&quot;&gt;&#39;Borrar LCD&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; LCDOUT $FE, $0C      &lt;span style=&quot;color: blue;&quot;&gt;&#39;Primera fila, cursor off&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; FOR i=0 TO 15        &lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;  LCDOUT dato[i]      &lt;span style=&quot;color: blue;&quot;&gt;&#39;Enviar 16 caracteres ( en ASCII)&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt; NEXT i&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;
GOTO loop1&lt;/span&gt;
&lt;span style=&quot;color: black;&quot;&gt;END&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://lonely113.blogspot.com/feeds/1078312610443451971/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://lonely113.blogspot.com/2011/04/envio-de-cadena-de-caracteres-de-hp50g.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1078312610443451971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8126969217814028272/posts/default/1078312610443451971'/><link rel='alternate' type='text/html' href='http://lonely113.blogspot.com/2011/04/envio-de-cadena-de-caracteres-de-hp50g.html' title='Envio de cadena de caracteres de hp50g a PIC16F877A'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiamNTk09kBI85QA7LVuY0tBZRDTd4Z1Gug3WbQXiFpndfA_p2YXda3EtDymOfx0-KafqR6xEx9d-qjj923_cXTU3lCPODVI3REWFBLiDx0sP2YI-O9yOsQfycZVtLro7f2xCHR-UKWTNo/s72-c/hp50g_16f877a.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>