[J-core] Is there a way to have periodic interrupts on the Numato board?

Joh-Tob Schäg johtobsch at gmail.com
Fri Oct 11 19:43:31 EDT 2019


Mhh it looks like i forgot a branch in my email.

If there is a periodic interrupt timer how do i start him?

My current approach looks like this:


#include "board.h" // comes with jcore-source-latest from the website

int main(int argc, char* argv[]){
uint32_t SR_Proto = 5<<4;
asm("LDC %0, SR;"
    :
    : "r" (SR_Proto)
    ); // set minimum interrupt level to 5

(DEVICE_AIC0)->pit_throttle = 0x0FFFFFFF;
                       //count   pit_en  prio    Inter  count
(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

do_something();
return 0;
};

This interrupt trigger only once. Not every x ms. (I have not looked into
how x is calculated from throttle)




On Sat, 12 Oct 2019 at 01:17, D. Jeff Dionne <Jeff at se-instruments.com>
wrote:

> On Oct 11, 2019, at 18:35, Joh-Tob Schäg <johtobsch at gmail.com> wrote:
> >
> > Hello,
> >
> > I am curious whether periodic interrupts are possible with the "lastest"
> (and very old) release of the Numato image?
>
> yes, there is a PIT built in.  Linux uses it.
>
> > If not how could i implement one?
> > I also fail to grasp the meaning of count when count_enabled.
>
> the implementation is basic, it’s designed to provide Linux what it
> needs...
> >
> > 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.
>
> 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.
>
> 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...
>
> J
>
> >
> >
> > Thanks,
> > Johann-Tobias
> > _______________________________________________
> > J-core mailing list
> > J-core at lists.j-core.org
> > http://lists.j-core.org/mailman/listinfo/j-core
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.j-core.org/pipermail/j-core/attachments/20191012/9764bac3/attachment.html>


More information about the J-core mailing list