<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Larry&#039;s Blog &#187; PROGRAMMING THE pic microcontrollers</title>
	<atom:link href="http://sketchbooks.com/blog/category/programming-the-pic-microcontrollers/feed/" rel="self" type="application/rss+xml" />
	<link>http://sketchbooks.com/blog</link>
	<description>Larry Keegan of Stoneham, MA.</description>
	<lastBuildDate>Mon, 18 Jan 2010 07:10:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ADVICE ON CMOS IC&#8217;s</title>
		<link>http://sketchbooks.com/blog/2006/08/advice-on-cmos-ics/</link>
		<comments>http://sketchbooks.com/blog/2006/08/advice-on-cmos-ics/#comments</comments>
		<pubDate>Wed, 09 Aug 2006 21:17:50 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=64</guid>
		<description><![CDATA[THIS IS A LETTER I SENT
to George Gallant, Jim Morris
and Jim Fiske
hi
just realized something troubling
I was reading some hints for using the PIC
microcontrollers and found this:
&#8220;unconnected port bits should never
be set up as inputs&#8221;
&#8220;when floating, CMOS inputs can flip rapidly
between states and cause excessive current draw,
heating and even damaging the PIC&#8221;
So &#8211;  set all [...]]]></description>
			<content:encoded><![CDATA[<p>THIS IS A LETTER I SENT<br />
to George Gallant, Jim Morris<br />
and Jim Fiske<br />
hi<br />
just realized something troubling<br />
I was reading some hints for using the PIC<br />
microcontrollers and found this:<br />
&#8220;unconnected port bits should never<br />
be set up as inputs&#8221;<br />
&#8220;when floating, CMOS inputs can flip rapidly<br />
between states and cause excessive current draw,<br />
heating and even damaging the PIC&#8221;<br />
So &#8211;  set all unused bits of ports to outputs.<br />
I went back to one of my books talking about<br />
CMOS IC&#8217;s and noticed this warning:<br />
ALL unused inputs MUST be connected to Vdd(+) or Vss(gnd)<br />
otherwise erratic chip behavior and<br />
excessive  current consumption will occur.<br />
other rules for CMOS were NEVER connect<br />
an input signal to a cmos circuit when<br />
the power is off.<br />
another curious warning was to<br />
avoid slowly rising and falling input signals<br />
since they cause excessive power<br />
consumption. it recommended<br />
rise times faster than 15 usecs<br />
I think I have been lucky so far<br />
but I&#8217;m certainly going to observe<br />
these precautions.<br />
Regards.<br />
Larry Keegan in Stoneham, MA</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2006/08/advice-on-cmos-ics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MY NEW PROGRAMMER CIRCUIT</title>
		<link>http://sketchbooks.com/blog/2005/08/my-new-programmer-circuit/</link>
		<comments>http://sketchbooks.com/blog/2005/08/my-new-programmer-circuit/#comments</comments>
		<pubDate>Mon, 22 Aug 2005 22:05:27 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=54</guid>
		<description><![CDATA[I have re-designed and simplified my circuit for my PIC programmer.
This circuit is connected to my laptop and a 5 volt power supply.
It takes about 25 seconds to go from assembly language program
to the burned in PIC microcontroller ready to run.

]]></description>
			<content:encoded><![CDATA[<p>I have re-designed and simplified my circuit for my PIC programmer.<br />
This circuit is connected to my laptop and a 5 volt power supply.<br />
It takes about 25 seconds to go from assembly language program<br />
to the burned in PIC microcontroller ready to run.<br />
<img alt="pgmr.JPG" src="http://sketchbooks.com/blog/archives/pgmr.JPG" width="399" height="296" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2005/08/my-new-programmer-circuit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LATEST NEWS IN LARRY KEEGAN&#8217;S WORLD OF EXPERIMENTS !!!!!!</title>
		<link>http://sketchbooks.com/blog/2005/04/latest-news-in-larry-keegans-world-of-experiments/</link>
		<comments>http://sketchbooks.com/blog/2005/04/latest-news-in-larry-keegans-world-of-experiments/#comments</comments>
		<pubDate>Sun, 17 Apr 2005 14:11:11 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=44</guid>
		<description><![CDATA[IN  BRIEF:
1. Gave a talk to the QRA radio club on PIC Microcontrollers
2. Wired up a MING xmtr &#038; rcvr  &#038; got it working
but want to package it more nicely and affix some PICs to it
3.  Stripped apart som RC cars &#038; trucks and set up an
RC system with a small relay [...]]]></description>
			<content:encoded><![CDATA[<p>IN  BRIEF:<br />
1. Gave a talk to the QRA radio club on PIC Microcontrollers<br />
2. Wired up a MING xmtr &#038; rcvr  &#038; got it working<br />
but want to package it more nicely and affix some PICs to it<br />
3.  Stripped apart som RC cars &#038; trucks and set up an<br />
RC system with a small relay attached to rcvr<br />
4.   Writing a PGM to read the infrared sigs from a handheld REMOTE.<br />
Interesting article in SERVO mag outlines methodollogies.<br />
PWM seems to be the most popular I think zero pulses are about 400 usecs<br />
wide &#038; ONE pulses are about 1200 usecs wide. There are about 34 pulses<br />
&#038; about 12 of them unique and determine  the individual code<br />
5.  I&#8217;m in the process of firing up some of my other old laptops<br />
The hell with batteries  &#8211;  they are expensive .  I plan to solder conect<br />
wires to the contact points where batteries would connect.  They operate on<br />
a whole range of voltages.</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2005/04/latest-news-in-larry-keegans-world-of-experiments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AMAZING BREAK-THROUGHS !!!</title>
		<link>http://sketchbooks.com/blog/2005/02/amazing-break-throughs/</link>
		<comments>http://sketchbooks.com/blog/2005/02/amazing-break-throughs/#comments</comments>
		<pubDate>Sun, 06 Feb 2005 11:59:38 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=43</guid>
		<description><![CDATA[HERE ARE THE BREAKTHROUGHS
(1)  MY SPEAKING COUNTER WILL NOW COUNT CONTINUOUSLY  TO 999
(2)  MY  PIC PROGRAMMER SOFTWARE NOW OPERATES  A HUNDRED
TIMES  FASTER!!
(3)  MY DOS BATCH FILE NOW RUNS WITHOUT ANY INTERVENTION FROM
ASSEMBING THE PROGRAM THROUGH PRE-ERASING THE PIC,  WRITING THE      CONFIGURATION WORD, [...]]]></description>
			<content:encoded><![CDATA[<p>HERE ARE THE BREAKTHROUGHS<br />
(1)  MY SPEAKING COUNTER WILL NOW COUNT CONTINUOUSLY  TO 999<br />
(2)  MY  PIC PROGRAMMER SOFTWARE NOW OPERATES  A HUNDRED<br />
TIMES  FASTER!!<br />
(3)  MY DOS BATCH FILE NOW RUNS WITHOUT ANY INTERVENTION FROM<br />
ASSEMBING THE PROGRAM THROUGH PRE-ERASING THE PIC,  WRITING THE      CONFIGURATION WORD, CREATING THE INTERMEDIATE FILE, TO LOADING THE  PROGRAM ONTO THE PIC.  IT ALL HAPPENS IN 15 TO 20 SECONDS.</p>
<p><span id="more-43"></span><br />
THE SPEAKING COUNTER<br />
The speaking counter uses 8 bytes of storage to contain 8 binary-coded decimal  (BCD) numbers with a capacity of 99,999,999.  The code for maintaining this counter is fully in place, but the logic for playing the numeric messages only foes up to 999 at the present time. I&#8217;ve had it count up to 275 so far.  There is still work to be done on the delays and connecting between the messages involved.<br />
&#8220;one&#8221; &#8220;hundred&#8221; &#8220;seventy&#8221; &#8220;one&#8221; has 4 messages for 171.<br />
PIC PROGRAMMER 100 TIMES FASTER<br />
To program the PICs, I use a Qbasic language pgm of my own, and an older PC laptop. The pgm sends control signals via the printer port and some TTL buffering  to the PIC chip. The main signals are the clock and data lines which contain the<br />
programming commands and the data of the PIC assembler pgm to be loaded.<br />
I encountered a difficulty in that I was forced to enter one instruction, then to go out of programming mode and back in for the next instruction.  I believe I was not allowing enough time (10 msec) after the &#8220;program one cycle&#8221; commands.<br />
Well I made some changes and included the necessary delay and now I can just stay in programming mode.<br />
DOS BATCH FILE COMPLETELY AUTOMATIC<br />
I discovered that ther is a Basic command called SYSTEM. It closes all open files and returns control to the operating system.  Before I used the command STOP.<br />
But for this I had to intervene to get back into DOS. Now the batch file is completely automatic.</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2005/02/amazing-break-throughs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;ve Cleaned Up My Shop</title>
		<link>http://sketchbooks.com/blog/2005/01/ive-cleaned-up-my-shop/</link>
		<comments>http://sketchbooks.com/blog/2005/01/ive-cleaned-up-my-shop/#comments</comments>
		<pubDate>Mon, 17 Jan 2005 20:10:07 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=41</guid>
		<description><![CDATA[Take a look!  For a while I couldn&#8217;t find my way around my shop!
My white counter-top was covered with resistors, batteries, capacitors, IC&#8217;s , wire, connectors, breadboards, PC boards, relays potentiometers,screwdrivers, pliers, wire strippers, scissors, electric tape, stands of solder, machine screws and nuts, pieces of metal of all shapes, relays and switches. Well, [...]]]></description>
			<content:encoded><![CDATA[<p>Take a look!  For a while I couldn&#8217;t find my way around my shop!<br />
My white counter-top was covered with resistors, batteries, capacitors, IC&#8217;s , wire, connectors, breadboards, PC boards, relays potentiometers,screwdrivers, pliers, wire strippers, scissors, electric tape, stands of solder, machine screws and nuts, pieces of metal of all shapes, relays and switches. Well, look what has happened!<br />
<img alt="shop.jpg" src="http://sketchbooks.com/blog/archives/shop.jpg"  border="0" /></p>
<p><span id="more-41"></span><br />
When you are in the heat of a project, you don&#8217;t want to waste time cleaning up, so you just push stuff aside. But finally you get to a point where you can&#8217;t even move around in your shop, there&#8217;s so much stuff on the floor. Then you have to make a tactical retreat and put everything back where they belong. That&#8217;s where I am now and it&#8217;s really helping me with my project.</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2005/01/ive-cleaned-up-my-shop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A ROBOT THAT AVOIDS OBSTACLES!</title>
		<link>http://sketchbooks.com/blog/2004/08/a-robot-that-avoids-obstacles/</link>
		<comments>http://sketchbooks.com/blog/2004/08/a-robot-that-avoids-obstacles/#comments</comments>
		<pubDate>Sun, 01 Aug 2004 11:06:33 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=40</guid>
		<description><![CDATA[Well here it is!
THE SENSBOT &#8211; a robot the senses obstacles
and navigates to avoid them.


I have been having a lot of fun placing boxes and things
around the floor and seeing how well SENSBOT does.
Sometimes it gets itself stuck. But it does very well
and sometimes great when it goes into a dead-end hall area
anbd manages to [...]]]></description>
			<content:encoded><![CDATA[<p>Well here it is!<br />
THE SENSBOT &#8211; a robot the senses obstacles<br />
and navigates to avoid them.<br />
<img alt="sensbot.jpg" src="http://sketchbooks.com/blog/archives/sensbot.jpg" width="432" height="340" border="0" /></p>
<p><span id="more-40"></span><br />
I have been having a lot of fun placing boxes and things<br />
around the floor and seeing how well SENSBOT does.<br />
Sometimes it gets itself stuck. But it does very well<br />
and sometimes great when it goes into a dead-end hall area<br />
anbd manages to turn around and come out again all<br />
by itself.<br />
SENSBOT has a rotating turret driven by a stepping motor<br />
controlled from the computer program in the PIC microcontroller.<br />
In general my turret sweeps 90 degrees, and I have settled on<br />
5 segmnents of detection. Extreme left and extreme right,<br />
slightly left and slightly right, and direct ahead. My sensor is the<br />
Sharp GP2Y0D340K. This infrared sensor is set to activate a<br />
signal when object is less than 40 centimeters (about 15 inches?)<br />
from sensor. I bought 4 of these sensors from junun.org at $6<br />
each. I use only one in the rotating turret.<br />
My program algorithm is as follows.<br />
If object sensed on extreme left, stop right wheel for brief time.<br />
If object sensed on extreme right, stop left wheel for brief time.<br />
If object sensed slightly to left, stop right wheel for longer time.<br />
If object sensed slightly to right, stop left wheel for longer time.<br />
If object is directly ahead, I alternate between a hard right<br />
and a hard left.<br />
This robot is not set up to go in reverse. The PIC sends signals<br />
to 2 transistors which control the on and off to the wheel motors.<br />
The sensors are quite complex. An infrared signal is sent out<br />
at some specified freequency, and a phototransistor or photodiode<br />
detects signal. The receiver though will filter out any other signal<br />
that is not at the specified frequency. This prevents false signals<br />
from other sources.</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2004/08/a-robot-that-avoids-obstacles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LIGHT-SEEKER WORKS!!</title>
		<link>http://sketchbooks.com/blog/2004/05/light-seeker-works/</link>
		<comments>http://sketchbooks.com/blog/2004/05/light-seeker-works/#comments</comments>
		<pubDate>Mon, 17 May 2004 21:37:06 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=38</guid>
		<description><![CDATA[It works!  The robot LIGHT-SEEKER was completed
and here ii is.

Here is how it works.  It rotates around little by little
and checks for a light source ahead of it.
When it finds a light source it beeps and proceeds
in that direction.  After a short distance it checks
if the light  source is still there. [...]]]></description>
			<content:encoded><![CDATA[<p>It works!  The robot LIGHT-SEEKER was completed<br />
and here ii is.<br />
<img alt="light-seeker.jpg" src="http://sketchbooks.com/blog/archives/light-seeker.jpg" width="432" height="439" border="0" /><br />
Here is how it works.  It rotates around little by little<br />
and checks for a light source ahead of it.<br />
When it finds a light source it beeps and proceeds<br />
in that direction.  After a short distance it checks<br />
if the light  source is still there. If so it continues ahead,<br />
otherwise it rotates again and seeks a light source.</p>
<p><span id="more-38"></span><br />
Thanks to Bob Neidorff of NEMES for help with<br />
293 H-bridges which worked well with<br />
my DC motor control.  However things did not go smoothly until<br />
I put in the diodes to curb the spikes<br />
from the motor coils, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2004/05/light-seeker-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A  NEW  ROBOT</title>
		<link>http://sketchbooks.com/blog/2004/05/a-new-robot/</link>
		<comments>http://sketchbooks.com/blog/2004/05/a-new-robot/#comments</comments>
		<pubDate>Mon, 10 May 2004 21:52:43 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=37</guid>
		<description><![CDATA[This new robot is pictured on the right. It is called
STEPBOT and is powered by stepper motors.


I am coming to grips with problems of torque. The wave pattern
is the easiest to drive a stepper. These are unipolar stepper
motors.  So I went to a half-step pattern which should give me
more torque &#8211; I hope.  [...]]]></description>
			<content:encoded><![CDATA[<p>This new robot is pictured on the right. It is called<br />
STEPBOT and is powered by stepper motors.<br />
<img alt="IMAGE002.jpg" src="http://sketchbooks.com/blog/archives/IMAGE002.jpg" width="432" height="279" border="0" /></p>
<p><span id="more-37"></span><br />
I am coming to grips with problems of torque. The wave pattern<br />
is the easiest to drive a stepper. These are unipolar stepper<br />
motors.  So I went to a half-step pattern which should give me<br />
more torque &#8211; I hope.  There is still another pattern that I can look into.<br />
With the DC motors there seems to be no problem with torque.<br />
Stepper motors for locomotion do have some advantages.<br />
To reverse direction, I just send the patterns in the opposite<br />
sequence.  To stop, I just stop sending the signals.<br />
An example of wave pattern is as follows:<br />
1 0 0 0<br />
0 1 0 0<br />
0 0 1 0<br />
0 0 0 1<br />
Each of the one&#8217;s represents energizing one of the coils<br />
in the stepper motor.  You just repeat sending  this pattern over and over<br />
and the motor steps ahead.  The pattern for the half-step<br />
is more complicated, but basically energizes 2 coils<br />
on some of the patterns.<br />
Of course, I am sending these patterns to 2 stepper motors,<br />
so I can make one stop or go in reverse while the other<br />
goes forward.</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2004/05/a-new-robot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NEW VERSION OF PROGRAMMER SOFTWARE</title>
		<link>http://sketchbooks.com/blog/2004/04/new-version-of-programmer-software/</link>
		<comments>http://sketchbooks.com/blog/2004/04/new-version-of-programmer-software/#comments</comments>
		<pubDate>Fri, 23 Apr 2004 19:04:09 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=35</guid>
		<description><![CDATA[I made  2 new QBASIC pgms for programming the PIC. These programs do not solve a problem I have been working on., but they clean up and speed up the process.

A program called INBTWEEN.BAS takes the hex file produced by my ASSEMBLER and prodeuces a file of 16 character strings, all containing 1&#8217;s &#038; [...]]]></description>
			<content:encoded><![CDATA[<p>I made  2 new QBASIC pgms for programming the PIC. These programs do not solve a problem I have been working on., but they clean up and speed up the process.</p>
<p><span id="more-35"></span><br />
A program called INBTWEEN.BAS takes the hex file produced by my ASSEMBLER and prodeuces a file of 16 character strings, all containing 1&#8217;s &#038; 0&#8217;s.<br />
Ther second program WORKRND2.BAS reads the string file and sends this data along with the necessary programming COMMANDS to the PIC.  Note that I still have to enter &#038; leave programming mode each time I write an instruction to the PIC. But I have cleaned up the code and the processing.  I have a variable I use for delay loops. Up to now I have been using 1000, but I have found by experiment that the program works at 100, which has speeded things up tremendously</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2004/04/new-version-of-programmer-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MY FIRST PIC-CONTROLLED ROBOT</title>
		<link>http://sketchbooks.com/blog/2004/04/my-first-pic-controlled-robot/</link>
		<comments>http://sketchbooks.com/blog/2004/04/my-first-pic-controlled-robot/#comments</comments>
		<pubDate>Fri, 23 Apr 2004 18:49:41 +0000</pubDate>
		<dc:creator>larrykeegan</dc:creator>
				<category><![CDATA[PROGRAMMING THE pic microcontrollers]]></category>

		<guid isPermaLink="false">http://sketchbooks.com/blog/wordpress/?p=34</guid>
		<description><![CDATA[Here are some new happenings in my PIC programming adventures.
This robot moves forward for several seconds then makes a 90 degree turn.
It continues to do this moving in a square path.

The program uses the timer0 with an interrupt.  The pre-scaler is set for 1:256.
My interrupt routine subtracts  from a register everytime there is [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some new happenings in my PIC programming adventures.<br />
This robot moves forward for several seconds then makes a 90 degree turn.<br />
It continues to do this moving in a square path.</p>
<p><span id="more-34"></span><br />
The program uses the timer0 with an interrupt.  The pre-scaler is set for 1:256.<br />
My interrupt routine subtracts  from a register everytime there is an interrupt. When my register is zero, I make my turn.   I get about 8 to 10 seconds delay.</p>
]]></content:encoded>
			<wfw:commentRss>http://sketchbooks.com/blog/2004/04/my-first-pic-controlled-robot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
