I am working on a project that requires an element of real-time control. My goal is to design it in such a way that I can use *some* communication method to send control codes to the microcontroller.
From what I have read on this site, there seems to be a three-tiered balancing act in hobbyist electronics:
. Functionality vs Cost (Buying pre-made solutions to do what you want)
. Cost vs Complexity (Building your own, but very complex solutions)
. Complexity vs Functionality (Keeping it simple, and having to settle for _barely_ good enough)
So my request: Does anyone have a suggestion on a good way to approach this? The microcontroller will need to control motors / servos with reasonably severe granularity. Are there any recommendations on a augmented MC that has this capability pre-designed? I am looking for as cheap an approach as possible, with an upper limit of about $10 each (MC and communication method).
Also, I see that there are several (cheap) solutions that have on-board programmers, but am I able to access those while the MC is running? If so, that might be a tentative solution right there.
To give a better idea of what I want to do, here was my first approach idea:
My first thought was to use a PC parallel port and connect those pins to the I/Os on the microcontroller. I would then simply turn the pins high and low to coorespond to their codes (0001, 0010, 1001, etc). This approach has an extreme lack of timing control (since it would have to depend on the called procedure taking longer to execute than the time that the PC takes to change the pins), and thereby the granularity of the control might not be enough. A solution might be to maintain a "Base" code be sent between command codes, and have the microcontroller loop in a state until such a base code is seen. However again, there might be issues of sufficient motor control (since we are introducing a delay into the process).