ive finally started to make headway in my attempt to design my own programmable radio control receiver. its really a rehash of various semi-successful projects ive done before. part of it is my ps2 gamepad hacked to be wireless, now using a new communications library which is much more reliable. and my old r/c board which has new firmware and is much more customizable. most of this project has been software, but ive had to do a few hardware hacks here and there. the new library required me to remove some components from the board, namely an opamp and setting resistors, i had to add some extra programming pins as well. i also didnt think ahead and put a programming header on the r/c board, so i have a hackish mash of wires which i have to connect one wire at a time to update the firmware.
but the new firmware is much more versatile. i have 6 servo channels, 2 motor driver channels, with separate break channels. i also want to add some digital outputs (for things like lights) as well as telemetry outputs (such as speed indication) to be radioed back to a character display. outputs are all broght under a unifying class that standardizes the interface to inputs. its job is to make appropriate calls to the required libraries to make things happen also to provide bindings to the much more complex input class.
the input class gives you a bunch of little input blocks, like the output class it provides a unified interface with all input from the controller over the radio link. providing basic inputs like axes and buttons, advanced constructs like button axes, simple constants, and a mixer which can combine other inputs. i also want to give it some analog/digital input pins for feedback so i can do pid control, also local sensors can provide input for telemetry. the mixer is pretty badass, as it not only mixes the outputs but can also perform math and logic operations with the data. every input has an offset, a fixed point scaler, and min/max constraints. i believe the system is turing complete, though i only have the firmware configured to give me 16 of the objects. i figure i can get about 20 with the current code, though i want to save some space for more features.
this is probibly the biggest program i ever uploaded to a microcontroller, its almost 25k. though most of that is strings for the configuration terminal. im using the eeprom for storing configuration data. im using all 3 timers, and i think my ram usage is raher high, but im not sure how much. i know the stuff im using is taking up nearly 1k of sram, and libraries likely use the other half. the serial library whores up ram for its buffers, but it gets closed down before anything fun happens. after a reset you have about 2 seconds to send the string 'config' after which you enter terminal mode, and stay in terminal mode until you either give the exit command or reset. there are about a dozen commands. about 5 general purpose commands, like save, load, etc, 6 commands for input configuration, about 3 for output configuration and a couple for the motor drivers.
current issues are the power supply is not up to par. its not really as good as the board i did to power my raspberry pi. it doesnt have as big a capacitor, and no heat sink at all. not even reverse polarity protection. the motor driver can only do 1 amp per channel. and the cheap radio modules im using kinda suck as far as range and throughput go. so i will definately make a new one based around the same firmware. i will likely swap out the ask radios with a nordic transceiver i got stashed in parts box, they have similar range and better throughput, and use a better modulation scheme (fsk i think). and i will put a beefier motor driver in the thing. probibly do a switch mode power supply (im just gonna cheat and get some ubecs, they are dirt cheap on ebay and can push 4 amps). may also toss in an io expander of sorts, though i could just use a bigger chip in a smaller tqfp package (though im not sure if my solder-fu is strong enough, not to mention my pcb fabrication process still sucks).