Thank you for the suggestion John. At the time of the problem I tried EVERYTHING - caps, grounding the motor casing, separate battery supplies for PIC circuit and motor, etc. Seemed the the PIC was just too close to the motor itself (I had no control over this). But by repeating the commands constantly (especially the TRIS commands to keep inputs as inputs and outs as outs) and the HIGHs as HIGHs, etc., the problem vanished. I also had another motor problem where the HPWM was set to a specific duty cycle and intermittently become an output HIGH or output LOW. Again, after setting the HPWM, I constantly repeated the command in other parts where the program would go and that fixed it. Of course the program took more memory, but that wasn't an issue.
Who's John?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
That was me..
I sent peterdeco1 a private message regarding motor noise effecting A/D. My problem was solved by using .1uf caps from each motor lead to the motor's metal case. It seems to work with the small (noisy) hobby motors. I used shielded cable to the A/D inputs.
--John
Last edited by JohnH; - 4th May 2007 at 00:36.
Welcome on the forum, and thanks to share your tips on the public area![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks