| DIGITAL RAINSTICK - Project l Tutorial in programming a pic 16f84a |
|
Introduction This work was made during a two week residency at Access Space in Sheffield. The original concept was to create a series of wall mounted rain sticks that would rotate (producing the sound of rain) when activated by a rain sensor located on the outside of the building. The rain sticks would be built from recycled cardboard tubes, lentils, peas and other cheap materials and would be wall mounted. They would be connected to a rain sensor with a PIC/Stamp chip. Here is what I actually made: Electricity is pulsed in sequence through the speakers by the pic chip when it rains outside.
The residency My knowledge of of using programmable microchips before the residency was fairly limited and I had no experience of using Linux. When I first arrived at Access Space I started searching on the web for sites that dealt with programming microchips with a Linux operating system. Pretty soon I discovered that I needed some microchips and a piece of hardware called a programmer which connects the microchip to the serial of your computer. A regular Access Space user, Richard Bolam had shown me a site where they sold programmers for £40 which seemed pretty cheap compared to the one in Maplins that cost about £100. So I ordered it and it came within a couple of days. After having installed a few programs it dawned on me that it was going to be a lot harder than I had thought to get a program to communicate with this thing. The programmer I had bought seemed to be tied down to a piece of windows software. While I had been doing this, I had noticed that a few websites I had come across had pictures and diagrams for making your own program, and I kept on looking at them and thinking maybe I should build my own and then thinking that just seemed far too lo-tech. Eventually I got to speak to the people who built the programmer and asked them if it could be programmed using linux, and they replied no, the software is windows based. So that was it, I had to build my own. I then spent a some time looking at websites deciding which one to build, and eventually I came across this site by a guy at Birmingham University. Not only did the site have instructions on how to make a pretty simple programmer, the guy had actually written a program that did everything I wanted - and was totally Linux based. I set about building the programmer with an old serial port and some parts from Maplins, and of course it didn't work. My biggest problem was working out at what stage in the process things were wrong, was it a software or hardware problem? So I did some work at home with the programmer I had bought with its windows based software, and eventually got it to work. This enabled me to pinpoint the problem to either the programmer or the Linux software. I now had a circuit with a flashing LED so I knew that side of things worked, all I needed to do now was to get the programmer to work under Linux.
At this point I was almost tempted to give up with Linux and just finish the piece with my home computer. However this is where using Linux gets pretty interesting. I had discovered that the main Problem was with the installation of a piece of software called Pic Prog. Every time I tried to run it, I got a list of errors about Libraries that I didn't really understand. So I tried reinstalling a different, non compiled version of it, this time I got an error saying picport -1. No one really knew how to solve this problem so I decided to send an e-mail to the guy who had written the program. He quickly replied and said go to line 196 of the program and delete the 1. And it worked ! Once Pic Prog was working, I was almost there. But kept on having loads of little problems. So I kept emailing them to the man who had designed the programmer and the Yappa software and they were both really helpful and replied quickly. The piece is now working and will be installed in Access Space in August 2003 Thanks to Jim, Ed, Tam and Richard at Access Space for their help and support during the residency. Simon Blackmore 2003 |