PWM Motor control help needed
Furball
Posts: 4
Im in the need of some help, i have made a program that will control a Pulse Width Modulation (RC Motor). It when swipped with a magnet· will turn on and ramp the speed up for a given amount of time and then ramp down. It seems to be working, part of the time. Some times it will turn on but not run, and then sometimes the leds will turn on but no motor and then sometimes it will turn on without even swipping the magent on the switch. I was wondering if someone could take a look at this program and tell me what im doing wrong or maybe has a better and easier solution to my problem. [noparse]:)[/noparse]·
Im still a newbee so im sure this will be easy for·you experts. Thanks for all your help.. [noparse]:)[/noparse]
Im still a newbee so im sure this will be easy for·you experts. Thanks for all your help.. [noparse]:)[/noparse]
Comments
I see you use stack space of BYTE[noparse][[/noparse]100], not the usual LONG[noparse][[/noparse]100]!
(lots of projects I have looked at, use longs for stacks, and usually assign 50 longs to each cog.)
At least its something to try. Plus most people don't need the extra space so it does no harm to use more stack.
I suspect the issue is your circuit, not program.
Upload your schematic, considering that your using a motor, your circuit might be the issue, not your program.
Post Edited (Clock Loop) : 8/21/2009 12:26:33 PM GMT