Quote from abishur on October 1, 2011, 22:38
I actually agree with gbulmer, most microcontrollers have a start up cost very close to the r-pi's cost (i.e. the cost of the cable to program the chip).
That said, I do think that there are many applications that the r-pi could be used for hobbyist-wise, perhaps not in direct application to the OP, but in the broad hobbyist community (IE, to provide a web-interfacable relay controller for a sprinkler system).
Yes, I can go along with that.
As long as it isn't sub-sub-millisecond-jitter real-time, ADC, PWM, R-Pi is very likely fine. It is an insane amount of computer power compared to most microcontrollers, so it "jolly well should work":)
I have three concerns (not aimed at you):
1. The architecture proposed in the OP isn't a good fit to R-Pi, why debate this any further?
2. Asserting "A is as good as or better than B", without specifying the problem or criteria isn't analysis, engineering, or science.
3. PC Linux distributions are not for hard-real-time, or even soft-real-time,. Systems which are hard-real-time, will use orders of magnitude less headroom to meet requirements.
I also know that software can emulate hardware and I wouldn't be surprised at all if people who just really wanted to use the r-pi would be able to use software to fix any shortcomings the r-pi is lacking
If the MIPS and Watts are available for the software, then it might easily match the hardware solution's KIPS and Milliwatts.
But it might be fun to try the R-Pi way
I'd prefer people to acknowledge it is curiosity, interesting, challenging or fun, but not a rationale based engineering decision.
... but it would be easier just to use the microcontroller for such situations
Agree. I don't normally like chips over 64-pins (need big boards), but a Cortex-M4 looks like a "gob-smacking" robot controller. One of those for low-level stuff, and a R-Pi for 'strategy' - yum
IMHO, an obvious solution to lack of PWM and ADC is to get an ATmega168 (as used on Arduino), for £1.72+VAT each 2-off (rs-online), and use that for ADC and PWM.
Put it on a little board (veroboard will do) connect the R-Pi SPI to its SPI plus one GPIO to trigger the ATmega RESET (you can then program the ATmega over SPI), hack one of the existing Arduino's SPI loader programs (e.g. used by one Arduino to program another), maybe to load a hacked Firmata (hacked to use SPI), and you're good to go.
It could probably run off its internal 8MHz oscillator at 3,3V, so no crystal and maybe no power regulator. Cost about £5+VAT for two.
Not trivial, but IMHO easier to use and debug than trying to get an R-Pi to emulate the same capabilities.