Loading ...
Sorry, an error occurred while loading the content.

Re: Interrupts on the 9s12c32

Expand Messages
  • zsilinszkyz
    Which version of embeddedGNU do you have? From ver. 0.91 there s an example project called Blink_using_RTI , showing exactly what you need. Zoltan
    Message 1 of 4 , Mar 1, 2005
    • 0 Attachment
      Which version of embeddedGNU do you have? From ver. 0.91 there's an
      example project called 'Blink_using_RTI', showing exactly what you need.

      Zoltan

      --- In gnu-m68hc11@yahoogroups.com, "rhouri" <pic.rhouri@c...> wrote:
      >
      > I have a 9s12c32 module from Tech Arts and i am trying to use
      > interrupts.
      > I am using the embeddedGNU IDE , but can't find any example on how
      > to set up interrupts. I know how to declare the ISR in C but how do
      > you link that to the interrupts vector table (vectors.s) .
      >
      > Help greatly appreciated !
    • Mark Butcher
      Hi I don t know about start.s but start.c it goes like this (eg from MC9S12NE64 so some more or less interrupts - check the dtata sheet for your interrupt
      Message 2 of 4 , Mar 2, 2005
      • 0 Attachment
        Hi

        I don't know about start.s but start.c it goes like this (eg from
        MC9S12NE64 so some more or less interrupts - check the dtata sheet
        for your interrupt vectors):

        Although you probably already know - it starts with a routine in
        another C-file (in this case to handle real time tick)

        --defsym,vectors_addr=0xff80 in the GNU compiler call defines where
        the vectors are in memory.

        In memory.x the area is also define (eg.):
        MEMORY
        {
        page0 (rwx) : ORIGIN = 0x0, LENGTH = 0x4000
        data : ORIGIN = 0x3000, LENGTH = 0x2000
        text (rx) : ORIGIN = 0x4000, LENGTH = 0x4000
        text_h (rx) : ORIGIN = 0xc000, LENGTH = 0x4000 - 0x880
        page1 (rwx) : ORIGIN = 0xff80, LENGTH = 256
        }

        Regards

        Mark Butcher

        www.mjbc.ch


        **************************************************************
        void RealTimeInterrupt(void) __attribute__((interrupt)); // ensure
        this is compiled as interrupt

        void RealTimeInterrupt(void)
        {
        CRGFLG = RTIF; /* Reset interrupt
        request flag */
        // user routine - RtmkSystemTick(); /*
        operating system tick */
        }

        **************************************************************

        Here is the content of start.c:

        extern void Cpu_Interrupt(void) __attribute__((interrupt));
        extern void emac_ec_isr(void) __attribute__((interrupt));
        extern void emac_lc_isr(void) __attribute__((interrupt));
        extern void emac_b_rx_error_isr(void) __attribute__((interrupt));
        extern void emac_rx_b_b_o_isr(void) __attribute__((interrupt));
        extern void emac_rx_b_a_o_isr(void) __attribute__((interrupt));
        extern void emac_rx_error_isr(void) __attribute__((interrupt));
        extern void emac_mii_mtc_isr(void) __attribute__((interrupt));
        extern void emac_rx_fc_isr(void) __attribute__((interrupt));
        extern void emac_f_tx_c_isr(void) __attribute__((interrupt));
        extern void emac_rx_b_b_c_isr(void) __attribute__((interrupt));
        extern void emac_rx_b_a_c_isr(void) __attribute__((interrupt));
        extern void ephy_isr(void) __attribute__((interrupt));
        extern void PortHInterrupt(void) __attribute__((interrupt));


        extern __interrupt void _start(void);
        extern void RealTimeInterrupt(void) __attribute__((interrupt));
        extern void SCI1_Interrupt(void) __attribute__((interrupt));




        // This is the interrupt vector table for the processor including
        the reset vector (entrypoint)
        // It must be at the defined address
        typedef void (*near tIsrFunc)(void);

        const tIsrFunc __attribute__((section(".vectors"))) _vect[] =
        { /* Interrupt table */
        Cpu_Interrupt, /* 0 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 1 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 2 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 3 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 4 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 5 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 6 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 7 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 8 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 9 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 10 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 11 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 12 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 13 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 14 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 15 Default (unused)
        interrupt */
        emac_ec_isr,
        emac_lc_isr,
        emac_b_rx_error_isr,
        emac_rx_b_b_o_isr,
        emac_rx_b_a_o_isr,
        emac_rx_error_isr,
        emac_mii_mtc_isr,
        emac_rx_fc_isr,
        emac_f_tx_c_isr,
        emac_rx_b_b_c_isr,
        emac_rx_b_a_c_isr,
        ephy_isr, /* 27 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 28 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 29 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 30 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 31 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 32 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 33 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 34 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 35 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 36 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 37 Default (unused)
        interrupt */
        PortHInterrupt, /* 38 */
        Cpu_Interrupt, /* 39 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 40 Default (unused)
        interrupt */
        Cpu_Interrupt, /* 41 Default (unused)
        interrupt */
        SCI1_Interrupt, /* 42 Default (unused)
        interrupt 0xffd4 SCI1 */
        Cpu_Interrupt, /* 43 Default (unused)
        interrupt 0xffd6 SCI0 */
        Cpu_Interrupt, /* 44 Default (unused)
        interrupt 0xffd8 SPI */
        Cpu_Interrupt, /* 45 Default (unused)
        interrupt 0xffda PULSE ACC INPUT EDGE */
        Cpu_Interrupt, /* 46 Default (unused)
        interrupt 0xffdc PULSE OVERFLOW */
        Cpu_Interrupt, /* 47 Default (unused)
        interrupt 0xffde TIM OVERFLOW */
        Cpu_Interrupt, /* 48 Default (unused)
        interrupt 0xffe0 TIM 7 */
        Cpu_Interrupt, /* 49 Default (unused)
        interrupt 0xffe2 TIM 6 */
        Cpu_Interrupt, /* 50 Default (unused)
        interrupt 0xffe4 TIM 5 */
        Cpu_Interrupt, /* 51 Default (unused)
        interrupt 0xffe6 TIM 4 */
        Cpu_Interrupt, /* 52 Default (unused)
        interrupt 0xffe8 - Res. */
        Cpu_Interrupt, /* 53 Default (unused)
        interrupt 0xffea - Res. */
        Cpu_Interrupt, /* 54 Default (unused)
        interrupt 0xffec - Res. */
        Cpu_Interrupt, /* 55 Default (unused)
        interrupt 0xffee - Res. */
        RealTimeInterrupt, /* 56 Default (unused)
        interrupt 0xfff0 RTI */
        Cpu_Interrupt, /* 57 Default (unused)
        interrupt 0xfff2 IRQ */
        Cpu_Interrupt, /* 58 Default (unused)
        interrupt 0xfff4 XIRQ */
        Cpu_Interrupt, /* 59 Default (unused)
        interrupt 0xfff6 SWI or BDM */
        Cpu_Interrupt, /* 60 Default (unused)
        interrupt 0xfff8 TRAP (unimplementaed op code) */
        Cpu_Interrupt, /* 61 Default (unused)
        interrupt 0xfffa COP reset */
        Cpu_Interrupt, /* 62 Default (unused)
        interrupt 0xfffc CRYSTAL MONITOR */
        _start /* Reset vector 0xfffe
        (0xf7fe with debugger) */
        };







        --- In gnu-m68hc11@yahoogroups.com, "rhouri" <pic.rhouri@c...> wrote:
        >
        > I have a 9s12c32 module from Tech Arts and i am trying to use
        > interrupts.
        > I am using the embeddedGNU IDE , but can't find any example on how
        > to set up interrupts. I know how to declare the ISR in C but how
        do
        > you link that to the interrupts vector table (vectors.s) .
        >
        > Help greatly appreciated !
      Your message has been successfully submitted and would be delivered to recipients shortly.