<?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-3065255669703027913</id><updated>2025-11-04T13:49:42.325+05:30</updated><title type='text'>PIC Microcontroller Programming</title><subtitle type='html'>This blog contain PIC Microcontroller Programming and it&#39;s application discussion. There are many helpful topics on PIC Microcontroller application. I have post my opinion and my practical experience on PIC Programming.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-3457901351030591473</id><published>2010-10-07T12:48:00.003+05:30</published><updated>2010-10-07T13:55:13.199+05:30</updated><title type='text'>Servo Motor Controller</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivZkstLOPmo7l2WzPJ8Tt7I04NDQpAhX6Chw7ec0gPrd3Kfj4xDOlYRb-1aEOMKCp-9DCFx2htJm2F4-K8V8bohOPCvbeShT_s8eooJqz6THjXkbeUxKRYkmEp4HZJEYHMoUcCWgyBq88/s1600/servo_01.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;197&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivZkstLOPmo7l2WzPJ8Tt7I04NDQpAhX6Chw7ec0gPrd3Kfj4xDOlYRb-1aEOMKCp-9DCFx2htJm2F4-K8V8bohOPCvbeShT_s8eooJqz6THjXkbeUxKRYkmEp4HZJEYHMoUcCWgyBq88/s320/servo_01.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;The servo motor is widely used in model hobbyist such as airplane R/C model for moving the rudder, ailerons, elevators and acceleration control or in the car R/C model for steering and acceleration control. In this tutorial we will learn how to control the servo motor as well as the simple close loop control algorithm for this servo motor.&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;br /&gt;
Since the internal control electronics of each servo motor expects to have position data updates at intervals of approximately 60 times per-second (60Hz), the timeout/label helps establish this timing without using additional pause commands or other methods. Notice from the scope trace below that we have 15mS delays between the servo pulses.  This corresponds to our 15mS delay time waiting for incoming serial data in the serial-input code line.  &lt;/span&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Pulse Position Modulation &lt;/b&gt;&lt;br /&gt;
The most important thing to remember from this servo tutorial is that all standard servos use the Pulse Position Modulation (PPM) language. A pulse is simply whether or not the control voltage is on or off. The amount of time that a pulse is on during a 2ms time frame dictates the servos position. This time frame, or sequence, repeats around 50 times per second. During the first half of this 2ms time frame, the pulse is always on. This starts a counter, so to speak, to tell the servo to start listening for the command. The second portion of this 2ms time frame is the command that dictates the position of the servo. &lt;br /&gt;
Take a look at the chart below to help you better understand this servo tutorial. The amount of time during the designated 2ms time frame that the pulse will be on for the three most extreme positions(far left, far right, neutral). There are an infinite amount of positions in between these values and amount of time the pulse is ON changes in proportion. This is what makes Pulse Position Modulation analogue. &lt;br /&gt;
Servo #1:&lt;br /&gt;
Far Left Command: Time ON = 1 + 0.0 ms = 1.0 ms &lt;br /&gt;
Servo #2:&lt;br /&gt;
Neutral Command: Time ON = 1 + 0.5 ms = 1.5 ms &lt;br /&gt;
Servo #3:&lt;br /&gt;
Far Right Command: Time ON = 1 + 1.0 ms= 2.0 ms &lt;br /&gt;
&lt;br /&gt;
The pulsout command uses the positional data received/stored in the byte-variable pos to generate the servo control pulses. The PIC12C671 is limited to a maximum oscillator speed of 4MHz, hence, the period of the generated pulses will be in 10uS increments.Now that we have the servo-pod ready to use, we need to figure out how to send positional data to the servo-pod that will let us position the servo motor.  As stated previously -- we know that the pulsout command is dependent on the oscillator frequency, and the pulse duration will be in 10uS increments when used in conjunction with an oscillator frequency of 4MHz.  Since the PIC12C671 maximum operating frequency is 4MHz, we&#39;ll have to make due with this resolution. The circuit diagram is given below:&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/AVvXsEjIsKwkj7TjIOYttsmO-i_yTq7nIYoFeBoXPeOOrvlKXlm_hLABJgdsHrt6THBxxmrIBfFLNjlEn3lm8ej5WCyLKmtBqdFOHkeGUJLRrJhwMPJVNFP1wGdUXW3dKcmC-YItFbTcT4YMe_8/s1600/servo-02.gif&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/AVvXsEjIsKwkj7TjIOYttsmO-i_yTq7nIYoFeBoXPeOOrvlKXlm_hLABJgdsHrt6THBxxmrIBfFLNjlEn3lm8ej5WCyLKmtBqdFOHkeGUJLRrJhwMPJVNFP1wGdUXW3dKcmC-YItFbTcT4YMe_8/s1600/servo-02.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;The Test Program: &lt;br /&gt;
Now that you&#39;re ready to start using the servo-pods, some test code to cycle the servo motors will be necessary.  Here&#39;s a quick &amp;amp; simple Basic Stamp routine that will cycle a servo motor attached to a servo-pod hard-coded with the unique ID #5.&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://hotfile.com/dl/74364803/fd6f25a/Expt7a.doc.html&quot;&gt;Download Source Code&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/3457901351030591473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/servo-motor-controller.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/3457901351030591473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/3457901351030591473'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/servo-motor-controller.html' title='Servo Motor Controller'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivZkstLOPmo7l2WzPJ8Tt7I04NDQpAhX6Chw7ec0gPrd3Kfj4xDOlYRb-1aEOMKCp-9DCFx2htJm2F4-K8V8bohOPCvbeShT_s8eooJqz6THjXkbeUxKRYkmEp4HZJEYHMoUcCWgyBq88/s72-c/servo_01.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-4941039360518405035</id><published>2010-10-07T10:55:00.000+05:30</published><updated>2010-10-07T10:55:50.224+05:30</updated><title type='text'>Stepper Motor Controller</title><content type='html'>&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Stepper motors, unlike ordinary DC motors, are brushless and can divide a full 360° into a large number of steps, for example 200. In robotics, stepper motors are widely used. They offer amazing precision as well as continuous rotation. Also, any inaccuracy between steps are non-cumulative; 200 steps will always be 1 revolution. These features make them ideal for driving the wheels on a robot, and creating linear motion using a leadscrew. The drawbacks are that they require current when not moving they are relatively expensive and they are quite heavy for the amount of torque they give.&amp;nbsp;&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/AVvXsEhqffpTrnFjZSEK11ukeb4GUT7ixCy-rRbJ1zoJeU-_3VRy_g5tI9rqstizBN7tShmRw7TuoZFp4PKuplEAGU1DeVajS1_1HAlkMdhl8XEX8062bQ9TeNqIfVxzqbUjYhi3u1ORemvONQw/s1600/half-step.gif&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/AVvXsEhqffpTrnFjZSEK11ukeb4GUT7ixCy-rRbJ1zoJeU-_3VRy_g5tI9rqstizBN7tShmRw7TuoZFp4PKuplEAGU1DeVajS1_1HAlkMdhl8XEX8062bQ9TeNqIfVxzqbUjYhi3u1ORemvONQw/s1600/half-step.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;By using an external stepper motor controller, such as the UCN 5804, you can simplify your programs and control as many motors as you have outputs via an array of UCN 5804&#39;s. Not only does it allow for the control of more motors, but more importantly, it simplifies the process. You now only have to output the pulse of your desired speed. Additionaly, you can switch between full and half stepping in real time via a switch on the UCN 5804 (or you may have the PIC control it), as well as reverse direction. A pinout for the UCN804 is shown in below:&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/AVvXsEjEXgu_uHczsdT_qPa_Vkw3zjxvnN_tfWTltqOrqSoDaCDhhTqFSmpjp3pnOzKkdud2KGEWRbsNDaWHuAwzqNj5XF30yET749cXzi9LxAmvtKmIN6yH9ojzjaLKC3ZSDtUjV7ksexMAzO8/s1600/Step2.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;210&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEXgu_uHczsdT_qPa_Vkw3zjxvnN_tfWTltqOrqSoDaCDhhTqFSmpjp3pnOzKkdud2KGEWRbsNDaWHuAwzqNj5XF30yET749cXzi9LxAmvtKmIN6yH9ojzjaLKC3ZSDtUjV7ksexMAzO8/s320/Step2.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;The PIC Basic language has a command that allows you to read the value of potentiometers on a given scale. This is the &quot;pot&quot; command, and is used in the following manner: &lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;b&gt;pot pin,scale,var &lt;/b&gt;&lt;br /&gt;
&lt;/span&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;Where pin is the pin the potentiometer is connected to (pins B0-7), scale is the maximum value the command will return (in this case 245, being the maximum amount of ms we want in between pulses), and var is the variable the value will be placed in. Using this command, we can determine the value of a potentiometer (we will be using a 50K ohm pot) and then use it to control the pulsewidth outputted to the UCN 5804. A schematic is shown in &lt;/span&gt;below:&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/AVvXsEjduS7iTG_roWgCVEgr_mGczMPXSuMHdtui5WRcu-FGZVGZ7vKB9gdtmCyz0x4L4zawvj8QY36GFM6EnAEpHmQ9nO8iBOFiO_MtkmNpKzl8k0AtcR-Jinxx4QvMJHXzk7VDO5BucdrM_LE/s1600/PIC_Step2.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;317&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjduS7iTG_roWgCVEgr_mGczMPXSuMHdtui5WRcu-FGZVGZ7vKB9gdtmCyz0x4L4zawvj8QY36GFM6EnAEpHmQ9nO8iBOFiO_MtkmNpKzl8k0AtcR-Jinxx4QvMJHXzk7VDO5BucdrM_LE/s320/PIC_Step2.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;span style=&quot;font-family: inherit;&quot;&gt;The Code in given below &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&#39; Controlling a stepper motor with the UCN 5804 and a potentiometer&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Symbol delay = B0 &lt;span&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; &lt;/span&gt;&#39; make a delay variable&lt;br /&gt;
low 1 &lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39; set the output enable low&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;start:&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
pot 2,245,delay &lt;span&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; &lt;/span&gt;&#39; read pot at pin B2&lt;br /&gt;
if delay &amp;lt; 25 min &lt;span&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; &lt;/span&gt;&#39; set min delay to 25&lt;br /&gt;
goto turn &lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;turn:&lt;/span&gt;&lt;/em&gt; &lt;span&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&#39; if delay is over 25, start moving&lt;br /&gt;
delay = delay * 1000 &lt;span&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; &lt;/span&gt;&#39; turn delay into microseconds&lt;br /&gt;
pulsout 0,delay &lt;span&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; &lt;/span&gt;&#39; send to UCN 5804&lt;br /&gt;
goto start&lt;span&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; &lt;/span&gt;&#39; go back to start &lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;min:&lt;/span&gt;&lt;/em&gt; &lt;br /&gt;
delay = 25 &lt;span&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; &lt;/span&gt;&#39; bottom out the delay at 25&lt;br /&gt;
goto turn&lt;span&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; &lt;/span&gt;&#39; start the motor&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/4941039360518405035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/stepper-motor-controller_07.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4941039360518405035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4941039360518405035'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/stepper-motor-controller_07.html' title='Stepper Motor Controller'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqffpTrnFjZSEK11ukeb4GUT7ixCy-rRbJ1zoJeU-_3VRy_g5tI9rqstizBN7tShmRw7TuoZFp4PKuplEAGU1DeVajS1_1HAlkMdhl8XEX8062bQ9TeNqIfVxzqbUjYhi3u1ORemvONQw/s72-c/half-step.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-2834621230906492821</id><published>2010-10-06T14:15:00.000+05:30</published><updated>2010-10-06T14:15:23.519+05:30</updated><title type='text'>Object Replacing With Line Follow Robot</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dzDQmAHrxYFJRpiwo1DveB4TfE4S2bX1ooCieUKWig0Q3_Ugvltdmuc3oMHQLzyECDWdXK4IxaALv8Vz5h7Zg&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;
This given video representing Object Replacing With Line Follow Robot. This robot has many complex features and application. These in a robotic hand which used for replacing the object.&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;[I can not give the Source Code and Hex File.]&lt;/span&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/2834621230906492821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/object-replacing-with-line-follow-robot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2834621230906492821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2834621230906492821'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/object-replacing-with-line-follow-robot.html' title='Object Replacing With Line Follow Robot'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-168408888731827864</id><published>2010-10-05T16:36:00.002+05:30</published><updated>2010-10-06T14:08:42.405+05:30</updated><title type='text'>Line Follow Robot</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglWEHcpoWQQJlB1h3-lBspWi4R6WiPiftMFn-43sGditsWM5ob0V9xdfcSMANXiFtxU_bEoLzhZC3ufJPZjAcC2EyhcKsVg5A01yPxqBhCO6ta0eIvp4hRNq-RExkHsMBEIiztifhD2ho/s1600/linefolow3.jpg&quot;&gt;&lt;img height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglWEHcpoWQQJlB1h3-lBspWi4R6WiPiftMFn-43sGditsWM5ob0V9xdfcSMANXiFtxU_bEoLzhZC3ufJPZjAcC2EyhcKsVg5A01yPxqBhCO6ta0eIvp4hRNq-RExkHsMBEIiztifhD2ho/s200/linefolow3.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgefazgO5wXEEBvzbN5jdVxZ5mepsw4zpl_5jHnpDcMkAFaxMkgTPhFWja4rXlGBHgHfqpOLe_cMNj7cP_hiI4Jd6c_abgYHS7Ca2xg-ybTzQgYrHvtcNff8OsRTOy1BxSIWZCCBAsq4uo/s1600/linefolow.jpg&quot;&gt;&lt;img height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgefazgO5wXEEBvzbN5jdVxZ5mepsw4zpl_5jHnpDcMkAFaxMkgTPhFWja4rXlGBHgHfqpOLe_cMNj7cP_hiI4Jd6c_abgYHS7Ca2xg-ybTzQgYrHvtcNff8OsRTOy1BxSIWZCCBAsq4uo/s200/linefolow.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjnR6uNrkLUMY8X6Xj6WteeB6L9F8peyiIB3s_ZnTMvcaMSSSTfDdQ9LwVb2B0s2nc_qiJ36oEeh1ENTHxe54lZ1HbDNL0_dmvJqEZFQ5E6ztfJ8gYYDcaoQmvs1o8G5dEZQOrv3rmIyw/s320/linefolow2.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The above photos are representing my hand made first “Line Follow Robot”. This robot can follow simultaneously white line or black line. It also can work in 90 degree angle type line, small circle, end of line etc.&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;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dw4VNcX2_rg0aCNinYPAHcpufkZs-Ua3gKpZ4yKew1Itie_m_jCMkH4kt0SSDVQzhyRqh6aKH4Zmz8LTcxT3A&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dwrxtpxymTS3qAfwz4YNLnHojQUmD5pXq7r44ryJrPStfB3F5JHPQRvoGLsFnUJ9m1YN-YVCHsGA0esZQYQcA&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt; &lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Testing the robot&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp; I created courses for the robot to follow out of black and white electrical insulation tape, using one colour per course. For each course I initially balanced the robot&#39;s left and right sensors and adjusted the brightness of the headlight LEDs. &lt;br /&gt;
One of the tests was to determine the ability of the robot to sense lines under various conditions. For this, I measured the voltage at each of the robot&#39;s sensor test points after placing it directly over the top of a straight line in a course, with it&#39;s motors switched off. I repeated the test with the robot pointing slightly to the right and then to the left of the line. &lt;br /&gt;
The measurements were taken with a box covering the robot to shield it from all ambient light and then with the box removed so that I could measure the impact of the room&#39;s lighting.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/73921053/8a443a7/robot.asm.html&quot;&gt;Download Source Code&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/73921144/7c61699/robot.hex.html&quot;&gt;Download Hex File&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/168408888731827864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/line-follow-robot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/168408888731827864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/168408888731827864'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/line-follow-robot.html' title='Line Follow Robot'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglWEHcpoWQQJlB1h3-lBspWi4R6WiPiftMFn-43sGditsWM5ob0V9xdfcSMANXiFtxU_bEoLzhZC3ufJPZjAcC2EyhcKsVg5A01yPxqBhCO6ta0eIvp4hRNq-RExkHsMBEIiztifhD2ho/s72-c/linefolow3.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-3415686377248932141</id><published>2010-10-05T15:59:00.000+05:30</published><updated>2010-10-05T15:59:33.308+05:30</updated><title type='text'>Low cost multfunctional frequency counter</title><content type='html'>&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/AVvXsEiyxlxh4haQsZX5302OZ60S-6kQ9_QDvb5n_tGqmylKMIJayeUlDK5nlBo1rbYfOpf6mlp3a0Yv2TJVYUINT3vpsuc3dZUEizpOAqlN9p0UApsK4cFBdx3Y3bSSIVVB0qGw1OlMnkdIe8Y/s1600/freq_counter.png&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/AVvXsEiyxlxh4haQsZX5302OZ60S-6kQ9_QDvb5n_tGqmylKMIJayeUlDK5nlBo1rbYfOpf6mlp3a0Yv2TJVYUINT3vpsuc3dZUEizpOAqlN9p0UApsK4cFBdx3Y3bSSIVVB0qGw1OlMnkdIe8Y/s400/freq_counter.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;/span&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;We are introducing a low cost multifunctional seven digit LCD frequency counter, for your HAM radio shack. This frequency counter is designed in such a way that it can be used for direct frequency measurement or with any of the commercial / home made radio/transceiver as a digital frequency display. The power consumption of the counter is very low. It could be operated with even an ordinary 9V battery for a long period. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; This frequency counter contains only a few components. The brain of the unit is a PIC 16F84 micro-controller. The LCD display used is a state of the art, commonly available 16 characters dot matrix in one line unit. The other main attractive feature is the use of a single transistor as the input amplifier, which will give a sensitivity of less than 150 m.V with a very high bandwidth. With this, the counter is useful for the measurement of a wide variety of input wave forms without loosing the accuracy. The counter is capable of measuring frequency up to 35MHz in normal condition and is suitable up to 3.5GHz with pre-scalar. &lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;u&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;MAIN FEATURES &lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;10 Hz frequency resolution.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; Direct frequency measurement.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Seven offset channels selectable with a push button. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Each offset channel got 3 options (VFO + IF) , (VFO IF), ( IF - VFO ) selectable with a three position switch.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Eg.1 Suppose IF is 9MHz (9MHz SSB filter using with home made TRX) and VFO is 2 MHz you have to select the third option (IF-VFO) ie (9 2) = 7 for 40 mtr operation.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Eg.2 Suppose IF is 9MHz and VFO is 5MHz you have to select the first option VFO+IF ie 9 + 5 = 14 for 20 mtr operation With this offset channel selection option you can simply input the VFO frequency to the counter with out any conventional mixing for displaying the operating frequency&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;In each of the above offset channel option, it is possible to select USB/LSB displayed as N / R (Normal / Reverse) selectable with another 2 position slide switch. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;http://hotfile.com/dl/73913606/aed0dfe/freq_count.HEX.html&quot;&gt;Download Hex File&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/3415686377248932141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/low-cost-multfunctional-frequency.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/3415686377248932141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/3415686377248932141'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/low-cost-multfunctional-frequency.html' title='Low cost multfunctional frequency counter'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyxlxh4haQsZX5302OZ60S-6kQ9_QDvb5n_tGqmylKMIJayeUlDK5nlBo1rbYfOpf6mlp3a0Yv2TJVYUINT3vpsuc3dZUEizpOAqlN9p0UApsK4cFBdx3Y3bSSIVVB0qGw1OlMnkdIe8Y/s72-c/freq_counter.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-4421067023767123535</id><published>2010-10-05T15:43:00.000+05:30</published><updated>2010-10-05T15:43:00.984+05:30</updated><title type='text'>Light Detection</title><content type='html'>&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/AVvXsEifB2lts-Bs9dIhaBbUuxcSGUYvhS5N3QHdAZn-mxd2ORQh_v55dtYB3TZKOtWZcabqO2hQ_Yc7dDr-c_m7TOLjjcea6qy2JK3zjSOsQJE-sJn76itEN9tDruODSpQJ31IeBaLXdJgAiMQ/s1600/rgb-led-used-in-color-detection-circuit.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifB2lts-Bs9dIhaBbUuxcSGUYvhS5N3QHdAZn-mxd2ORQh_v55dtYB3TZKOtWZcabqO2hQ_Yc7dDr-c_m7TOLjjcea6qy2JK3zjSOsQJE-sJn76itEN9tDruODSpQJ31IeBaLXdJgAiMQ/s320/rgb-led-used-in-color-detection-circuit.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
This experiment detects the presence of light. A photo-darlington transistor is connected to the circuit via a plug and socket and exposed to light. The change in resistance of the photo-darlington transistor creates a voltage change across it and this is amplified by the circuit and delivered to an input of the microcontroller. The program turns on the 8 LEDs when the photo-darlington transistor detects change in illumination.  The photo-darlington transistor is connected to the circuit via a capacitor and only CHANGES in illumination are detected. &lt;br /&gt;
If the illumination is decreased, a point will be obtained where the circuit is sensitive to the changes in supply rail voltage. At this point the circuit will start to oscillate or MOTOR-BOAT. The circuit must be re-designed to prevent this from occurring.  If the photo-darlington transistor is placed in a room with incandescent lighting, the 50 or 60Hz from the light will be detected. These pulses must be dealt with by the program to obtain a reliable HIGH/LOW pulse. &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.blogger.com/goog_838237903&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/73910129/802de2f/aaaaaaaaaa.JPG.html&quot;&gt;Download Source Code&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/4421067023767123535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/light-detection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4421067023767123535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4421067023767123535'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/light-detection.html' title='Light Detection'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifB2lts-Bs9dIhaBbUuxcSGUYvhS5N3QHdAZn-mxd2ORQh_v55dtYB3TZKOtWZcabqO2hQ_Yc7dDr-c_m7TOLjjcea6qy2JK3zjSOsQJE-sJn76itEN9tDruODSpQJ31IeBaLXdJgAiMQ/s72-c/rgb-led-used-in-color-detection-circuit.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-1396694724761328310</id><published>2010-10-05T15:35:00.002+05:30</published><updated>2010-10-05T15:35:32.882+05:30</updated><title type='text'>Measuring Resistance</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
This experiment measures resistance. You can get very low-cost digital multimeters to measure resistance and display the value on a four digit display. We cannot compare with cost and complexity of this type of display, but our circuit has other features. It will activate a device when a particular value of resistance is detected. This allows measurement of degrees of rotation of a potentiometer or the conductivity of a liquid (via two probes), plus many other areas where resistance values change. Our demonstration program uses a potentiometer to detect resistance in the range 0k to 10k however any other range can be read, by changing the value of C. The accuracy of the circuit is determined by the tolerance of C (most capacitors are 10%). The time taken to produce a low on the input is used as a jump value in a look-up table and a display-value is obtained for the 7-segment display. For simplicity, the values 0 to 9, plus &quot;-&quot; overflow, are displayed. Further experiments show two and three-digit accuracy. &lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://hotfile.com/dl/73896882/5dfa098/Expt7a.doc.html&quot;&gt;Download SourceCode&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/1396694724761328310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/measuring-resistance_05.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/1396694724761328310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/1396694724761328310'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/measuring-resistance_05.html' title='Measuring Resistance'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-5228117693403188424</id><published>2010-10-05T15:32:00.000+05:30</published><updated>2010-10-05T15:32:16.967+05:30</updated><title type='text'>Pulse Detection with a coil</title><content type='html'>&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/AVvXsEg1BgLG45oXPuQqNo8vjxf7cvl19CSYdmHc2A9EN5s_jPVbUzozde7rFzs8u1r9AQ4Thuy0NmqN_nl6THvvBEyINRyzw67gXtHaz4m1LwUUtKxOIWJlo7H7AyIVGTfgTFHndn0R5UgMdp8/s1600/Dual-Coil.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1BgLG45oXPuQqNo8vjxf7cvl19CSYdmHc2A9EN5s_jPVbUzozde7rFzs8u1r9AQ4Thuy0NmqN_nl6THvvBEyINRyzw67gXtHaz4m1LwUUtKxOIWJlo7H7AyIVGTfgTFHndn0R5UgMdp8/s400/Dual-Coil.jpg&quot; width=&quot;400&quot; /&gt;&amp;nbsp;&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: justify;&quot;&gt;This experiment uses a coil to detect pulses. A magnet is moved past a coil and this creates a voltage in the turns of the coil.  This is ideal for picking up the rotation of a shaft. It is non-mechanical and will have an infinite life. Reed switches have a very short life when used rapidly to detect shaft rotation and have a fairly low speed of operation.  The output voltage of a coil is fairly low and needs two stages of amplification for the signal to be large enough to be detected by the input of a microcontroller. The clever arrangement on the front end of the analogue amplifier of the PIC LAB-1 board allows a microphone or coil to be fitted. The coil does not require the resistor, (it is required by the electret microphone) however it does not affect the operation.  This demonstration program increments the 7-segment display. &lt;/div&gt;This allows a count-of-ten however experiments on the web include a 2 and 3-digit readout from the 7-segment display and an RPM counter.   The advantage of a magnetic pickup is the lack of switch-noise.  The pulses from the pick-up are very clean but must be debounced for low-speed detection. The 2-stage amplifier increases the sinewave signal and over-amplifies it to produce a rail-to-rail signal commonly called a square-wave or digital signal. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://hotfile.com/dl/73907836/bf890df/Suman_Adhya.doc.html&quot;&gt;Download Source Code&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;3&quot; cellspacing=&quot;0&quot; style=&quot;width: 492px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;#ffffff&quot; colspan=&quot;3&quot; width=&quot;484&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td bgcolor=&quot;#ffffff&quot; valign=&quot;top&quot; width=&quot;37&quot;&gt;&lt;/td&gt;&lt;td bgcolor=&quot;#ffffff&quot; valign=&quot;top&quot; width=&quot;115&quot;&gt;&lt;/td&gt;&lt;td bgcolor=&quot;#ffffff&quot; valign=&quot;top&quot; width=&quot;316&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/5228117693403188424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/pulse-detection-with-coil.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/5228117693403188424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/5228117693403188424'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/pulse-detection-with-coil.html' title='Pulse Detection with a coil'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1BgLG45oXPuQqNo8vjxf7cvl19CSYdmHc2A9EN5s_jPVbUzozde7rFzs8u1r9AQ4Thuy0NmqN_nl6THvvBEyINRyzw67gXtHaz4m1LwUUtKxOIWJlo7H7AyIVGTfgTFHndn0R5UgMdp8/s72-c/Dual-Coil.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-7091314414319674109</id><published>2010-10-05T14:32:00.000+05:30</published><updated>2010-10-05T14:32:42.104+05:30</updated><title type='text'>Analog  to Digital Conversion Using PIC16F84</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;This experiment shows 0-256 parts of a 10k potentiometer on the 8 LEDs. It is not accurate, but shows the concept of A to D conversion. Many microcontrollers have an input that can read any value of voltage from 0v to 5v (and higher by using a voltage divider network). Normally there are 256 steps in this range to produce a resolution of approx 20mV for 0-5v scale.  This is called an A to D input (A to D converter - analogue input) and is ideal for measuring voltages and other values that are classified as ANALOGUE. A very simple external circuit can be added to measure different parameters such as the change in resistance of a temperature probe and other analogue devices. The PIC16F84 does not have an internal A to D converter, however we can create an A to D feature by using two lines and a sub-routine. To create an analogue input, a capacitor &quot;C&quot; is connected in series with an unknown resistor (R) and charged via one of the lines of the microcontroller. The diagram below shows how this is done.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&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/AVvXsEj-Pgrr_Q0Tqz6MRQbq49UTQj861IWrKRX7dgWNRquaOGZXkzw0Atwwofe0WSA35C08WF1EX_ESLe6rsk2JeVNv4dn1tjhihvhPyoLXeVP4hJENmyUtjfMdC_FwgMWshDomk538Pv4u1zQ/s1600/PotToPIC333.gif&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/AVvXsEj-Pgrr_Q0Tqz6MRQbq49UTQj861IWrKRX7dgWNRquaOGZXkzw0Atwwofe0WSA35C08WF1EX_ESLe6rsk2JeVNv4dn1tjhihvhPyoLXeVP4hJENmyUtjfMdC_FwgMWshDomk538Pv4u1zQ/s1600/PotToPIC333.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; The first diagram shows a resistor and capacitor connected in series. This is called a TIME DELAY circuit. The capacitor is initially uncharged and the resistor charges the capacitor to a specified value. The time taken to reach this value is called the Time Delay.  The mid-point of the two components is called the &quot;detection point.&quot; It does not matter if the resistor is above the capacitor or below. The same Delay Time (or a similar time) will be produced.&lt;br /&gt;
In the second diagram the capacitor is above the resistor and if the top line is taken HIGH, the voltage at the detection point will fall to a specified value after a Delay Time.  If the value of the resistor is changed, the time taken for the voltage at the detection point to reach a specified value will alter.  That&#39;s exactly what happens in the third circuit above.  The micro monitors the voltage on the detection point and when it reaches the lower threshold for the input line, the program displays the &quot;count-value&quot; on the 8 LEDs. &lt;br /&gt;
The other feature that has to be worked out is the time taken for the capacitor to charge. In our circuit, the capacitor has charged before 255 loops have been executed (when the pot is at maximum resistance) and we cannot same at a faster rate, so the maximum display-value is &quot;DF.&quot; To obtain a full reading, the capacitor will need to be increased in value. &lt;span style=&quot;color: black; font-family: Arial; font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.mediafire.com/i/?15tzbt9p4upc0oi&quot;&gt;Download Source Code &lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/7091314414319674109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/analog-to-digital-conversion-using.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7091314414319674109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7091314414319674109'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/analog-to-digital-conversion-using.html' title='Analog  to Digital Conversion Using PIC16F84'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-Pgrr_Q0Tqz6MRQbq49UTQj861IWrKRX7dgWNRquaOGZXkzw0Atwwofe0WSA35C08WF1EX_ESLe6rsk2JeVNv4dn1tjhihvhPyoLXeVP4hJENmyUtjfMdC_FwgMWshDomk538Pv4u1zQ/s72-c/PotToPIC333.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-2869396412411101646</id><published>2010-10-05T14:16:00.000+05:30</published><updated>2010-10-05T14:16:11.143+05:30</updated><title type='text'>Hee Haw Sound</title><content type='html'>&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/AVvXsEgqGzg4CNI3Z1GBz9seEbG8EUwTJq91IcRw7t3hb1KZoCiXUvqTWXDZI_zNmi3XkkoVQtmk6NWgfSOlMK1D1xdoiSnlw44uXfS9PPwpFMEkyvJlFZXVsmG2ifEuAFU90N1p7QP2HSsYdzY/s1600/HeeHawWaveform333.gif&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;84&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqGzg4CNI3Z1GBz9seEbG8EUwTJq91IcRw7t3hb1KZoCiXUvqTWXDZI_zNmi3XkkoVQtmk6NWgfSOlMK1D1xdoiSnlw44uXfS9PPwpFMEkyvJlFZXVsmG2ifEuAFU90N1p7QP2HSsYdzY/s320/HeeHawWaveform333.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;This experiment creates a Hee Haw sound for an alarm. The diagram shows the number of cycles for the HEE and the time taken for each cycle, equates to a certain length of time. The frequency of the HAW is lower and the number of cycles must be worked out so that the time for the HAW is equal to the time for the HEE. This is simple when writing the program. The values loaded into the two files for the HEE are reversed for the HAW. The routine consists of two sections: HEE and HAW. Each section has two nested loops. The inner loop creates the length of time for the HIGH and LOW to produce a single cycle and the outer loop creates the number of cycles.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.mediafire.com/?s5t5yrwpba93bxm&quot;&gt;Download Source Code&lt;/a&gt; &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/2869396412411101646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/hee-haw-sound_05.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2869396412411101646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2869396412411101646'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/hee-haw-sound_05.html' title='Hee Haw Sound'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqGzg4CNI3Z1GBz9seEbG8EUwTJq91IcRw7t3hb1KZoCiXUvqTWXDZI_zNmi3XkkoVQtmk6NWgfSOlMK1D1xdoiSnlw44uXfS9PPwpFMEkyvJlFZXVsmG2ifEuAFU90N1p7QP2HSsYdzY/s72-c/HeeHawWaveform333.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-779416928191870579</id><published>2010-10-02T08:28:00.000+05:30</published><updated>2010-10-02T08:28:16.598+05:30</updated><title type='text'>Moving Message Display</title><content type='html'>&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/AVvXsEh4UId7r5HBPfJXqR5gWXpElBUYLdvcUuUwnDYCzOSwJYMpj8lKtjOfC2hmWcB5-QzhwuxFJBSAQsZesZ4VsgK_UTGioC1uLLJf_GsQvWbBoPqkkkopKTsjsN4U4dTeoHmM9RY4XmIpqhI/s1600/picMD.gif&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/AVvXsEh4UId7r5HBPfJXqR5gWXpElBUYLdvcUuUwnDYCzOSwJYMpj8lKtjOfC2hmWcB5-QzhwuxFJBSAQsZesZ4VsgK_UTGioC1uLLJf_GsQvWbBoPqkkkopKTsjsN4U4dTeoHmM9RY4XmIpqhI/s1600/picMD.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;table style=&quot;width: 500px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;br /&gt;
&lt;/td&gt;&lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; It is possible to process periodically with the hardware timer. While the hardware timer is counting time, the software can do the other processing.  In the software, the scroll of the message is periodically done by the interruption processing of hardware timer. And the lighting-up control processing of LEDs is executed in the waiting time of scroll. The Circuit diagram of this project is given below.&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/AVvXsEjOUiq-NFqSLFkRwiNzZoV_nX1hbTWmqCpF-BQPL0VTTecEWG4dDcH7PRmnFxMY8mnQJqh9smDNSltcgwDef4DPQhoXgxlz-syB1NWY3X5F9eHncp6kBjHIkYObDOxmdwiuSHingZpRQEM/s1600/picMD2.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOUiq-NFqSLFkRwiNzZoV_nX1hbTWmqCpF-BQPL0VTTecEWG4dDcH7PRmnFxMY8mnQJqh9smDNSltcgwDef4DPQhoXgxlz-syB1NWY3X5F9eHncp6kBjHIkYObDOxmdwiuSHingZpRQEM/s640/picMD2.gif&quot; width=&quot;472&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;&lt;span style=&quot;font-size: small;&quot;&gt;LED control circuit&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhwi4k5c3tSpsUqWz6Y-PBSWnxACL3UOdNM_SxiQkJFPrdYEAa4IEA7piNieGVdVQVS5j1x8GcX0wvZWdb1kFvjfK5VYFZUTMDcI6b0XwxpogWZyRNKrTmCBwgC4Itmb_iXpglrcDnMR4/s1600/picMD3.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhwi4k5c3tSpsUqWz6Y-PBSWnxACL3UOdNM_SxiQkJFPrdYEAa4IEA7piNieGVdVQVS5j1x8GcX0wvZWdb1kFvjfK5VYFZUTMDcI6b0XwxpogWZyRNKrTmCBwgC4Itmb_iXpglrcDnMR4/s1600/picMD3.gif&quot; /&gt;&lt;/a&gt;
&lt;li&gt;As for the left figure, all RA ports are in the L level condition. In this case, only outout-0 of 74HC154 is L level. Then, only TR1 is in the ON condition, the other transistors are in the OFF condition. So, only the LEDs which are connected with TR1 are in the lighting-up possible condition. The lighting-up of the LED is decided in the condition of the RB7-RB0 ports. In case of the left figure, because RB0 and RB4 are L level, D1 and D5(It isn&#39;t displayed in figure) light up. The other LEDs are connected with RB0 and RB4 can&#39;t be lit up, because the transistors for the power supply to those LEDs are in the OFF condition.&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;The figure on the left shows the situation of the LED  blink by the RA ports and the RB ports of PIC16F84A.&lt;/span&gt;  &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;You can find that the lighting-up time of one LED is 1/16  with this animation.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;  &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;If using latch registers for each LED row, the  lighting-up time of the LEDs can be made long.&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt; I don&#39;t use latch registers because the printed board  space needs more.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;/span&gt; &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/73139842/43a4e4e/sign.asm.html&quot;&gt;Download Source code&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://hotfile.com/dl/73139937/741d96c/SIGN.HEX.html&quot;&gt;Download Hex File&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/779416928191870579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/moving-message-display.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/779416928191870579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/779416928191870579'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/moving-message-display.html' title='Moving Message Display'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4UId7r5HBPfJXqR5gWXpElBUYLdvcUuUwnDYCzOSwJYMpj8lKtjOfC2hmWcB5-QzhwuxFJBSAQsZesZ4VsgK_UTGioC1uLLJf_GsQvWbBoPqkkkopKTsjsN4U4dTeoHmM9RY4XmIpqhI/s72-c/picMD.gif" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-4559124537377897346</id><published>2010-10-02T00:18:00.000+05:30</published><updated>2010-10-02T00:18:10.723+05:30</updated><title type='text'>Room temperature controller</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_g1.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_g1.gif&quot; width=&quot;458&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
This equipment uses two temperature sensors, drives external equipment, and keeps the temperature of the room at preset temperature. The purpose of this equipment is for preventing room temperature going up with the heat of the computers. Electric cost will become high if an air-conditioner is always operated. Then, I made the equipment which adjusts the temperature of the room automatically using some ventilation fans. The function below preset temperature is a function attached moreover. I think that it can use for temperature control, such as a greenhouse. Control mode(works over preset or below preset) is changed with a switch.&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;LED display and SW reading circuit&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;img align=&quot;LEFT&quot; alt=&quot;&quot; height=&quot;340&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_g3_02.gif&quot; width=&quot;205&quot; /&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;7 bits of low ranks of PORTB are used for lighting of 7  segment LED, and reading of BCD switch in common. PORTC and the 8th bit  of PORTB is used for designation of a device. The mode change of PORTB  is required of LED control and BCD-SW control. This change is performed  by software.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The diode connected to the BCD switch is for prevention  of illegal current. With a BCD switch, a common terminal and each  terminal corresponding to a bit short-circuit by setup. If there is no  diode, the setting state of a switch will influence operation of other  devices. In the case of a silicone diode, V&lt;sub&gt;F&lt;/sub&gt; is about 0.6V.  When L level detection of the PIC cannot be normally carried out with  this voltage, it is better to change a diode into other kinds.(Germanium  etc.)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;External equipment drive circuit&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;img align=&quot;LEFT&quot; alt=&quot;&quot; height=&quot;188&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_g3_06.gif&quot; width=&quot;196&quot; /&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This is the circuit which controls external equipment.  Although based on the drive current of the relay to be used, in this  case, the drive circuit which uses a transistor is adopted.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt; &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt; &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt; &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt; &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt; &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt; &lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Temperature sensor circuit&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;img align=&quot;LEFT&quot; alt=&quot;&quot; height=&quot;139&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_g3_01.gif&quot; width=&quot;262&quot; /&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A temperature sensor (LM35DZ) can measure from 0°C to  100°C. However, the output is 0V at 2°C. Therefore, the voltage of minus  is required in order to measure 0°C. Since the minus power supply is  not used with this equipment, the measurable temperature is above 2°C.  The output of a sensor goes up by 10mV for every 0°C. The output voltage  in 32°C is 300mV.&lt;/span&gt; &lt;span style=&quot;font-size: small;&quot;&gt;The output voltage of a sensor is amplified by an  operational amplifier, and is inputted into the A/D converter of PIC.  Proofreading of a temperature display is performed by adjusting the gain  of an operational amplifier by VR. In this circuit, in order to  simplify a circuit, the operational amplifier which operates with a plus  single power supply is used.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/73074209/96ee234/tempcont.asm.html&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Download Source File&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/73074280/bc44871/tempcont.HEX.html&quot;&gt;Download Hex File&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt; &lt;div style=&quot;font-family: inherit;&quot;&gt; &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/4559124537377897346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/room-temperature-controller.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4559124537377897346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4559124537377897346'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/room-temperature-controller.html' title='Room temperature controller'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-2652466201797502998</id><published>2010-10-01T16:20:00.001+05:30</published><updated>2010-10-01T16:20:16.357+05:30</updated><title type='text'>RF Remote Controller (Receiver)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&amp;nbsp;&lt;img align=&quot;BOTTOM&quot; alt=&quot;&quot; height=&quot;320&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8a.gif&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
The given circuit diagram representing the receiver section of previous RF Remote Controller.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;FET amplification circuit is used for a high frequency  amplification circuit of the receiver.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; It is because the getting of parts is easy. So, it  doesn&#39;t have high sensitivity.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; To make the receiver with high sensitivity, the circuit  which used IC for FM receiver is good.&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;High frequency amplification circuit&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;img align=&quot;LEFT&quot; alt=&quot;&quot; height=&quot;216&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8c1.gif&quot; vspace=&quot;0&quot; width=&quot;367&quot; /&gt; &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;The 2 stages FET amplifier is used for the high frequency  amplification. The FET amplifies only at the voltage to apply to gate  (G). The resistor to be putting in the source (S) of the FET is to make  the bias voltage of the gate. When making a resistance value big,  voltage of the source goes up to the grounding and the bias voltage  becomes big. In case of the gain of the amplifier is big, when the  signal of the output returns to the input, an amplifier oscillates. In  the case, it makes this resistance value big and the gain must be  lowered.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;The power of the FET connects with the center tap of the  coil (L2 and L3) to be putting in the side of drain (D). This is to make  do operation to have been stable, improving the characteristic of the  resonance circuit. The characteristic of the resonance circuit is called  queue (Q). The ideal resonance circuit picks up only a resonant  frequency. However, the actual resonance circuit becomes a shape like  the mountain which made a resonant frequency a top. When the Q of the  resonance circuit is high, the voltage at the resonant frequency becomes  high and the resonant characteristic becomes good.&lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Detection circuit&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt; &lt;img align=&quot;LEFT&quot; alt=&quot;&quot; height=&quot;112&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8c3.gif&quot; width=&quot;130&quot; /&gt; &lt;span style=&quot;font-size: small;&quot;&gt;Rectifying the output of the high-frequency amplifier  directly with Germanium diode and it makes the DC voltage from high  frequency voltage. This circuit can get twice voltage compared with  usual rectification circuit. Because the charging takes time when the  value of the capacitor (C6) to use for input is big, the change of the  output voltage becomes late. I decided a value of this capacitor by the  cut &amp;amp; try.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;120&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8c4.gif&quot; width=&quot;405&quot; /&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Relay drive circuit&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;img align=&quot;LEFT&quot; alt=&quot;&quot; height=&quot;211&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8c7.gif&quot; width=&quot;320&quot; /&gt; &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;RB5 and RB7 port of PIC make do the operation of the  relays. It is converting the output voltage of PIC with the transistor.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt; &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;It makes LED light up to find the operation of the relay.  It puts a resistor in the LED in series and it is limiting the electric  current which flows through the LED to about 10 mA.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;/span&gt; &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;It is putting a diode in parallel with the relay. When  the drive electric current of the relay passes away, the back  electromotive force occurs to the coil of the relay. A transistor is  prevented from the high voltage by passing the electric current of the  back electromotive force to this diode. Because the relay to be using  this time is small, there are few gravities that the transistor breaks  even if it doesn&#39;t put a diode. I put it for the safety.&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Time Chart for Receiver&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;clear: left; float: left; font-family: inherit; margin-bottom: 1em; margin-right: 1em; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;clear: left; float: left; font-family: inherit; margin-bottom: 1em; margin-right: 1em; text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8e.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img align=&quot;BOTTOM&quot; alt=&quot;&quot; border=&quot;0&quot; height=&quot;145&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8e.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&amp;nbsp;First, the  receiver confirms that the electric wave  exists. A 5-millisecond timer is set when an electric wave is received  and the input signal becomes ON. The signal which is sent from the  transmitter is a 10-millisecond interval. To detect ON/OFF in the  position of the stable state, it is shifting for 5 milliseconds&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;from the  standing-up of the signal.&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/72985335/165b6c3/remo_r.asm.html&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;Download Source Code&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/72985473/b017de9/REMO_R.HEX.html&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;Download Hex File&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/2652466201797502998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/rf-remote-controller-receiver.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2652466201797502998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2652466201797502998'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/rf-remote-controller-receiver.html' title='RF Remote Controller (Receiver)'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-8282569686260659344</id><published>2010-10-01T08:25:00.000+05:30</published><updated>2010-10-01T08:25:06.147+05:30</updated><title type='text'>RF Remote Controller (Transmitter)</title><content type='html'>&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/AVvXsEiqstBwdhSqHh7OQ1oUvKyQ_Sbkp-RklOFfdXpc8xqwYJp1U3hCPkLLPJY1AeowAOPiGeXXhkX1UZG3rtQIPGYlGEw72VWGuFK0I4JzwnkU5AFra933HEhDE2qZbuPKYze0KRwcCCeE004/s1600/pic6_81.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqstBwdhSqHh7OQ1oUvKyQ_Sbkp-RklOFfdXpc8xqwYJp1U3hCPkLLPJY1AeowAOPiGeXXhkX1UZG3rtQIPGYlGEw72VWGuFK0I4JzwnkU5AFra933HEhDE2qZbuPKYze0KRwcCCeE004/s400/pic6_81.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The control code does the electric wave of the transmitter to the control of ON/OFF. At design first, I examin the adoption of the frequency modulation (FM) method by the control code. However, I adopted an electric wave ON/OFF method because the circuit was simple.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_839.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_839.gif&quot; /&gt;&lt;/a&gt;A control code is controlled by the software of PIC. With this, the  control code can be easily changed. There are two purposes in this  control code. The 1st is to secure security. The FM electric wave  which was modulated at the single frequency can be made with the other  equipment, being easy. At the circuit this time, a control code with  byte(8bits) is used. To recognize a control code, to detect a specific  signal in front of it is needed. Also, it makes not recognize a normally  control code when not detecting a normally signal more than one time. The 2nd is to change the kind of the control. The kind to control are  designated by the contents of the byte. At the circuit this time, only  two kinds of codes are use&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;d. More kinds can be controlled if changing  the input circuit of the control. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;Power switch and control code selection circuit &lt;/u&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;img align=&quot;LEFT&quot; alt=&quot;&quot; height=&quot;244&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_8310.gif&quot; width=&quot;281&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The operation of the circuit of the transmitter only when  pushing a control switch. When a control switch isn&#39;t pushed, it makes  all circuits stop. When a control switch isn&#39;t pushed, it makes all  circuits stop to suppress the consumption of the battery cell. The  control switch combines the selector switch of the control code and the  power switch. A control switch is connected with the side of the  positive of the cell and a power is supplied to the circuit even if it  pushes any switch. Control code selection malfunction is prevented by  the diodes.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;u&gt;Time Chart for Transmitter&lt;/u&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;ul&gt;&lt;a href=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_85.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img align=&quot;BOTTOM&quot; alt=&quot;&quot; border=&quot;0&quot; height=&quot;145&quot; src=&quot;http://www.piclist.com/images/www/hobby_elec/gif/pic6_85.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/ul&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;I will show the time chart of the control code in the  figure above. This composition is the composition which I contrived and  is not standard composition. The switching time of each bit is 10  milliseconds.&lt;/span&gt; &lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;The signal to transmit from the transmitter is composed  of three blocks. In the program, three blocks are managed by  transmission status (TX_STATUS). ST0, ST1, ST2 show transmission status  with the figure above. A bit in each block is managed by sub status  (TX_SUBSTATUS). The figure which is written under the signal in the  figure above shows sub status.&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/72906875/4f54993/step.asm.html&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;Download Source Code&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://hotfile.com/dl/72906930/8208ed5/STEP.HEX.html&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;Download Hex File&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/8282569686260659344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/rf-remote-controller-transmitter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/8282569686260659344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/8282569686260659344'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/rf-remote-controller-transmitter.html' title='RF Remote Controller (Transmitter)'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqstBwdhSqHh7OQ1oUvKyQ_Sbkp-RklOFfdXpc8xqwYJp1U3hCPkLLPJY1AeowAOPiGeXXhkX1UZG3rtQIPGYlGEw72VWGuFK0I4JzwnkU5AFra933HEhDE2qZbuPKYze0KRwcCCeE004/s72-c/pic6_81.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-5713375543737568435</id><published>2010-10-01T07:59:00.001+05:30</published><updated>2010-10-01T07:59:27.943+05:30</updated><title type='text'>Stepper Motor controller</title><content type='html'>&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/AVvXsEh6RY8VL-qY1GRT06ribmVXvQILw8QRE9NbsjAfB-_sKia-jcA4h5lPDBETkwwjS2Nws5W9nieUClmNRNp9WBPcJE04JBWVfmVmvkgATxdCZVduIlhvnhFZbDjbqQWnns2kxme_G99U22A/s1600/step_motor1_2.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6RY8VL-qY1GRT06ribmVXvQILw8QRE9NbsjAfB-_sKia-jcA4h5lPDBETkwwjS2Nws5W9nieUClmNRNp9WBPcJE04JBWVfmVmvkgATxdCZVduIlhvnhFZbDjbqQWnns2kxme_G99U22A/s1600/step_motor1_2.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;On this page, I will explain about the operation principle of stepper motor. There are many kind of stepper motors. Unipolar type, Bipolar type, Single-phase type, Multi-phase type... Single-phase stepper motor is often used for quartz watch. On this page, I will explain the operation principle of the 2-phase unipolar PM type stepper motor.In the PM type stepper motor, a permanent magnet is used for rotor and coils are put on stator. The stepper motor model which has 4-poles is shown in the figure on the left. In case of this motor, step angle of the rotor is 90 degrees.&lt;/div&gt;&lt;div style=&quot;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/AVvXsEgDemqf52SedIUgXFsjMTQg4MyLWVyik32nAwpO2qPkQ307ykRnKAlg9jsyz_6RijTYq-hSkwI6XgWh3iVXKDW3G7nQYDWOu4vmi2oYE6S9B1d211usMYxJB-4U9siUwhimjFi3JocRa5c/s1600/step2_1.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;278&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDemqf52SedIUgXFsjMTQg4MyLWVyik32nAwpO2qPkQ307ykRnKAlg9jsyz_6RijTYq-hSkwI6XgWh3iVXKDW3G7nQYDWOu4vmi2oYE6S9B1d211usMYxJB-4U9siUwhimjFi3JocRa5c/s400/step2_1.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;a href=&quot;http://www.blogger.com/goog_452876073&quot;&gt;Download Sou&lt;/a&gt;&lt;a href=&quot;http://hotfile.com/dl/72904304/52ddd38/step.asm.html&quot;&gt;rce Code&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://hotfile.com/dl/72904494/809f184/STEP.HEX.html&quot;&gt;Download Hex File &lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/5713375543737568435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/stepper-motor-controller.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/5713375543737568435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/5713375543737568435'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/10/stepper-motor-controller.html' title='Stepper Motor controller'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6RY8VL-qY1GRT06ribmVXvQILw8QRE9NbsjAfB-_sKia-jcA4h5lPDBETkwwjS2Nws5W9nieUClmNRNp9WBPcJE04JBWVfmVmvkgATxdCZVduIlhvnhFZbDjbqQWnns2kxme_G99U22A/s72-c/step_motor1_2.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-1646308096255968984</id><published>2010-09-30T11:53:00.001+05:30</published><updated>2010-10-01T08:00:53.096+05:30</updated><title type='text'>Count-down timer</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN5e4NxvkYA7AuP_QaQUTAnm-eIviPks8X7XAdWn51DWeyvnrYkO-3m-e15y4ZyFBs0gxtlHpkeU6octp5WM0mu_zz7tNwwIZtqlNv8LMQHyk8QdpvMdNBkXCm8iWGAVHBEZaoq_eVZg0/s1600/CountDown1.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN5e4NxvkYA7AuP_QaQUTAnm-eIviPks8X7XAdWn51DWeyvnrYkO-3m-e15y4ZyFBs0gxtlHpkeU6octp5WM0mu_zz7tNwwIZtqlNv8LMQHyk8QdpvMdNBkXCm8iWGAVHBEZaoq_eVZg0/s1600/CountDown1.gif&quot; /&gt;&lt;/a&gt; On this page, I will introduce the Count-down timer with PIC16F84A. I am putting a count-down timer by the hardware on Electronic Circuits Application Garage. The function of the timer is the same as it approximately. (The stop switch is added) Because this unit was made compactly, the wiring of the back becomes quite complicated.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;This is PIC16F84A. In case of PIC16F84A, it is possible to use a clock frequency upto 20 MHz. The circuit this time, I am using 10-MHz resonator.&lt;/span&gt; &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-size: small;&quot;&gt;This is the IC which decodes the binary code of 3 bits. 8 conditions can be expressed by 3 bits. 74HC138 outputs only one an L level out of 8 by the 3-bit input condition.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://rapidshare.com/files/422257070/countdwn.asm&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Downlo&lt;span style=&quot;font-family: inherit;&quot;&gt;ad &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;Source code&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://rapidshare.com/files/422257049/countdwn.HEX&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Downlo&lt;span style=&quot;font-family: inherit;&quot;&gt;ad Hex File&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/1646308096255968984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/count-down-timer.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/1646308096255968984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/1646308096255968984'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/count-down-timer.html' title='Count-down timer'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN5e4NxvkYA7AuP_QaQUTAnm-eIviPks8X7XAdWn51DWeyvnrYkO-3m-e15y4ZyFBs0gxtlHpkeU6octp5WM0mu_zz7tNwwIZtqlNv8LMQHyk8QdpvMdNBkXCm8iWGAVHBEZaoq_eVZg0/s72-c/CountDown1.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-7745219341429226601</id><published>2010-09-30T11:36:00.000+05:30</published><updated>2010-09-30T11:36:39.076+05:30</updated><title type='text'></title><content type='html'>&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/AVvXsEjBwjQFsWXeV6vIG6GAtU4iVFq2_-uRsEx5LtlzQp-tqtqkth7RHwryUO3XvW4c2_lu5axVGIiS3BECY-_QBNvKNvVmY42Nw0RLzlMUqr3sA3sfhQRujYZPjbJKHISkphlchRPWAjF23N0/s1600/LED1.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBwjQFsWXeV6vIG6GAtU4iVFq2_-uRsEx5LtlzQp-tqtqkth7RHwryUO3XvW4c2_lu5axVGIiS3BECY-_QBNvKNvVmY42Nw0RLzlMUqr3sA3sfhQRujYZPjbJKHISkphlchRPWAjF23N0/s1600/LED1.gif&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAgnwvjuO_lWZAu0nw6FPRnPtEeu4IR-K79ShuYLWjmpYGAl1YzvJVNv7CEdOoAp-oC5XysIQOSwr61psVEOQs8ZWHQg9RWbwEJvdmnDruAno78yktQ9JQ-XwFn3OF8nr_XzE4IG-wpGA/s1600/LED2.gif&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/AVvXsEgAgnwvjuO_lWZAu0nw6FPRnPtEeu4IR-K79ShuYLWjmpYGAl1YzvJVNv7CEdOoAp-oC5XysIQOSwr61psVEOQs8ZWHQg9RWbwEJvdmnDruAno78yktQ9JQ-XwFn3OF8nr_XzE4IG-wpGA/s1600/LED2.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This flasher moves, while lighting of LED drags on. The brightness of LED is four kinds, bright, less bright, almost dim and dim. These lighting states are moved with time. Control of brightness is performed in lighting time of LED like PWM(Pulse Width Modulation). There is no PWM function in PIC16F84A. Therefore, I divided lighting of LED into four cycles, and controlled them. It is &quot;Bright&quot; when all periodic lightings are carried out. 2 cycle lighting state is &quot;Less bright&quot;. 1 cycle lighting state is &quot;almost dim&quot;. It is &quot;Dim&quot; in OFF a total cycle. At first, I was going to prepare much more cycles. However, because PIC16F84A carried only 1K-word program memory, I made into four cycles.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHPRXueonrTHScNcpyNbf5pzofx-XmZhAzvlycJaXHBA4aVZp4cQdTx63WxDBZZePd6HAPBSplCCaWvoWlTSwTT-kYvM0ga2AlB2FLjzDLMctDAZIlzAeE67Kg07diNiVQWBJWa9KlTh4/s1600/pic6_b1a.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 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/AVvXsEiHPRXueonrTHScNcpyNbf5pzofx-XmZhAzvlycJaXHBA4aVZp4cQdTx63WxDBZZePd6HAPBSplCCaWvoWlTSwTT-kYvM0ga2AlB2FLjzDLMctDAZIlzAeE67Kg07diNiVQWBJWa9KlTh4/s320/pic6_b1a.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;The timer function of PIC is used for the processing which moves the lighting position of LED.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;When man looks at the lighting situation of LED, it is not meaningful if too quick. In this circuit, it is the purpose to show so that lighting of LED may drag on.&lt;/span&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt; In order to lengthen time of a timer, 4MHz resonator is used. The period with 4MHz frequency is 1/4,000,000 = 0.25 microseconds. Because 4 periods (the clock) are necessary to the count of the timer, a count is downed with the timer every microsecond. Because a prescaler of 1/256 is used for the input of timer, actually, a count is downed with every 256 microseconds. When making the initial value of the timer as 195, the time-out becomes 256&lt;sup&gt;µsec/count&lt;/sup&gt; x 195&lt;sup&gt;count&lt;/sup&gt; = 49920µsec = 50msec.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;a href=&quot;http://www.blogger.com/goog_458160513&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Download &lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;a href=&quot;http://rapidshare.com/files/422255521/led2.asm&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;Source code&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://rapidshare.com/files/422255556/LED2.HEX&quot;&gt;Download Hex File&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/7745219341429226601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/this-flasher-moves-while-lighting-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7745219341429226601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7745219341429226601'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/this-flasher-moves-while-lighting-of.html' title=''/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBwjQFsWXeV6vIG6GAtU4iVFq2_-uRsEx5LtlzQp-tqtqkth7RHwryUO3XvW4c2_lu5axVGIiS3BECY-_QBNvKNvVmY42Nw0RLzlMUqr3sA3sfhQRujYZPjbJKHISkphlchRPWAjF23N0/s72-c/LED1.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-1617168850562185168</id><published>2010-09-29T16:56:00.000+05:30</published><updated>2010-09-29T16:56:02.862+05:30</updated><title type='text'>Reading from the I/O ports</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;The program will only move onto ‘Carry on here’ only if bit 0 on PortA is set to a 1. Let us now write a program which will flash an LED at one speed, but if a switch is closed it will flash the LED twice as slow.&amp;nbsp; You can probably work this program out for yourself, but I have included the listing anyway.&amp;nbsp; You could try and write the whole program, just to see if you have grasped the concepts.&amp;nbsp; We are using the same circuit as before, with the addition of a switch connected RA0 of the PIC and the positive rail of our supply.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;*****Set up the Constants****&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;STATUS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;br /&gt;
TRISA &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 85h&amp;nbsp;&amp;nbsp;&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;br /&gt;
PORTA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05h&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;br /&gt;
COUNT1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 08h&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;br /&gt;
COUNT2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 09h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Set up the port****&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span lang=&quot;EN-GB&quot;&gt;b&lt;/span&gt;sf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STATUS,5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
movlw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01h&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 lang=&quot;EN-GB&quot;&gt;&amp;nbsp; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;bcf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STATUS,5&amp;nbsp;&amp;nbsp;&lt;span lang=&quot;EN-GB&quot;&gt;&amp;nbsp; &lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Turn the LED on****&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Start&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; movlw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02h&amp;nbsp;&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;br /&gt;
movwf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span lang=&quot;EN-GB&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; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Check if the switch is closed&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
BTFSC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA,0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span lang=&quot;EN-GB&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;nbsp; &lt;br /&gt;
&lt;span lang=&quot;EN-GB&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;br /&gt;
call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delay&amp;nbsp;&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 lang=&quot;EN-GB&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Add a delay&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Delay&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Delay finished, now turn the LED off****&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;movlw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;br /&gt;
movwf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Check if the switch is still closed&lt;br /&gt;
&lt;br /&gt;
BTFSC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA,0&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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 lang=&quot;EN-GB&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot;&gt; &lt;/span&gt;Delay&amp;nbsp;&amp;nbsp;&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;br /&gt;
;****Add another delay****&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;call&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Delay&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Now go back to the start of the program&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;goto Start&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****Here is our Subroutine&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Delay&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Loop1&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;decfsz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT1,1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
goto &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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 lang=&quot;EN-GB&quot;&gt;&lt;/span&gt;Loop1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span lang=&quot;EN-GB&quot;&gt;&amp;nbsp; &lt;/span&gt;&amp;nbsp; &lt;br /&gt;
decfsz&amp;nbsp;&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 lang=&quot;EN-GB&quot;&gt;&amp;nbsp; &lt;/span&gt;COUNT2,1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
goto&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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 lang=&quot;EN-GB&quot;&gt;&amp;nbsp; &lt;/span&gt;Loop1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;
return&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;;****End of the program****&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;end&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: justify;&quot;&gt;What I have done here is to turn the LED on.&amp;nbsp; I then check to see if the switch is closed.&amp;nbsp; If it is closed, then I make a call to our delay subroutine.&amp;nbsp; This gives us the same delay as before, but we are now calling it twice.&amp;nbsp; The same goes for when the LED is off.&amp;nbsp; If the switch is not closed, then we have our old on and off times.&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/1617168850562185168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/reading-from-io-ports.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/1617168850562185168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/1617168850562185168'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/reading-from-io-ports.html' title='Reading from the I/O ports'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-4775504730791760042</id><published>2010-09-29T16:37:00.000+05:30</published><updated>2010-09-29T16:46:27.774+05:30</updated><title type='text'>delay loops into our program</title><content type='html'>&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin:0in;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;Let us put these delay loops into our program, and finish off by making it a real program by adding comments:&lt;/div&gt;&lt;div style=&quot;color: #fff2cc;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;;*****Set up the Constants****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;STATUS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03h&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;TRISA &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 85h &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;PORTA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05h &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;COUNT1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 08h &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;COUNT2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; equ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 09h &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;;****Set up the port****&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;bsf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STATUS,5&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;movlw&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 style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; 00h &lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;movwf&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRISA&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;bcf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STATUS,5&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;;****Turn the LED on****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Start&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 style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;movlw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;02h&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;movwf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;;****Start of the delay loop 1****&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Loop1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt; &lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;decfsz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;COUNT1,1&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;goto&amp;nbsp;&amp;nbsp;&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 style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Loop1&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;decfsz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;COUNT2,1&lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;goto&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop1&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-GB&quot; style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;;****Delay finished, now turn the LED off****&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&amp;nbsp;movlw&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 00h&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;movwf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTA&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;;****Add another delay****&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;Loop2&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;decfsz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT1,1&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;goto &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;decfsz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COUNT2,1&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;goto&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop2 &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;;****Now go back to the start of the program&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;goto &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;;****End of the program****&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify; text-indent: -1in;&quot;&gt;end&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;Needed by some compilersand also just in case we miss the goto instruction.&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify; text-indent: -1in;&quot;&gt;&amp;nbsp; &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&amp;nbsp;You can compile this program and then program the PIC.&amp;nbsp; Of course, you will want to try the circuit out to see if it really does work.&amp;nbsp; Here is a circuit diagram for you to build once you have programmed your PIC.&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/4775504730791760042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/delay-loops-into-our-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4775504730791760042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/4775504730791760042'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/delay-loops-into-our-program.html' title='delay loops into our program'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-3180289312853260505</id><published>2010-09-29T16:34:00.000+05:30</published><updated>2010-09-29T16:35:24.284+05:30</updated><title type='text'>Delay Loops</title><content type='html'>&lt;div style=&quot;color: #fff2cc; text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;There is one slight drawback        to our flashing LED program.&amp;nbsp; Each instruction takes one clock cycle to        complete.&amp;nbsp; If we are using a 4MHz crystal, then each instruction will take        1/4MHz, or &lt;span lang=&quot;en-gb&quot;&gt;1u&lt;/span&gt;S to complete.&amp;nbsp; As we are using only 5 instructions, the        LED will turn on then off in &lt;span lang=&quot;en-gb&quot;&gt;5u&lt;/span&gt;S.&amp;nbsp; This is far too fast for us to see,        and it will appear that the LED is permanently on.&amp;nbsp; What we need to do is        cause a delay between turning the LED on and turning the LED off.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;color: #fff2cc; font-family: inherit; text-align: justify;&quot;&gt;The principle of the delay is        that we count down from a previously set number, and when it reaches zero,        we stop counting.&amp;nbsp; The zero value indicates the end of the delay, and we        continue on our way through the program.&lt;/div&gt;&lt;div style=&quot;color: #fff2cc; font-family: inherit; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;color: #fff2cc; font-family: inherit; text-align: justify;&quot;&gt;first we define our        constant: &amp;nbsp;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;color: #fff2cc; font-family: inherit; text-align: justify;&quot;&gt;COUNT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; equ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;            08hNext we need to decrease this        COUNT by 1 until it reaches zero.&amp;nbsp; It just so happens that there is a        single instruction that will do this for us, with the aid of a ‘goto’ and        a label.&amp;nbsp; The instruction we will use is:&lt;/div&gt;&lt;blockquote style=&quot;color: #fff2cc; font-family: inherit;&quot;&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;color: #fff2cc; font-family: inherit;&quot;&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;color: #fff2cc; font-family: inherit;&quot;&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;div class=&quot;MsoNormal&quot;&gt;DECFSZ&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;COUNT,1&lt;/div&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;color: #fff2cc; font-family: inherit; text-align: justify;&quot;&gt;&amp;nbsp;This instruction says        ‘Decrement the register (in this case COUNT) by the number that follows        the comma.&amp;nbsp; If we reach zero, jump two places forward.’&amp;nbsp; A lot of words,        for a single instruction. Let us see it in action first, before we put it        into our program.&lt;/div&gt;&lt;blockquote style=&quot;color: #fff2cc; font-family: inherit;&quot;&gt;&lt;/blockquote&gt;&lt;blockquote style=&quot;color: #fff2cc; font-family: inherit;&quot;&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;div class=&quot;MsoNormal&quot;&gt;COUNT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; equ 08h&lt;br /&gt;
LABEL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; decfsz&amp;nbsp;&amp;nbsp; COUNT,1&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; goto LABEL&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Carry on here.&lt;/div&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;color: #fff2cc; font-family: inherit; text-align: justify;&quot;&gt;&amp;nbsp;What we have done is first set        up our constant COUNT to 255.&amp;nbsp; The next line puts a label, called LABEL        next to our decfsz instruction.&amp;nbsp; The decfsz COUNT,1 decreases the value        of COUNT by 1, and stores the result back into COUNT.&amp;nbsp; It also checks to        see if COUNT has a value of zero.&amp;nbsp; If it doesn’t, it then causes the        program to move to the next line.&amp;nbsp; Here we have a ‘goto’ statement which        sends us back to our decfsz instruction.&amp;nbsp; If the value of COUNT does equal        zero, then the decfsz instruction causes our program to jump two places        forward, and goes to where I have said ‘Carry on here’.&amp;nbsp; So, as you can        see, we have caused the program to stay in one place for a predetermined        time before carrying on.&amp;nbsp; This is called a delay loop.&amp;nbsp; If we need a        larger delay, we can follow one loop by another.&amp;nbsp; The more loops, the        longer the delay.&amp;nbsp; We are going to need at least two, if we want to see        the LED flash..&lt;/div&gt;&lt;blockquote style=&quot;color: #fff2cc; font-family: inherit;&quot;&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/3180289312853260505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/delay-loops.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/3180289312853260505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/3180289312853260505'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/delay-loops.html' title='Delay Loops'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-7033503435579731130</id><published>2010-09-29T16:27:00.000+05:30</published><updated>2010-09-29T16:27:47.419+05:30</updated><title type='text'>Writing To the Ports</title><content type='html'>In the last tutorial, we I showed you how to set up the IO port pins on the PIC to be either input or output. In this tutorial, I am going to show you how to send data to the ports. In the next tutorial, we will finish off by flashing an LED on and off which will include a full program listing and a simple circuit diagram so that you can see the PIC doing exactly what we expect it to. Don’t try and compile and program your PIC with the listings here, as they are examples only. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;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; First, let us set up Port A bit 2 as an output: &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; bsf 03h,5 ;Go to Bank 1&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; movlw 00h ;Put 00000 into W&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; movwf 85h ;Move 00000 onto TRISA – all pins set to output&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; bcf 03h,5 ;Come back to Bank 0 &lt;/div&gt;&lt;br /&gt;
This should be familiar from the last tutorial. The only difference is that I have set all of the pins on Port A as output, by sending 0h to the tri-state register.&lt;br /&gt;
We define a label very simply. We type a name, say START, then type the code: &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start movlw 02h ;Write 02h to the W register. In binary this is&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;00010, which puts a ‘1’ on pin 2 while keeping&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; ;the other pins to ‘0’ &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; movwf 05h ;Now move the contents of W (02h) onto the&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;PortA, whose address is 05h &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;  movlw 00h ;Write 00h to the W register. This puts a ‘0’ on&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;all pins. &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;  movwf 05h ;Now move the contents of W (0h) onto the Port&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  ;A, whose address is 05h &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;  goto Start ;Goto where we say Start&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Arial,Arial,Helvetica;&quot;&gt;As you can see, we first said        the word ‘Start’ right at the beginning of the program.&amp;nbsp; Then, right at        the very end of the program we simply said ‘goto Start’.&amp;nbsp; The ‘goto’        instruction does exactly what it says.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/7033503435579731130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/writing-to-ports.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7033503435579731130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7033503435579731130'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/writing-to-ports.html' title='Writing To the Ports'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-6063988419657228306</id><published>2010-09-29T16:03:00.000+05:30</published><updated>2010-09-29T16:03:28.970+05:30</updated><title type='text'>The most common registers</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;STATUS &lt;/b&gt;&lt;br /&gt;
To change from Bank 0 to Bank 1 we tell the STAUS register. We do this by setting bit 5 of the STATUS register to 1. To switch back to Bank 0, we set bit 5 of the STATUS register to 0. The STATUS register is located at address 03h (the ‘h’ means the number is in Hexadecimal). &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;TRISA and TRISB&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;These are located at addresses 85h and 86h respectively. To program a pin to be an output or an input, we simply send a 0 or a 1 to the relevant bit in the register. Now, this can either be done in binary, or hex. I personally use both, as the binary does help visualize the port. If you are not conversant with converting from binary to hex and vice versa, then use a scientific calculator.&lt;br /&gt;
&lt;br /&gt;
PORTA and PORTB &lt;br /&gt;
To send one of our output pins high, we simply send a ‘1’ to the corresponding bit in our PORTA or PORTB register. The same format follows as for the TRISA and TRISB registers. To read if a pin is high or low on our port pins, we can perform a check to see if the particular corresponding bit is set to high (1) or set to low (0)&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;W &lt;br /&gt;
The W register is a general register in which you can put any value that you wish. Once you have assigned a value to W, you can add it to another value, or move it. If you assign another value to W, its contents are overwritten. &lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/6063988419657228306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/most-common-registers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/6063988419657228306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/6063988419657228306'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/most-common-registers.html' title='The most common registers'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-8306486849836996927</id><published>2010-09-28T06:04:00.000+05:30</published><updated>2010-09-29T15:59:30.559+05:30</updated><title type='text'>PIC 16F84A PIN diagram</title><content type='html'>&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/AVvXsEjuxAsEzUlVwN6BzZ4a57-udly5JvkyxWn9Sh2FDCkaSLduzeJcBmaVnXmlK5UQvmnJzqymm5VwN9t1pSAS7bVXhaOppQnCjtHmW-2OBWiQJv46Dm4c_xfFmtY_u4epzJHXNJ-qtGYoB_4/s1600/pic16f84-pic16f84a-microcontroller-pin-configuration+copy.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuxAsEzUlVwN6BzZ4a57-udly5JvkyxWn9Sh2FDCkaSLduzeJcBmaVnXmlK5UQvmnJzqymm5VwN9t1pSAS7bVXhaOppQnCjtHmW-2OBWiQJv46Dm4c_xfFmtY_u4epzJHXNJ-qtGYoB_4/s320/pic16f84-pic16f84a-microcontroller-pin-configuration+copy.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgolkDJBvzb4k6l6qEyvivCU3ZYOExV-ZdXBSFTVEjcyGP7rqexe1lqZWwLzok2FsN1-XiCuI8F5VTRDQ5aQzbTOgWh66Y8Amx4d-LJPH_ng_EDbjcRv8Y-bBQDMmdjcNE8CNPFuL6CvCA/s1600/pic16f84-pic16f84a-microcontroller-pin-configuration.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The given diagram showing the pin-outs of the PIC 16F84. I will go  through each pin, explaining what each is used for. Microchip manufacture a series of microcontrollers called PIC. There are many different flavours available, some basic low memory types, going right up through to ones that have Analogue - To- Digital converters and even PWM built in. I am going to concentrate on the 16F84 PIC. Once you have learnt how to program one type of PIC, learning the rest is easy.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;i&gt;RA0 To RA4 : &lt;/i&gt;RA is a bidirectional port. That is, it can be configured as an input or an output. The number following RA is the bit number (0 to 4). So, we have one 5-bit directional port where each bit can be configured as Input or Output. &lt;br /&gt;
&lt;i&gt;RB0 To RB7 :&lt;/i&gt; RB is a second bidirectional port. It behaves in exactly the same way as RA, except there are 8 - bits involved. &lt;br /&gt;
&lt;i&gt;VSS And VDD&lt;/i&gt; : These are the power supply pins. VDD is the positive supply, and VSS is the negative supply, or 0V. The maximum supply voltage that you can use is 6V, and the minimum is 2V &lt;br /&gt;
&lt;i&gt;OSC1/CLK IN And OSC2/CLKOUT : &lt;/i&gt;These pins is where we connect an external clock, so that the microcontroller has some kind of timing. &lt;br /&gt;
&lt;i&gt;MCLR : &lt;/i&gt;This pin is used to erase the memory locations inside the PIC (i.e. when we want to re-program it). In normal use it is connected to the positive supply rail. &lt;br /&gt;
&lt;i&gt;INT : &lt;/i&gt;This is an input pin which can be monitored. If the pin goes high, we can cause the program to restart, stop or any other single function we desire. We won&#39;t be using this one much. &lt;br /&gt;
&lt;i&gt;T0CK1 : &lt;/i&gt;This is another clock input, which operates an internal timer. It operates in isolation to the main clock. Again, we won&#39;t be using this one much either. &lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/8306486849836996927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/pic-16f84a-pin-diagram.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/8306486849836996927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/8306486849836996927'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/pic-16f84a-pin-diagram.html' title='PIC 16F84A PIN diagram'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuxAsEzUlVwN6BzZ4a57-udly5JvkyxWn9Sh2FDCkaSLduzeJcBmaVnXmlK5UQvmnJzqymm5VwN9t1pSAS7bVXhaOppQnCjtHmW-2OBWiQJv46Dm4c_xfFmtY_u4epzJHXNJ-qtGYoB_4/s72-c/pic16f84-pic16f84a-microcontroller-pin-configuration+copy.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-2999682828512289314</id><published>2010-09-28T05:52:00.000+05:30</published><updated>2010-09-28T05:52:18.803+05:30</updated><title type='text'>Multi PIC Programmer</title><content type='html'>&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/AVvXsEilhhWjW1ViolGx8cWXWgXXrbYAJMSQ9BLNRr7AdkET5TClXhZ1y55xrmSK2XVhoEMtbyxUfO3iSUSXUmoO92zPiIMYrqxQ_rt6Rb9MUMsoPQ9MmiBsNBrEMEdVf6X74Qun097PmjWWxqI/s1600/pg5v2sch.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilhhWjW1ViolGx8cWXWgXXrbYAJMSQ9BLNRr7AdkET5TClXhZ1y55xrmSK2XVhoEMtbyxUfO3iSUSXUmoO92zPiIMYrqxQ_rt6Rb9MUMsoPQ9MmiBsNBrEMEdVf6X74Qun097PmjWWxqI/s400/pg5v2sch.gif&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&quot;Multi PIC Programmer 5 Ver.2&quot; is a PIC programmer, which can program to 8-pin to 40-pin devices using single ZIF socket. I built &quot;Multi PIC programmer 5 Ver.1&quot;, in order to enable it to program 40-pin devices like PIC16F877 with a ZIF socket. Lately I improved this PIC programmer. The main improvements are having made it suit &quot;VPP before VDD&quot; and changed wiring of a ZIF socket for accepting devices with LVP (Low Voltage Programming) mode. &lt;br /&gt;
Before you build this &quot;PIC programmer&quot;, I recommend checking to see if there is enough output voltage at the serial port your personal computer. If TxD, DTR, and RTS do not have more than +7.5V(or -7.5V), this programmer will not work well, especially, with the latest laptop computers that using low power RS232 interface ICs.&lt;br /&gt;
Other important matters are as: &lt;br /&gt;
1. The GND line of a serial port forms relative VDD on a PIC programmer. All the GND symbols in a circuit diagram are a PIC programmer&#39;s GND. Never connect them with GND line of a serial port. &lt;br /&gt;
2. This PIC programmer changes VPP in accordance with the device selected (8-18pin) or (28-40pin) with one sliding switch. So, if the insertion position of a device and slide switch is not set correctly, your PIC may be damaged by over voltage. &lt;br /&gt;
3. This PIC programmer does not support all PIC MCUs. (PIC16C5x is not programmable with this programmer. By using an adapter, the 20 pin PIC 16C770/771 can be programmed. &lt;br /&gt;
4. I did not try all PICs since and I do not have all them. The PICs, which I successfully programmed and verified, are PIC12F629, PIC12F675, PIC16F627, PIC16F628, PIC16F630, PIC16F676, PIC16F818, PIC16F819, PIC16F84A, PIC16F873, PIC16F877A, PIC18F2320, PIC18F452. &lt;br /&gt;
5. The programming software used is IC-Prog of Bonny Gijzen. &lt;br /&gt;
6. &quot;Hardware settings&quot; of IC-Prog are the same as the JDM programmer. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/2999682828512289314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/multi-pic-programmer.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2999682828512289314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/2999682828512289314'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/multi-pic-programmer.html' title='Multi PIC Programmer'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilhhWjW1ViolGx8cWXWgXXrbYAJMSQ9BLNRr7AdkET5TClXhZ1y55xrmSK2XVhoEMtbyxUfO3iSUSXUmoO92zPiIMYrqxQ_rt6Rb9MUMsoPQ9MmiBsNBrEMEdVf6X74Qun097PmjWWxqI/s72-c/pg5v2sch.gif" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3065255669703027913.post-7007075722178050715</id><published>2010-09-27T23:29:00.000+05:30</published><updated>2010-09-28T06:06:13.803+05:30</updated><title type='text'>PIC Programming through WinPic</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://www.qsl.net/dl4yhf/winpic/winpic_screenshot.gif&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;228&quot; src=&quot;http://www.qsl.net/dl4yhf/winpic/winpic_screenshot.gif&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt; WinPic now supports a large variety of PICs with different programming algorithms. Programmable devices are  listed on the &lt;/span&gt;Features&lt;span style=&quot;font-family: inherit;&quot;&gt;  page. &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;Note that most programming adapters supported by WinPic do not meet  Microchip&#39;s requirements for a &quot;production grade&quot; programmer. If you think you need a production grade programmer (which can verify the PIC at different  voltages), look below.&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;WinPic lets you ... &lt;/div&gt;&lt;ul style=&quot;font-family: inherit;&quot;&gt;&lt;li&gt;     program a HEX-file into a PIC microcontroller   &lt;/li&gt;
&lt;li&gt;     read the contents of a PIC and save it as a HEX file   &lt;/li&gt;
&lt;li&gt;     read and modify the configuration word(s) of the PIC &lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;Keep in mind that this program is still far from being &quot;professional&quot;  software ! Last not least because this program is freeware, the entire risk of  its use is with you - read the disclaimer  if you haven&#39;t yet.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://microcontroller123.blogspot.com/feeds/7007075722178050715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/pic-programming-through-winpic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7007075722178050715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3065255669703027913/posts/default/7007075722178050715'/><link rel='alternate' type='text/html' href='http://microcontroller123.blogspot.com/2010/09/pic-programming-through-winpic.html' title='PIC Programming through WinPic'/><author><name>Suman Kumar Adhya</name><uri>http://www.blogger.com/profile/09956885261007462333</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='26' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibdC2MGfGM4K7QEIIs4cYXkL-lv20ZwWso8yfsPJ19Lmt0eAVjo_Bw4nS0gynw8WM3uVqfv_tIguqx0axri_M63JnMvgEbUVauY2mYBNwbQpmVgCY_W4GC1ir9X528r-w/s220/sss.jpg'/></author><thr:total>0</thr:total></entry></feed>