April 26th, 2008 by tommcguire
I’ve been so busy this year, I haven’t had time to update this blog. The two big projects I’ve been working on were “interACTIVE” an exhibition at the Wichita Art Museum and A Technology Art Sculpture with the 5th grade class of Beech Elementary School. You can see a video documentary of the Beech School project here (click on the picture).

You might notice the absence of kids in the video. When ever I was with the kids I didn’t have time to take pictures.
Prior to that was the Wichita Art Museum. Lee Shiney Chris Gulick and I started in September and worked out tails off to get it up and running by February. You can see pictures and blogs of this project (here).
   
More to come…
Posted in Simple Fun, Uncategorized | No Comments »
November 30th, 2007 by tommcguire
When ever I find an easy way to do something I just have to make a record of it. There are some projects where you might want to do something wireless with the Logochip. This little circuit makes it pretty easy.
First an explination of the Radioshack 276-640, the IR Receiver Module. It will receive signals from an IR(940nm) LED that is oscillating at 38killoherts. So if we want to send a series of 1’s and 0’s we modulate this 38KHz signal on and off.
Fortunately the Logochip can produce the 38KHz signal and modulate it with very little effort from the software. We’re going to set up the internal timer module to produce the signal and set up the serial UART to modulate it. So here let’s look at the schematic.

This schematic shows the Logochip circuit to the left and the IR transmit and receive circuits to the right. There are two transistors involved in the in the transmit. The one that drives the LED is driven by the timer output PORTC bit 2 which is producing a 38KHz square wave. But most of the time it is being held off by the other transistor which is being driven by the transmit pin (TX) PORTC bit 6. Now when you tell the serial port to transmit an 8 bit byte the serial data comes out of the TX pin and modulates the 38KHz signal on and off to the LED.
On the receiver side (this is really easy) the Radioshack part is simply hooked up to the 5 volt power and ground and the output signal runs right into the receiver input (RX) PORTC bit 7. I put a resistor to ground just in case the output drifts. That’s it.
Here’s a picture of my bread board. IRlogoProtoBoard . The transmit LED and the receiver module are pointing straight up and I just help my hand above it to reflect the signal back. I can’t wait to use it in something.
So here’s the Logochip code. I hope I commented it well enough for everyone to follow.

Have fun…
Posted in Logochip | No Comments »
November 7th, 2007 by tommcguire
If I were to describe the proccess of implementing a sreial port communication with a microcontroller I’d say It’s a shot in the dark. There are a fairly large number of variables that come into play when data is transmitted and received. I just wanted to touch on error handeling here just as sort of note to my self if nothing else. Presuming you get the baud rate and the number of bits set right and you are able to get the basic communication working there are a couple of things that can still happen that will put a damper on the whole thing.
Framing Errors
If you send a whole string of data to a microcontroller and the controller software isn’t paying a lot of attention to the comm port one of the things that can happen is called a framing error. In the PIC18F2320 chip there is the “rcsta” (receive status register) which is at address $fab. Bit 2 of this register will go high on a framing error. The best resolution for this error that I have found is to go ahead and read the data from the “rcreg” receive register but keep in mind that it may be bad data.
Over Run Errors
Another kind of error you can get is called over run error. This can be a serious problem because it will cause the reciever to stop working until the problem is resolved. Bit 1 of the rcsta will go high (1) on an over run error. To resolve this error turn off the continuois recieve bit (bit 4) of the rcsta (set it to 0) and then turn it back on (set it to 1). This will flush out data that is held in the receive buffer and reset the reciever to run again.
CORRECTION It will flush out the receive buffer but it will not clear the error. So don’t keep doing it in a loop because the error will clear only after the next byte is received. If you keep reseting the receiver it will never receive the next transmition.
So here is a code example for the Logochip to handle the comm port:
;CommErrorTest.txt
constants [
 [rcreg $fae][rcsta $fab]
 [spbrg $faf][pir1 $f9e][txsta $fac]
 [txreg $fad][t2con $fca]
 ]Â
global[ comand ]
to powerup
 prs “CommErrorTest.txt”
 write spbrg 25  ; sets baud rate to 19200
 write rcsta $90
 write txsta $24
 write t2con 6
end
to startup
 loop[
  if testbit 1 rcsta [ ;check overrun Error
  clearbit 4 rcsta
  prs “overrun”
  setbit 4 rcsta
  ]
  if testbit 5 pir1 [
   setcomand uart-receive
   print comand
   ]
 wait 10
 ]
end
to uart-send :n
 waituntil [testbit 1 txsta]
 write txreg :n
end
to uart-receive
 if testbit 2 rcsta [  ;check frame Error
  prs “framing”
  ]
 output read rcreg
end
Posted in Logochip | No Comments »
June 10th, 2007 by tommcguire
Posted in Simple Fun | 1 Comment »
April 21st, 2007 by tommcguire
Spiders are good for the garden but they scare me. Here’s a good way to have fun with your older sister. Attach some kind of spool to a toy motor shaft and mount it up high. Then tie a string to a creepy bug and run it up to the spool. When the motor runs the bug goes up. Disconnect the motor and the bug comes back down.
Click the picture for a video.
      
Posted in Simple Fun | 1 Comment »
April 17th, 2007 by tommcguire
   Sometimes you just want to smack something. Ya know what I mean. Don’t take it personal. It’s real easy to do. If you want to make some noise or knock something over just stick a stick on a motor shaft and let fly. A word of caution once the motor stops turning don’t leave the battery connected too long. It may smoke.
Click for video:
          
Posted in Simple Fun | No Comments »
April 15th, 2007 by tommcguire
Using the lab notes from Prof. Robbie Berg I hooked up a memory chip to a Logochip using an I2C interface. So if somebody would want their Logochip to remember a bunch of numbers like a data pattern or say an audio track this could help. It could also be helpful if you wanted to use another device that had an I^2C (also called”2 WIRE”) interface. Memory is saved when the power is off too. The PDF formatting of his lab notes kind of screwed the line feeds so I tried to tidy things up. But it’s real easy to hook up. The part only costs a buck. You can paste this code in, load, and go. Might be a good thing to put in the wiki.
Â
Â
Logo code for reading and writing data to a 24LC64The Logo code below (also stored in the course conference is the file calledeeprom.txt) contains the procedures needed for a LogoChip to be able to write and read data to and from a 24LC64.To write a byte of data to the 24LC64 usewrite-eeprom <address> <value>where <address> is an integer from 0 to 8191 and <value> is an integer from 0 to 255.• For example trywrite-eeprom 100 57This command stores the number 57 in memory location 100 in the 24LC64 To read a byte of data from the 24LC64 useread-eeprom <address>where <address> is an integer from 0 to 8191 and <value> is an integer from 0 to 255.• If you tryprint read-eeprom 100you should see the number 57 print in monitor window.
Here’s the code:
            Â
Â
Posted in Logochip | No Comments »
April 13th, 2007 by tommcguire
Here’s something that was popular a few years ago. You could have a pot of flowers with a bumble bee or a butterfly flittering around it. It’s a neat tick. Mount a toy motor in the middle of the flowers. A wheel mounted on the motor shaft has a small hole drilled off center. A thin wire stuck in the hole extends out to the bug. Click this picture for a video.
             Â
  Â
Posted in Simple Fun | No Comments »
April 12th, 2007 by tommcguire
This is in response to a previous error and also to make sure that parallel data lines to multiple LCD modules would work. I haven’t built the whole circuit but enough to conferm that it will work. Earlier I posted a schematic if a single line LCD module that had pin 3 grounded and it should have been tied high. Here’s a picture of what I wired up:
      Â
  Â
And here is a schematic of a Logochip and 3 LCD Modules wired up to it:
                   
And here is some code that sets up the Logochip and initializes the LCDs and prints aome characters on each LCD.
                      Â
  Â
Here are some links to more useful information on the LCD Modules
       A real crummy copy of the manule (LCD-111)
      More info than you want to know about the LCD controller
     A site with other applications using this LCD display
Posted in Logochip | No Comments »
April 10th, 2007 by tommcguire
         You can make any sort of flexible joint move with a little gear driven motor out of a toy robot or car. Just wrap some fishing line around the drive wheel and then thread it up and around the joint. You can run one string through several joints. Here I made a worm out of sections of pink foam plastic and then taped them together.Â
Click the picture to see it work.
                    Â
Â
Posted in Simple Fun | No Comments »