**H*************************************************************************** * * $Archive:: $ * $Revision:: $ * $Date:: $ * $Author:: $ * * DESCRIPTION: * THIS IS THE MOST IMPORTANT FILE WHEN USING INTERRUPTS. This file maps * the interrupts to a varable. This allows for easy debugging because you * can set breakpoints at the interrupts definitions to determine which one * is being tripped. * GLOBALS * * PUBLIC FUNCTIONS: * * PRIVATE FUNCTIONS: * * USAGE/LIMITATIONS: * * NOTES: * * By: Patrick Cresap * *H**************************************************************************** **---- compilation control switches ----------------------------------------** ****************************************************************************** * INCLUDE FILES ****************************************************************************** **---- system and platform files -------------------------------------------** **---- program files -------------------------------------------------------** ****************************************************************************** * EXTERNAL REFERENCE ****************************************************************************** **---- data declarations ---------------------------------------------------** **---- function prototypes -------------------------------------------------** ****************************************************************************** * PUBLIC DECLARATIONS ****************************************************************************** **---- data declarations ---------------------------------------------------** ****************************************************************************** * PRIVATE DECLARATIONS ****************************************************************************** **---- context -------------------------------------------------------------** **---- data declarations ---------------------------------------------------** **---- function prototypes -------------------------------------------------** **---- macros --------------------------------------------------------------** .length 58 .mmregs ;all interrupts used in the program must be referenced .ref _c_int00 .ref _c_int19 ;timer interrupt reference (name matches the one in main program) .ref _c_int20 ;serial port interrupt reference .global _xboot ***************************************************************************** * INTERRUPT VECTORS * * Make sure that every interrupt is defined in the .sect "myvectors" * section. These are all the standard interrupts for the C54X. Also, you * need to referrence the ones that you use in your code in the .ref part. * * NOTE: There are 4 words per instructions per interrupt. * The B (branch) statements takes 2, while NOP are 1 each * Maps a name (on the left) to a interrupt (on the right). ***************************************************************************** .sect "myvectors" VECT_PMST: _reset: B _xboot NOP NOP _nmi: B _nmi NOP NOP _sint17: B _sint17 NOP NOP _sint18: B _sint18 NOP NOP _sint19: B _sint19 NOP NOP _sint20: B _sint20 NOP NOP _sint21: B _sint21 NOP NOP _sint22: B _sint22 NOP NOP _sint23: B _sint23 NOP NOP _sint24: B _sint24 NOP NOP _sint25: B _sint25 NOP NOP _sint26: B _sint26 NOP NOP _sint27: B _sint27 NOP NOP _sint28 B _sint28 NOP NOP _sint29 B _sint29 NOP NOP _sint30 B _sint30 NOP NOP _int0 B _int0 NOP NOP _int1 B _int1 NOP NOP _int2 B _int2 NOP NOP ;the commented section is for extended memory ; .if EXTENDED_MEMORY=1 ;_tint PSHM XPC ; nop ; FB _c_int19 ; timer interrupt ;_rint0 PSHM XPC ; nop ; FB _c_int20 ; serial port receive interrupt ; .else _tint B _c_int19 NOP NOP ; timer interrupt _rint0 B _c_int20 NOP NOP ; serial port receive interrupt ; .endif _xint0 B _xint0 NOP NOP _rint2 B _rint2 NOP NOP _xint2 B _xint2 NOP NOP _int3 B _int3 NOP NOP _hint B _hint NOP NOP _brint1 B _brint1 NOP NOP _bxint1 B _bxint1 NOP NOP .text ; this sets the PMST up, and makes sures that interrupts are disabled before ; resetting the chip _xboot: ; b $ for debug ld #0,dp stm #0,sp rsbx sxm ; Disable sign extension ssbx intm ; Disable interrupts stm #0,imr stm #0ffffh,ifr ; Clear ifr ld #VECT_PMST,a ; Set PMST for vectors or #0060h,a stlm a,pmst ; rpt #4 nop b _c_int00 .end