Control V4 is built! The specs:
- DSPIC33FJ128P202 MCU
- MPU6050 sensor, providing 6 degrees of freedom (gyro + accel)
- MAX3232 serial level converter
- And some nameless 3.3v 5v tolerant OR gate to combine the four input channels.
I can provide the eagle files for this board if anyone requires them, the board itself is relatively easy to make, as I stuck with 1206 package passives, and chose a DIL package for the MCU. The mpu6050 breakout however was bought, and now I can see its dimensions I am so so glad I didn't try to solder one myself.
Now onto the programming of the board (which has been 16 hours a day for about four days now). The program so far is around 1000 lines (10000 if you count all the header files), which covers the UART setup and operation, configuring the output compare modules as PWM generators to drive the motors, I2C setup and operation, and a driver for the MPU6050. The UART and output compare modules were relatively simple, however the I2C was a bitch and a half to coax into life, mostly because I couldn't get the example I2C code to work with my project, meaning I had to write my own driver. The MPU6050 was also a pain, mostly because my lack of a logic analyzer made debugging the I2C communications very difficult.
Nevertheless, I have now successfully communicated with the sensors, and I must say the raw accelerometer output looks far less noisy than my previous sensors, I cannot wait to get these sensors fused together.