2003-11-06 07:38 PM
2003-11-05 08:53 PM
HI everyone !!
i'm using the st72264 chip with the metrowerks compiler and i did not manage to associate my interrupt routine to the ISR vector. i found an example that uses the ISR vector : void (* const _vectab[]) () = { NULL, NULL, NULL, SCI_Interrupt, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, PORTS_1_Interrupt, PORTS_0_Interrupt, NULL, NULL, }; but i keep getting a compilation error : 'implicit cast in assignment' what is wrong ? can anyone help me ? can someone give an example how it should be done ? (in 'c' please) thanks. adi.2003-11-06 01:44 AM
The examples you give is for the cosmic compiler, for metroweks you need to modify the prm file for the project.
Look up the VECTOR keyword in the linker docs. Regards sjo2003-11-06 03:06 AM
Here is an example of a F264 PRM file:
*************************** NAMES END SECTIONS MY_RAM = READ_WRITE 0x0080 TO 0x00FF; MY_ROM = READ_ONLY 0xE000 TO 0xFFDF; PLACEMENT DEFAULT_ROM, ROM_VAR, STRINGS INTO MY_ROM; _ZEROPAGE, _OVERLAP, DEFAULT_RAM INTO MY_RAM; END STACKTOP 0x17F VECTOR ADDRESS 0xFFFE _Startup *************************** regards, Piero2003-11-06 04:02 AM
thanks for the feed back,
the PRM file is as piero's example but i still need your help as for how to assign the functions, i must admit it's my first project using the ST. thanks again. adi.2003-11-06 07:38 PM
One example I have. May be it helps you...
/* ************ LINKER OUTPUT FILE *******************************************/ LINK int.abs /************ PROJECT MODULE LIST ********************************************/ NAMES main.o END /* STACK INITIALIZATION *****************************************************/ STACKTOP 0x01FF /* MEMORY LOCATION SETTING ***************************************************/ SECTIONS ZRAM = READ_WRITE 0x0080 TO 0x00FF; RAM = READ_WRITE 0x0100 TO 0x027F; ROM = READ_ONLY 0x1000 TO 0xFFDF; PLACEMENT PORTA INTO NO_INIT 0x0000 TO 0x0002; PORTB INTO NO_INIT 0x0003 TO 0x0005; PORTC INTO NO_INIT 0x0006 TO 0x0008; PORTD INTO NO_INIT 0x0009 TO 0x000B; PORTE INTO NO_INIT 0x000C TO 0x000E; PORTF INTO NO_INIT 0x000F TO 0x0011; SPI INTO NO_INIT 0x0021 TO 0x0023; FLASH INTO NO_INIT 0x0024 TO 0x0024; ITC INTO NO_INIT 0x0025 TO 0x002A; AWU INTO NO_INIT 0x002B TO 0x002C; CKCTRL INTO NO_INIT 0x002D TO 0x002E; WDG INTO NO_INIT 0x002F TO 0x0030; PWMART INTO NO_INIT 0x0031 TO 0x003B; TIMER8 INTO NO_INIT 0x003C TO 0x0044; ADC INTO NO_INIT 0x0045 TO 0x0047; SCI1 INTO NO_INIT 0x0048 TO 0x004F; TIMER16 INTO NO_INIT 0x0051 TO 0x005F; SCI2 INTO NO_INIT 0x0060 TO 0x0067; CAN INTO NO_INIT 0x0068 TO 0x006F; /*************** PAGES PLACEMENT *******************/ DEFAULT_ROM,ROM_VAR,STRINGS INTO ROM; DEFAULT_RAM INTO RAM; _ZEROPAGE,_OVERLAP INTO ZRAM; /**************************************************/ END PRESTART OFF /* INTERRUPT VECTOR SETTING : ADDRESS <-> ROUTINE *********/ VECTOR ADDRESS 0xFFFE _Startup VECTOR ADDRESS 0xFFFC TRAP VECTOR ADDRESS 0xFFF8 MCC_IT_Routine VECTOR ADDRESS 0xFFF6 EI0_IT_Routine VECTOR ADDRESS 0xFFF4 EI1_IT_Routine VECTOR ADDRESS 0xFFF2 EI2_IT_Routine VECTOR ADDRESS 0xFFF0 EI3_IT_Routine VECTOR ADDRESS 0xFFEA SPI_IT_Routine VECTOR ADDRESS 0xFFE8 TIMER8_IT_Routine VECTOR ADDRESS 0xFFE6 TIMER16_IT_Routine VECTOR ADDRESS 0xFFE4 SCI2_IT_Routine VECTOR ADDRESS 0xFFE2 SCI1_IT_Routine VECTOR ADDRESS 0xFFE0 PWMART_IT_Routine