April 23, 2004

NEW VERSION OF PROGRAMMER SOFTWARE

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's & 0's.

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 & 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

Posted by larrykeegan at 07:04 PM

MY FIRST PIC-CONTROLLED ROBOT

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 an interrupt. When my register is zero, I make my turn. I get about 8 to 10 seconds delay.

Posted by larrykeegan at 06:49 PM

April 18, 2004

LATEST ON THE PIC - a letter to BOB

Here is the latest on what I am doing with the PIC
and my problem in making PROGRAMMING SOFTWARE
to load programs on to the PIC.

Hi Bob
I think I'll reply to your note and then plunk this message
right out on my BLOG. Basically, I got one PIC to drive a stepping motor
also successfully implemented INTERRUPTS and also got TIMER0 working
which also involves interrupts. At the point where I was going to do
a robot that would move around in the pattern of a square, I decided to go back to investigating my programming software again.

By the way, my communication between the 2 PICS was just input/output -
didn't even use an interrupt. I think I told you of the organ pipes
I picked up in Reading, but I just hooked up a blower I had to an organ pipe but the initial results were not to great. You seem to be dong your experiments much more scientifically, and you have garnered much more knowledge about them than I have.

Let me get back to my programming software for loading in my programs to the PIC. I explained how I am almost embarrassed to admit that all my programs have been loaded onto the PICs by software which is a WORKAROUND for a problem I have encountered. To program the PIC there are a handful of commands which are interspersed with the data you are sending to the PIC.
My QBASIC software sends 2 streams, clock & data, to the PIC.

My problem is that each time I write one line of data (an instruction) to the PIC, it either drops out of programming mode or something and does not carry out the remainder of the commands. My workaround has been to write one line of data to the PIC, then leave programming mode, then re-enter programming mode which always brings you to location zero. At this point,
I send the command to increment the program counter as many times as necessary to reach the new location where another line of data will be written.

I have talked with some people at MicroChip where I uncovered some errors in
the programming specs which I has found out on the Internet. Since there is no limit on how slow you can send the clock & data stream, I set up a very simple circuit and thru 2 set-reset flip-flops I fed in the data manually.
And to my surprise the same thing happened - only one line of data was accepted. I've tried many different PIC16F628 chips. I'm almost of a mind to jump to the PIC16F628A, which has some slight changes.

Well there it is, I'm sure much more than you wanted to hear.

Larry Keegan in Stoneham, MA

On 4/18/04 10:56 AM, "Robert Sweeney" wrote:

> Hi Larry,
>
> How are things going? I haven't heard from you in a while and I noticed
> on your blog that you are in a "tactical retreat" since March 21. I
> hope you are feeling better.
>
> It looks like you are making rapid progress with your pics. Did you set
> up communications between two pics with RS-232 (USART port) yet?
>
> My son and I are also taking a break from our projects. Although, I am
> writing a program to calculate the parameters for pipe organ pipes on
> the PC. I am writing a windows program in visual c++. I can select the
> pipes I want in my pipe organ and it will spit out all the dimensions
> for the wood pipes as well as the air consumption needed so I can design
> the appropriate wind system.
>
> Other than that I have been a slug. Enjoy the nice weather!
>
> Regards,
> Bob Sweeney
>
>

Posted by larrykeegan at 04:51 PM