<?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="https://forums.obdev.at/app.php/feed/topic/2348" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2010-07-12T11:36:07+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/2348</id>

		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2010-07-12T11:36:07+02:00</updated>

		<published>2010-07-12T11:36:07+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15149#p15149</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15149#p15149"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15149#p15149"><![CDATA[
Yes, INT0_vect is already there in the repository, it will be published with the next release.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Mon Jul 12, 2010 11:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iphi]]></name></author>
		<updated>2010-07-12T10:27:26+02:00</updated>

		<published>2010-07-12T10:27:26+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15148#p15148</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15148#p15148"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15148#p15148"><![CDATA[
Hi Christian,<br /><br />thanks for the hint! I think we are getting closer. I did a simple test.<br />I added the lines<br /><div class="codebox"><p>Code: </p><pre><code>#ifdef SIG_PIN_CHANGE<br />crash<br />#endif<br /></code></pre></div><br />to usbconfig.h and tried to compile. No error messages =&gt; SIG_PIN_CHANGE is undefined!<br />Replacing  SIG_PIN_CHANGE by SIG_INTERRUPT1 will cause a compiler crash as expected if SIG_INTERRUPT1 is defined.<br /><br />Where should SIG_PIN_CHANGE get defined and what should be its value?...<br /><br />P.S.<br /><br />... Ok, found and fixed it, hurray, it is working now! <br />Vectors are defined in &lt;avr/interrupt.h&gt;, see avrgcc manual.<br /><br />SIG_PIN_CHANGE should read SIG_PIN_CHANGE0 (old) or better PCINT0_vect  (new).<br />Also, I think in the usbconfig.h template SIG_INTERRUPT0 should be replaced by INT0_vect, as the former old name is not supported for all MCUs, e.g. not for Mega328P.<br /><br />Thanks for pointing me in the right direction, <br />Tom<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=292">iphi</a> — Mon Jul 12, 2010 10:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2010-07-12T10:01:14+02:00</updated>

		<published>2010-07-12T10:01:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15147#p15147</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15147#p15147"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15147#p15147"><![CDATA[
Have you verified the interrupt vector? If SIG_PIN_CHANGE is not defined, the interrupt handler will never be called and there's no compiler/linker warning or error. Please check main.elf with<br /><br />avr-objdump -d main.elf<br /><br />Then check the verctor address for pin change and see whether it contains the jump to your handler.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Mon Jul 12, 2010 10:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iphi]]></name></author>
		<updated>2010-07-11T20:34:30+02:00</updated>

		<published>2010-07-11T20:34:30+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15142#p15142</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15142#p15142"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15142#p15142"><![CDATA[
Hi Christian,<br /><br />I have read the data sheet and written some test code. This is what it takes to enable a PCINT0 on a Mega88:<br /><br /><div class="codebox"><p>Code: </p><pre><code>sei();<br />PCICR=PCICR | (1 &lt;&lt; PCIE0);<br />PCMSK0=PCMSK0 | (1 &lt;&lt; PCINT0);<br /></code></pre></div><br /><br />as compaared to enabling an INT0:<br /><br /><div class="codebox"><p>Code: </p><pre><code>sei();<br />EICRA=EICRA | ((1 &lt;&lt; ISC00) | (1 &lt;&lt; ISC01));   <br />EIMSK=EIMSK | (1 &lt;&lt; INT0);<br /></code></pre></div><br /><br />Still, V-USB doesn't run on PCINT0 on my Mega88 while my interrupt test code lets the interrupt happily trigger.<br />V-USB and INT0 or INT1 works fine.<br /><br />Here are my V-USB settings again:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#define USB_INTR_CFG            PCICR         <br />#define USB_INTR_CFG_SET        (1 &lt;&lt; PCIE0)     <br />//#define USB_INTR_CFG_CLR        0 <br />#define USB_INTR_ENABLE         PCMSK0        <br />#define USB_INTR_ENABLE_BIT     PCINT0        <br />#define USB_INTR_PENDING        PCIFR         <br />#define USB_INTR_PENDING_BIT    PCIF0         <br />#define USB_INTR_VECTOR         SIG_PIN_CHANGE  <br /></code></pre></div><br /><br />Please help.<br /><br />Thanks, Tom<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=292">iphi</a> — Sun Jul 11, 2010 8:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2010-07-09T17:35:48+02:00</updated>

		<published>2010-07-09T17:35:48+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15125#p15125</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15125#p15125"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15125#p15125"><![CDATA[
Yes, this means that the handler is never called. It seems that either the vector address is not correct (you can check this with a disassembler listing of the linked code) or the interrupt is not enabled. Don't know which steps are required to enable a PCINT, I would have to read the data sheet...<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Fri Jul 09, 2010 5:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iphi]]></name></author>
		<updated>2010-07-08T21:11:24+02:00</updated>

		<published>2010-07-08T21:11:24+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15115#p15115</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15115#p15115"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15115#p15115"><![CDATA[
Hi Christian,<br /><br />I have used the flooowing hook to check if the interrupt handler is called:<br /><br /><div class="codebox"><p>Code: </p><pre><code>#define USB_RX_USER_HOOK(data, len)  PORTC=~PORTC; </code></pre></div><br />Is this the correct way to check?<br /><br />I have an LED connected to PORTC. With INT1 I see it toggeling a couple of times when I plug in the device.<br />Using PCINT0 I see no action whatsoever. Does this mean the interrupt handler is never called?<br /><br />Where could I look to solve the problem?<br /><br />Thanks, Tom<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=292">iphi</a> — Thu Jul 08, 2010 9:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2010-07-08T18:53:06+02:00</updated>

		<published>2010-07-08T18:53:06+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15113#p15113</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15113#p15113"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15113#p15113"><![CDATA[
No, the driver works with all three, rising edge, falling edge and change triggered interrupt. You should verify whether the interrupt handler is actually called...<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Thu Jul 08, 2010 6:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[frank26080115]]></name></author>
		<updated>2010-07-08T18:24:51+02:00</updated>

		<published>2010-07-08T18:24:51+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15112#p15112</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15112#p15112"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15112#p15112"><![CDATA[
it looks like if you use external interrupts (as in INT0, INT1, etc), the interrupt is generated on a rising edge signal. Pin change interrupts occur regardless of rising or falling edge. This may be one problem.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=2426">frank26080115</a> — Thu Jul 08, 2010 6:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iphi]]></name></author>
		<updated>2010-07-08T12:24:14+02:00</updated>

		<published>2010-07-08T12:24:14+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15110#p15110</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15110#p15110"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15110#p15110"><![CDATA[
Hi Christian,<br /><br />thank you very much for your hint. I could get it working on INT1 instead of INT0 on a Mega88.<br />I am still having trouble using the PCINT0 instead.<br /><br />Here are my settings for PCINT0, which compile fine but refuse to work. <br />Can somebody point me to my error, please?<br /><br /><div class="codebox"><p>Code: </p><pre><code>                                     //commented values for INT1 work fine<br />#define USB_INTR_CFG            PCICR         //EICRA<br />#define USB_INTR_CFG_SET        (1 &lt;&lt; PCIE0)     //((1 &lt;&lt; ISC10) | (1 &lt;&lt; ISC11))    //00,01 for INT0<br />//#define USB_INTR_CFG_CLR        0 <br />#define USB_INTR_ENABLE         PCMSK0        //EIMSK <br />#define USB_INTR_ENABLE_BIT     PCINT0        //INT1<br />#define USB_INTR_PENDING        PCIFR         //EIFR <br />#define USB_INTR_PENDING_BIT    PCIF0         //INTF1 <br />#define USB_INTR_VECTOR         SIG_PIN_CHANGE  //SIG_INTERRUPT1 <br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=292">iphi</a> — Thu Jul 08, 2010 12:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[christian]]></name></author>
		<updated>2010-07-05T18:02:58+02:00</updated>

		<published>2010-07-05T18:02:58+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15045#p15045</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15045#p15045"/>
		<title type="html"><![CDATA[Re: PCINT instead of INT0?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2348&amp;p=15045#p15045"><![CDATA[
See <!-- l --><a class="postlink-local" href="http://forums.obdev.at/viewtopic.php?f=8&amp;t=1067">viewtopic.php?f=8&amp;t=1067</a><!-- l --><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=8">christian</a> — Mon Jul 05, 2010 6:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
