Ti C64x DSP interrupt vector table configuration (Hardware Interrupt)

Source: Internet
Author: User

1. Compile the interrupt service routine

Write the ISR function c_intxx in the. C source file for interrupt processing, such:

Interrupt void c_intxx (void)

{

...;

}

Note: For hardware interruptions, xx = 00 ~ 15.

2. initialize the interrupt vector table and configure the corresponding interrupt vector in the interrupt vector table in the memory segment.

First, locate the interrupt vector table to a memory segment. We can configure the memory ing of the interrupt vector table in the CMD file, for example:

Memory

{

Vectors: org = 00000000 H, Len = 00000400 H

L2sram: org = 00000400 H, Len = 00100000 H

SDRAM: org = 80000000 H, Len = 10000000 H

}

Sections

{

. VECs:> Vectors

. Data:> l2sram

. Text:> l2sram

. Switch:> l2sram

. STACK:> l2sram

. BSS:> l2sram

. Cinit:> l2sram

. Far:> l2sram

. CIO:> l2sram

. Const:> l2sram

. Sysmem:> SDRAM

. Tables:> l2sram

}

Create a. ASM file to configure the interrupt vector in the interrupt vector table. We need to declare some global variables so that other source files can reference these variables or other source file variables, such:

. Global _ Vectors

. Global _ c_int00

. Global _ vector1

. Global _ vector2

. Global _ vector3

. Global _ vector4

. Global _ vector5

. Global _ vector6

. Global _ vector7

. Global _ c_int08; Corresponding to the c_int08 interrupt service routine of the main () function (assuming edma interrupt is handled)

. Global _ vector9

. Global _ vector10

. Global _ vector11

. Global _ vector12

. Global _ vector13

. Global _ vector14

. Global _ vector15

Because the _ c_int00 interrupt of the RTS instance is referenced, that is, the reset interrupt, this symbol must be introduced:

. Ref _ c_int00

To insert the address of the interrupt service routine, that is, the interrupt vector, into the interrupt vector table, you can define a macro:

Vec_entry. Macro ADDR

STW B0, * -- B15

Mvkl ADDR, B0

Mvkh ADDR, B0

B B0

LDW * B15 ++, B0

NOP 2

NOP

NOP

. Endm

To initialize the interrupt vector in the interrupt vector table, you can define a virtual interrupt vector:

_ Vec_dummy:

B B3

NOP 5

Then you can configure the interrupt vector table:

. Sect ". VECs"

. Align 1024

_ Vectors:

_ Vector0: vec_entry _ c_int00; Reset interrupt

_ Vector1: vec_entry _ vec_dummy; NMI unshielded interrupt

_ Vector2: vec_entry _ vec_dummy; Retain interrupt 1

_ Vector3: vec_entry _ vec_dummy; Reserved interrupt 2

_Vector4: vec_entry _ vec_dummy;External Interrupt int4

_ Vector5: vec_entry _ vec_dummy;External Interrupt int5

_Vector6: vec_entry _ vec_dummy; External Interrupt int6

_ Vector7: vec_entry _ vec_dummy;External Interrupt int7

_ Vector8: vec_entry _ c_int08;Edma controller interrupts edmaint, corresponding to c_int08 ISR

_ Vector9: vec_entry _ vec_dummy;Jtagrtdx interrupted

_ Vector10: vec_entry _ vec_dummy;Emif_sdram_timer interrupted

_ Vector11: vec_entry _ vec_dummy;Mcbsp_0_receive interrupted

_ Vector12: vec_entry _ vec_dummy;Mcbsp_internal transmit interrupt

_ Vector13: vec_entry _ vec_dummy;Host_port_host_to_dsp interrupted

_ Vector14: vec_entry _ vec_dummy;Timer0 interrupt

_ Vector15: vec_entry _ vec_dummy;Timer1 interrupted

3. Specify the defined interrupt vector table in the C program and enable the CPU interrupt function.

In the C program, it is convenient to use the csl irq module to set the interrupt. Before setting the interrupt vector table symbol, the ASM Program on the external link is required:

Extern far void vectors ();//It is vectors because the C compiler automatically changes it to _ vectors after compilation.

After the interrupt vector table is referenced, you can set the interrupt:

Irq_setvecs (vectors );//Point to the interrupt vector table defined in ASM

Irq_nmienable ();

Irq_globalenable ();

Irq_map (irq_evt_edmaint, 8 );// Map the event to the specified physical interrupt number

Irq_reset (irq_evt_edmaint );

4. Start the interrupt source, such as edma controller interruption.

Now, the interruption service routine c_int8 can interrupt the service for edmaint. The configuration of other hardware interrupt vectors is the same.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.