<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">Mhh it looks like i forgot a branch in my email.</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">If there is a periodic interrupt timer how do i start him?</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">My current approach looks like this:</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">#include "board.h" // comes with jcore-source-latest from the website</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">int main(int argc, char* argv[]){</div><div class="gmail_default" style="font-family:monospace,monospace">uint32_t SR_Proto = 5<<4; <br>asm("LDC %0, SR;"<br>    : <br>    : "r" (SR_Proto)<br>    ); // set minimum interrupt level to 5<br><br>(DEVICE_AIC0)->pit_throttle = 0x0FFFFFFF; <br>                       //count   pit_en  prio    Inter  count   <br>(DEVICE_AIC0)->ctrl0 = ((0<<25)+(1<<26)+(6<<20)+(128<<12)+0); // enable  interrupt of level 6 which hits the 129th function in the interrupt table</div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">do_something();</div><div class="gmail_default" style="font-family:monospace,monospace">return 0;<br></div><div class="gmail_default" style="font-family:monospace,monospace">};<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace">This interrupt trigger only once. Not every x ms. (I have not looked into how x is calculated from throttle)<br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div><div class="gmail_default" style="font-family:monospace,monospace"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 12 Oct 2019 at 01:17, D. Jeff Dionne <<a href="mailto:Jeff@se-instruments.com">Jeff@se-instruments.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Oct 11, 2019, at 18:35, Joh-Tob Schäg <<a href="mailto:johtobsch@gmail.com" target="_blank">johtobsch@gmail.com</a>> wrote:<br>
> <br>
> Hello,<br>
> <br>
> I am curious whether periodic interrupts are possible with the "lastest" (and very old) release of the Numato image?<br>
<br>
yes, there is a PIT built in.  Linux uses it.<br>
<br>
> If not how could i implement one?<br>
> I also fail to grasp the meaning of count when count_enabled.<br>
<br>
the implementation is basic, it’s designed to provide Linux what it needs...<br>
> <br>
> I already found out that interrupts are queued if the processor has a higher priority than the interrupt and the interrupt is triggered if the level is decreased enough.<br>
<br>
J2 implements prioritised exception processing.  The interrupt level in stored in SR, and basically managed by the processor logic itself.  The operation follows the SH2 specification, but not any specific interrupt controller.<br>
<br>
The lack of lack of a standard J-Core interrupt controller is a bit of a problem... we’ll make sure it’s a priority to at least document the versions that are in use...<br>
<br>
J<br>
<br>
> <br>
> <br>
> Thanks,<br>
> Johann-Tobias<br>
> _______________________________________________<br>
> J-core mailing list<br>
> <a href="mailto:J-core@lists.j-core.org" target="_blank">J-core@lists.j-core.org</a><br>
> <a href="http://lists.j-core.org/mailman/listinfo/j-core" rel="noreferrer" target="_blank">http://lists.j-core.org/mailman/listinfo/j-core</a><br>
<br>
</blockquote></div>