<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>measuring pulse width</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/42680/measuring-pulse-width</link><description> how do i measure a pulse width using the pca in high-speed output mode? 
 
not quite sure what registers i need to read when the interrupt is triggered. 
 
i am using a 8051f023 chip. </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: measuring pulse width</title><link>https://community.arm.com/thread/73587?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2005 04:16:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f07c7bdf-55af-4ac0-81a6-5c7a3998ff29</guid><dc:creator>andre steenkamp</dc:creator><description>&lt;p&gt;i have that pdf and i understand that i need to capture the rising and falling edge.&lt;br /&gt;
&lt;br /&gt;
but i dont understand the value of what registers i need to capture.&lt;br /&gt;
&lt;br /&gt;
i have an example program of a 16-bit pwm going and while debugging, it goes into the isr on the rising and falling edge, but i dont know what register value to capture.&lt;br /&gt;
&lt;br /&gt;
the configurations code is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
PCA0MD = 0x02; 	// disable CF interrupt
					// PCA time base = SYSCLK / 4

	PCA0CPL0 = (0xff &amp;amp; PWM); 		// initialize PCA compare value
	PCA0CPH0 = (0xff &amp;amp; (PWM &amp;gt;&amp;gt; 8));
	PCA0CPM0 = 0x4d; 				// CCM0 in High Speed output mode
	EIE1 |= 0x08; 					// enable PCA interrupt
	EA = 1; 						// Enable global interrupts
	PCA0CN = 0x40; 					// enable PCA counter
&lt;/pre&gt;
&lt;br /&gt;
the isr code is as follows :&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
void PCA_ISR (void) interrupt 9
{
	if (CCF0) {
		CCF0 = 0; // clear compare indicator
		if (PWM_OUT) { // process rising edge
			PCA0CPL0 = (0xff &amp;amp; PWM); // set next match to PWM
			PCA0CPH0 = (0xff &amp;amp; (PWM &amp;gt;&amp;gt; 8));
		} else { // process falling edge
			PCA0CPL0 = 0; // set next match to zero
			PCA0CPH0 = 0;
		}
	} else if (CCF1) { // handle other PCA interrupt
		CCF1 = 0; // sources
	} else if (CCF2) {
		CCF2 = 0;
	} else if (CCF3) {
		CCF3 = 0;
	} else if (CCF4) {
		CCF4 = 0;
	} else if (CF) {
		CF = 0;
	}
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: measuring pulse width</title><link>https://community.arm.com/thread/44926?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2005 03:59:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6238909b-6681-4889-92b1-a29ebe5a79e6</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;how do I ... using the PCA&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
look at &amp;quot;The PCA cookbook&amp;quot; from Intel:&lt;br /&gt;
&lt;a href="http://www.intel.com/design/mcs51/applnots/270609.htm" target="_blank"&gt;http://www.intel.com/design/mcs51/applnots/270609.htm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>