Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Motors and the High Port Numbers (http://www.chiefdelphi.com/forums/showthread.php?t=43321)

Alan Anderson 04-02-2006 21:58

Re: Motors and the High Port Numbers
 
The servo power on the pwm output pins comes from the backup battery.

Goldeye 04-02-2006 21:58

Re: Motors and the High Port Numbers
 
If you run those pwms on interrupts, does anything go wrong?
How about high priority interrupts? Can the function run fast enough?

6600gt 04-02-2006 22:29

Re: Motors and the High Port Numbers
 
Quote:

Originally Posted by Eldarion
Actually, they are the fast (7ms update possible, vs. 26.6ms update) PWM outputs, but they require a call to
Generate_PWMs(pwm13, pwm14, pwm15, pwm16); every time you want them updated.

They can glitch with interrupts, but I have never seen this happen personally. :)

Actually the Pwm's 1-12 are 17ms speed normal refresh rate while the Pwm's 13-16 have a 2 ms refresh rate. Victors can work with the fast 2ms refresh rate, servos can't.

I think the Pwm's 13-16 are hardware generated from pins called CCP1, CCP2,...

I don't understand how these can be affected by the software?
The values are in software but if the software is slow to execute then the value just won't change really fast.

Mark McLeod 05-02-2006 09:27

Re: Motors and the High Port Numbers
 
Quote:

Originally Posted by 6600gt
I don't understand how these can be affected by the software?
The values are in software but if the software is slow to execute then the value just won't change really fast.

For these pwms 13-16 alone, the software gets direct control to generate a timed pulse of between 1 and 2 ms duration, 1.5ms being neutral.
Any interrupts, interrupt the software timing these pulse widths, but the software doing the timing doesn't know this. Just like none of your other regular code is ever aware an interrupt has occurred. So the software happily generates what it thinks is a neutral pulse of 1.5ms, but any interrupt handler that pops in, suspends the execution of your code, does it's thing, and returns control will extend or stretch the time of your pwm pulse by the amount of time it took to service that interrupt.
So instead of a 1.5ms pulse, for example, you'll end up with a 1.8ms pulse.
And your robot drives away.


All times are GMT -5. The time now is 21:00.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi