Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

PulsePort - weird problem.


geometrikal May 4, 2010 06:45 AM

Hi all,

I am having a problem with the PulsePort command (long winded post ahead)

I use C4 and C7 to control two servo motors using pulse width modulation.

Originally I used the PWM command, ie:


Sub SetPWM1(dutyc)
PWM (dutyc,4,20,mSec)
EndSub

Sub SetPWM2(dutyc)
PWM (dutyc,7,20,mSec)
EndSub

'Operate wipers
Call setpwm1(0.05)
Delay(1,1000,mSec)
Call setpwm1(0.10)
Delay(1,1000,mSec)
Call setpwm1(0.05)
Delay(1,1000,mSec)
Call setpwm1(0.10)
Delay(1,1000,mSec)
Call setpwm1(0)
Call setpwm2(0.10)
Delay(1,1000,mSec)
Call setpwm2(0.05)
Delay(1,1000,mSec)
Call setpwm2(0.10)
Delay(1,1000,mSec)
Call setpwm2(0.05)
Delay(1,1000,mSec)
Call setpwm2(0)

However the problem with this was that once PWM is run the CR1000 always draws 8mA of power.

Currently we do the same thing with the PulsePort command:


SubScan (20,mSec,50)
PulsePort (4,1000)
NextSubScan
SubScan (20,mSec,50)
PulsePort (4,2000)
NextSubScan
SubScan (20,mSec,50)
PulsePort (4,1000)
NextSubScan
SubScan (20,mSec,50)
PulsePort (4,2000)
NextSubScan
SubScan (20,mSec,50)
PulsePort (7,2000)
NextSubScan
SubScan (20,mSec,50)
PulsePort (7,1000)
NextSubScan
SubScan (20,mSec,50)
PulsePort (7,2000)
NextSubScan
SubScan (20,mSec,50)
PulsePort (7,1000)
NextSubScan

This works fine. However some instruments have been coming back with the servo on port C7 no longer working after being in the field a while.

Running the old code (using PWM command) the servo on C7 works. Switching to the new code it doesn't.

BUT - if I reload the operating system onto the CR1000, effectively clearing everything, then new code works again. So it is not a hardware issue.

Any ideas? Is there anyway the pulse port command could get corrupted? Some flag in the OS that once set no longer lets me output to that port?

Thanks
Ross

* Last updated by: geometrikal on 5/4/2010 @ 12:46 AM *

Log in or register to post/reply in the forum.