Project Updates for 9/16/2010

[img breadboard_small1.jpg||left]I wanted to upload some pictures of the progress so far, but when I searched for the camera I couldn't find it. Anyways, I went ahead and put the 18F2620 onto one of my small breadboards and added all the resistors necessary to run it. I also took the code and stripped it down to it's minimal function by removing LCD and LED test code, which brought it to around 750 bytes, which is quite small nowadays. I went ahead and tried it, but wasn't able to get any results with regards to SPI. I decided to separate my code and set it up for the 2 different chips, so I could take what was working and what I wanted and get it to a middle point. It turns out that on my small board I had accidentally tied MCLR to ground, which caused a constantly resetting chip. After swapping that around it started working fine.

Additionally, I kept having problems with my programmer. I noticed it worked fine on the 40-pin chips, but not 28-pin chips, so I figured it had something to do with the 40 to 28 pin adapter (which it did). I eventually narrowed it down to an intermittant short on the PDC pin (pin 27 on the 18f2620). I went ahead and resoldered it and it seems to be working much better.

I'm currently only having trouble with reading the DIP switch values via SPI. It should be fairly straight forward, but it might be something to do with reading a PORT value within an interrupt service routine. I'll start by trying to see if it's even reading the PORT value at all. If it is, I may have to do a little workaround by just reading the value within the main loop and storing it in a variable.

Adding commands into the PIC is actually pretty nice, because if I need to make any parameter changes in the future, all I would need to do is change it on the arduino. I also want to add some code to check if the values are within a certain range like 600-2400 before storing them into the array. By having a command for changing that range, all I would need to do is set it through the arduino.

So far, the project is coming along pretty nicely. I still need to come up with the PWM code on the arduino, which should be pretty easy. After that, I can mount the arduino and breadboard on the car and it can get it's first test. I have an ultrasonic sensor from Parallax that I will probably use as one of my first sensor tests. I still need to at least get the switch code and PWM code going and then I can do the first trial run. Hopefully I can find the camera by then so I can take some pictures.

Posted in Old Posts 16 Sep 2010