<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=17&amp;t=6655" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2011-03-25T06:37:09+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=17&amp;t=6655</id>
<entry>
<author><name><![CDATA[roboard]]></name></author>
<updated>2011-03-25T06:37:09+01:00</updated>
<published>2011-03-25T06:37:09+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=30638#p30638</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=30638#p30638"/>
<title type="html"><![CDATA[Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=30638#p30638"><![CDATA[
Hi,<br /><br />we have added (high-level) continuous PWM functions (rcservo_SendCPWM(), rcservo_StopPWM(), ...) into RC servo lib of RoBoIO 1.7. It is now unnecessary to apply the low-level PWM lib for using <br />continuous PWM. <br /><br /><img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1542">roboard</a> — Fri Mar 25, 2011 6:37 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Lost Tourist]]></name></author>
<updated>2010-11-11T22:59:15+01:00</updated>
<published>2010-11-11T22:59:15+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28715#p28715</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28715#p28715"/>
<title type="html"><![CDATA[Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28715#p28715"><![CDATA[
Roboard,<br /><br />For some reason I do not seem to have access to the pwmdx commands you listed even when I include the pwmdx.h header file.<br /><br />As I wrote above I'm not trying to do anything the fancy so if using PWM_Initialise is the recommended way then I will use AndrewMerrill's code.<br /><br />Thanks for your help.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2355">Lost Tourist</a> — Thu Nov 11, 2010 10:59 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[roboard]]></name></author>
<updated>2010-11-01T12:59:25+01:00</updated>
<published>2010-11-01T12:59:25+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28617#p28617</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28617#p28617"/>
<title type="html"><![CDATA[Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28617#p28617"><![CDATA[
<blockquote><div><cite>Lost Tourist wrote:</cite><br />Roboard,<br /><br />Still no joy. I have experimented with the order of things, removed bits added bits all to no avail.<br /></div></blockquote><br /><br />Hi,<br /><br />the line &quot;pwm_EnableINT(channel)&quot; should be removed. And &quot;channel&quot; should be an integer between 0~23.<br /><br />Please try the following code to see whether PWM channel 0 sends PWM pulses. <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>int channel = 0;<br /><br />pwm_SetBaseAddress&#40;0xfe00&#41;; <br />pwm_SetBaseClock&#40;PWMCLOCK_50MHZ&#41;; <br />pwm_SetIRQ&#40;PWMIRQ_DISABLE&#41;; <br />pwmdx_DisablePin&#40;channel&#41;; <br />pwmdx_DisableINT&#40;channel&#41;; <br />pwmdx_ClearMultiFLAG&#40;0xffffffffL&#41;; <br />pwmdx_Unlock&#40;channel&#41;; <br />pwmdx_SetCountingMode&#40;channel, PWM_CONTINUE_MODE&#41;; <br />pwmdx_SetWaveform&#40;channel, PWM_WAVEFORM_NORMAL&#41;; <br />pwmdx_SetPulse&#40;channel, 20000L, 1500L&#41;; <br />pwmdx_EnablePin&#40;channel&#41;; <br /><br />pwmdx_EnablePWM&#40;channel&#41;; <br /></code></dd></dl><br /><br />In RoBoIO 1.61, it is necessary to call pwm_Initialize() for getting the PWM lib work. If you don't want to call pwm_Initialize(), then you should use the PWM primitive functions pwmdx_... for operating the PWM H/W; but using pwmdx_... functions is not a recommended approach (unless you understand the Vortex86DX's PWM module and the H/W design of RB-100 in detail).<br /><br /><img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1542">roboard</a> — Mon Nov 01, 2010 12:59 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Lost Tourist]]></name></author>
<updated>2010-11-01T11:51:51+01:00</updated>
<published>2010-11-01T11:51:51+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28615#p28615</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28615#p28615"/>
<title type="html"><![CDATA[Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28615#p28615"><![CDATA[
Roboard,<br /><br />Still no joy. I have experimented with the order of things, removed bits added bits all to no avail.<br /><br />AndrewMerill's code work's fine in it's place.<br /><br />My code is :-<br /><br />pwm_SetBaseAddress(0xfe00);<br />pwm_SetBaseClock(PWMCLOCK_50MHZ);<br />pwm_SetIRQ(PWMIRQ_DISABLE);<br />pwm_DisablePin(channel);<br />pwm_DisableINT(channel);<br />pwm_ClearMultiFLAG(0xffffffffL);<br />pwm_Unlock(channel);<br />pwm_SetCountingMode(channel, PWM_CONTINUE_MODE);<br />pwm_SetWaveform(channel, PWM_WAVEFORM_NORMAL);<br />pwm_SetPulse(channel, 20000L, 1500L);<br />pwm_EnablePin(channel);<br />pwm_EnableINT(channel);<br /><br />pwm_EnablePWM(channel);<br /><br />What am I doing wrong?<br /><br />Thanks<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2355">Lost Tourist</a> — Mon Nov 01, 2010 11:51 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[roboard]]></name></author>
<updated>2010-10-26T03:56:25+01:00</updated>
<published>2010-10-26T03:56:25+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28551#p28551</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28551#p28551"/>
<title type="html"><![CDATA[Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28551#p28551"><![CDATA[
<blockquote><div><cite>Lost Tourist wrote:</cite><br />1 - Set base address to 0xffff  <br />...<br /></div></blockquote><br /><br />Hi,<br /><br />you can't call pwm_SetBaseAddress(0xffff) to set 0xffff as the base address (0xffff is an invalid base address). Please call pwm_SetBaseAddress(0xfe00) instead; then your code should work normally.<br /><br /><img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1542">roboard</a> — Tue Oct 26, 2010 3:56 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Lost Tourist]]></name></author>
<updated>2010-10-23T08:57:19+01:00</updated>
<published>2010-10-23T08:57:19+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28531#p28531</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28531#p28531"/>
<title type="html"><![CDATA[Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28531#p28531"><![CDATA[
Thanks for the quick replies.<br /><br />Roboard I’m not sure what your instructions are, I have removed pwm_EnableINT() (as I’m not trying to do anything fancy) with no success.<br /> <br />Are you saying that I have locked the pwm channel first or that I should lock the channel first, regardless of which why is there only an unlocking function in pwm_initialize if locking is required here?<br /><br />As for the sync register are you saying it is used to start all pwm channels at once if required?<br /><br />As all I am trying to do it write a new pwm_initialize that sets the counting mode as continuous can you correct the following steps and set the correct order to setup the PWM for continuous operation. (These steps being the steps and sequence used in pwm_initialize)<br />1 - Set base address to 0xffff  <br />2 - Set the base clock using pwm_SetBaseClock(PWMCLOCK_50MHZ)<br />3 - Set interrupt mode with pwm_SetIRQ(PWMIRQ_DISABLE)<br />4 - Disable the pwm mode using pwm_DisablePin(channel) <br />5 - Disable the pwm interrupts using pwm_DisableINT(channel) <br />6 - Clear all PWM flags using pwm_ClearMultiFLAG(0xffffffffL)<br />7 - Set the counting mode using pwm_SetCountingMode(channel, PWM_CONTINUE_MODE)<br />8 - Set the waveform using pwm_SetWaveform (channel, PWM_WAVEFORM_NORMAL)<br />9 - Set the PWM pulse using pwm_SetPulse(channel, period, duty)<br />10 - Unlock the channel using pwm_Unlock(channel)<br />11 - Call pwm_EnablePWM(channel) to start the waveform<br />Because this does not seem to work.<br /><br />Andrewmerrill thanks for your code as it works fine, although I don’t like double setting things so I wouldn’t normally use pwm_initialize to set the counting mode, waveform and pulse and then set them again separately unless there was a clear reason but I can’t argue with your results  <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /> <br /><br />Thanks<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2355">Lost Tourist</a> — Sat Oct 23, 2010 8:57 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[andrewmerrill]]></name></author>
<updated>2010-10-23T00:13:31+01:00</updated>
<published>2010-10-23T00:13:31+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28525#p28525</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28525#p28525"/>
<title type="html"><![CDATA[PWM sample code]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28525#p28525"><![CDATA[
The following code seems to work for me for setting a continuous PWM signal, but I would appreciate feedback from others about how this could be improved.  <br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>int pin = 0;<br />int period = 1000;<br />int duty = 500;<br />pwm_Initialize&#40;0xFFFF, PWMCLOCK_50MHZ, PWMIRQ_DISABLE&#41;;<br />pwm_EnablePin&#40;pin&#41;;<br />pwm_EnablePWM&#40;pin&#41;;<br />pwm_SetWaveform&#40;pin, PWM_WAVEFORM_NORMAL&#41;;<br />pwm_SetCountingMode&#40;pin, PWM_CONTINUE_MODE&#41;;<br />pwm_SetPulse&#40;pin, period, duty&#41;;<br />// do stuff...<br />pwm_DisablePWM&#40;pin&#41;;<br />pwm_Close&#40;&#41;;<br /></code></dd></dl><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2390">andrewmerrill</a> — Sat Oct 23, 2010 12:13 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[roboard]]></name></author>
<updated>2010-10-22T07:21:22+01:00</updated>
<published>2010-10-22T07:21:22+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28518#p28518</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28518#p28518"/>
<title type="html"><![CDATA[Re: Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28518#p28518"><![CDATA[
Hi,<br /><br />you should call pwm_EnableINT() only if you are writing XP driver for PWM and are wanting to use interrupt control.<br /><br />PWM pulses would be sent out immediatly when pwm_EnablePWM() is called (except that you lock PWM channels first). <br /><br />Servo Sync Register can lock/unlock PWM pulse output of all channels at the same time, and is used to synchronize all PWM pulse output.<br /><br /><img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1542">roboard</a> — Fri Oct 22, 2010 7:21 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Lost Tourist]]></name></author>
<updated>2010-10-21T12:31:32+01:00</updated>
<published>2010-10-21T12:31:32+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28507#p28507</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28507#p28507"/>
<title type="html"><![CDATA[Continuous PWM]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=6655&amp;p=28507#p28507"><![CDATA[
I have been messing around with the RB100 using the standard rcservo commands and got them working fine however I am now trying to get a continuous PWM signal set up to run a standard servo in C++. (for now I am only setting a single channel)<br /><br />I have gone through all the training material, the rcservo.cpp, pwm.cpp and pwmdx.cpp files and looked through this forum for a basic run down of how to set it up, the best I can find is RN1AsOf091407's post on his Roboard experience.<br /><br />Please correct my understanding below.<br /><br />From the training files I know I should not simply override the pwm_SetCountingMode while using the rcservo functions to do the rest of the work (although this is sort of successful)<br /><br />So from looking in pwmdx.cpp I see that I should configure the South Bridge PWM Setting register and the PWM Control register although I'm not sure in which order or exactly how. <br /><br />For the South Bridge register i have <br /><br />pwm_SetBaseAddress(0xffff);// from rcservo_SetServo , i'm work out exactly what this is later<br />pwm_SetBaseClock(PWMCLOCK_50MHZ);// from rcservo_SetServo , i'm work out exactly what this is later<br />pwm_EnablePin(channel);// sets GPIO for PWM<br />pwm_EnableINT(channel);// sets interrupt mask<br />pwm_ClearMultiFLAG(0xffffffffL);// clears all interrupt flags<br />pwm_SetIRQ(PWMIRQ_DISABLE);// sets south bridge register<br />// pwm_SetIRQ doesn't accept PWMIRQ_ENABLE and I can't find the source<br /><br />For the PWM control register I have<br /><br />pwm_EnablePWM(channel);// enable single channel<br />pwm_SetCountingMode(channel, PWM_CONTINUE_MODE);// Set mode for channel to be continous<br />pwm_SetWaveform(channel, PWM_WAVEFORM_NORMAL);// Set waveform normal <br />pwm_SetPulse(channel, 20000L, 1500L);// set pulse 20mS period, 1.5mS duty<br /><br />I also have <br /><br />pwm_UnlockMulti(0xffffffffL);<br /><br />from RN1AsOf091407's post Which sets the servo sync register but i'm not sure what the sync register's purpose is.<br /><br /><br />I'm getting nothing showing on the CRO, I assume the PWM output will start after the PWM control register is set or when pwm_SetPulse is updated.<br /><br />The setup is simply XP pro on an RB100<br /><br />Any help would be appreciated<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2355">Lost Tourist</a> — Thu Oct 21, 2010 12:31 pm</p><hr />
]]></content>
</entry>
</feed>