Making own ISR in S7G2

Hello,

Anyone worked with making own ISR or callback functions in S7G2 . I figure out callback functions are registered in bsp_group_irq but not sure how it works or maybe anyone have some reference for it.

Thanks

 

Parents
  • This reply was deleted.
  • Here is an example on how to write a user defined ISR in SSP 1.x.x. For version 1.2.0 and later read replies further down in this post...

    The example enables the GPT0 Capture Compare A Interrupt

    I've used a similar process for additional ADC interrupts, so I think what is written below is correct!

    BR, Richard

    Enable the interrupt in the ICU tab of the Synergy Configurator.

     

    Generate & Build the project.

     

    If you were to run the project, as part of SystemInit (), there is a function call to bsp_irq_cfg ();

     

    void SystemInit (void)

    /* Initialize ELC events that will be used to trigger NVIC interrupts. */

    bsp_irq_cfg();

     

    This populates the Interrupt Enable Select Registers in the ICU.

    This can be seen the IO Register ICU -> IELSR debug view

     

    We now have to write the ISR.

    In the source file, for example hal_entry.c, write the following:

    To enable the interrupt, the interrupt has to be enable in the NVIC.

    In source file, for example hal_entry.c, write the following:

     

    In the ISR it will most likely to clear the interrupt flags that have been set in the IELSR and potentially, the peripheral.

     

    In this example of the GPT, the code would be:

  • Thanks alot Richard Warner i will try and let you know if having some problems

  • Hi
    Newbie here. I am using Synergy with SK-S7G2. I have SSC configured with IAR Workbench. In SSC, my ICU Tab shows nadda!? I cannot see any of the #define's you show above...

    My ..\synergy_cfg\ssp_cfg\bsp\bsp_irg_cfg.h is empty? What am I doing wrong?

    Thanks

    Bill
  • Hi Bill,

    In SSP 1.2.0 the ICU tab will be empty. This is expected since all interrupts are configured in respective drivers. To enable an interrupt, go to driver's configuration settings and set the priority of the interrupt to an enabled level.

    Regards,
    adboc
  • Hi Bill,
    Yes, the method mentioned previously was for SSP1.1.3.
    SSP1.2 has a more efficient way of creating the vector table.
    I will try and find an example and post.
Reply Children
No Data