Stef Mientki wrote: > hi All, > > I just spend a lost hour on a weird idea: controling a motor and > detecting the load with minimum pin use. > I'm interested if anyone else tried this kind of uncommon motor > controlling, > or knows any links concerning this subject. > > You can find the schematic here: > http://oase.uci.kun.nl/~mientki/pic/jalcc/examples/example_motor.html > > > I haven't looked into the circuit in detail, > but most important questions at first sight seems to me > - how to calculate components, so the PIC detects the desired maximum > motorload > - if larger motors are used, will the flyback current damage the PIC ? Of course it will fry with the way you've wired it. The diode should connect to back to the supply rail. To achieve what you seem to be wanting, use a zener rated for the supply voltage, wired back to the supply so that the motor can produce up to the zener voltage as back EMF that you can measure.. > And of course, I want more ;-) - 2 digital pins to control the motor in > both directions > - detecting the exact speed, based on commutator pulses, > with the same 2 digital pins Just get a bigger PIC with more available pins. Or use SPI and 74HC595 74HC594? to get outputs/inputs. Robert -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist