Project Updates for 9/7/2010

After a lot of fine tuning and tweaking, as of last night, I've finally been able to get the PIC and arduino to communicate without errors. I've noticed that occasionally one of the shift registers gets it's bits rotated on power-up, but a reset of the arduino seems to fix the problem. I'll still look into that so it can work reliably.

The next will be reading PWM values from the receiver. According to documentation and as I've seen on my oscilloscope, the times should vary between 1000-2000 microsecond pulses depending on the direction of the controls. My plan is to have a 16-bit timer constantly running from 0-65535 and looping back in order to have something to measure time. Also I will be having the PIC running in a loop and taking note of any changed states of the 6 lines it will be monitoring and calculating the length of the pulses. I'll then have it throw out any values out of the expected range. Once I get the measurements I'll use the number to calculate a value between 0 and 255 and store in on the PIC. When the arduino requests a particular channel's value, the idea is to just send the last stored value for that channel back to the arduino.

For testing purposes, I'm also swapping the 18f2620 for it's bigger brother, the 18f4620. It has an additional port (Port D) that I can use for PWM testing while still allowing the LCD screen to be connected. After I get everything working, my plan is to disconnect the LCD (and remove the code for it) and use port B for connecting to the receiver.

Posted in Old Posts 07 Sep 2010