Cypress Semiconductor FX2LP Información técnica Pagina 107

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 460
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 106
Chapter 4. Interrupts Page 4-17
4.5.1 USB Autovector Coding
To employ autovectoring for the USB interrupt:
1. Insert a jump instruction at 0x0043 to a table of jump instructions to the various USB interrupt
service routines. Make sure the jump table starts on a 0x0100-byte page boundary.
2. Code the jump table with jump instructions to each individual USB interrupt service routine.
This table has two important requirements, arising from the format of the INT2VEC Byte (zero-
based, with the 2 LSBs set to 0):
It must begin on a page boundary (address 0xnn00)
The jump instructions must be four bytes apart.
3. The interrupt service routines can be placed anywhere in memory.
4. Write initialization code to enable the USB interrupt (INT2) and Autovectoring.
Figure 4-5. The USB Autovector Mechanism in Action
Figure 4-5 illustrates an ISR that services endpoint 2. When endpoint 2 requires service, the FX2
asserts the USB interrupt request, vectoring to location 0x0043.
The jump instruction at this location, which was originally coded as “LJMP 0400”, becomes “LJMP
042C” because the FX2 automatically inserts 2C, the INT2VEC value for EP2 (Table 4-13).
The FX2 jumps to 0x042C, where it executes the jump instruction to the EP2 ISR, arbitrarily
located for this example at address 0x0119.
Once the FX2 vectors to 0x0043, initiation of the endpoint-specific ISR takes only eight instruction
cycles.
EP2_ISR:
USB_Jmp_Table:
LJMP
04
2C
0x0043
0x0044
0x0045
2C
INT2VEC
Automatically
copied by FX2
LJMP EP2_ISR
01
19
0x042C
0x042D
0x042E
0x0400
0x0119
USB Interrupt
Vector
Vista de pagina 106
1 2 ... 102 103 104 105 106 107 108 109 110 111 112 ... 459 460

Comentarios a estos manuales

Sin comentarios