I received complaints about vectors for ISR's so I though I would post some 
more fun stuff

this is my cli (per command line) I purposefully didn't NOT want CRT0 in there 
(yet it was forced in later oh well one thing at a time).


--------------------------------------

msp430-gcc.exe -nocrt0 -save-temps -mmcu=msp430F5172 -Wa,-alnhs=f.s
-fdata-sections -ffunction-sections   -Iheaders  -c source\isr.c -o
obj\Debug\source\isr.o
--------------------------------------


When I used this code
--------------------------------------
#define    T0_A0_VEC    (TIMER0_A0_VECTOR - 32)
//  2 keys (emulated) int3 and int5 (I think)
//     timer 0 CCR0 is used for 1 second timing
#pragma    vector=TIMER0_A0_VECTOR
//#pragma    vector=T0_A0_VEC
__interrupt void    timer_a0_0_isr(void)
{
    // delay for 10ms
    TA0CCR0 += CLK32K;
    // set the second flag
    sec_flag = true;
    // maintenance numbers
    ++runtime;
#ifdef    PUMP_OPERATION_TIME_
    // these counters automatically update
    // if the output is on
    // if  ZERO GAS ON
    if(ZERO)
    {    // increment pump 1 on time
        ++pump1_time;
    }
    // if CAL GAS 1 ON
    if(CALGAS1)
    {    // increment pump 2 on time
        ++pump2_time;
    }
    // if CAL GAS 2 ON
    if(CALGAS2)
    {    // increment pump 3 on time
        ++pump3_time;
    }
#endif  //PUMP_OPERATION_TIME
}

#define    T0_A1_VEC    (TIMER0_A1_VECTOR - 32)

// timer 0 CCR 1 etc are used for 10ms tick .. ?
#pragma    vector=TIMER0_A1_VECTOR
//#pragma    vector=T0_A1_VEC
__interrupt   void timer_a0_1_isr(void)
{
    switch(TA0IV)
   {
   case 2:    // A0 CCR1
        // repeat in 10ms
        TA0CCR1 += (CLK32K/100);
        // set flag to indicate trip
        msec_flag = true;
        break;
    case 4:    // A0 CCR2
        break;
    case 10:    // TAR overflow
        break;
    }
}

#define    USCI_A0_VEC    (USCI_A0_VECTOR -32)

#pragma    vector=USCI_A0_VECTOR
//#pragma    vector=USCI_A0_VEC
__interrupt    void serial_port_isr(void)
{
    // if we have a receive interrupt
    if(UCA0IFG & UCRXIFG)
    {
        // clear the flag
        UCA0IFG &= ~UCRXIFG;
        // read data from the serial port
        // add the data to the receive buffer
        serial_buffer_insert(&serial_port_1_in, UCA0RXBUF);
    }
    // if we have a transmit interrupt
    if(UCA0IFG & UCTXIFG)
    {
        // clear the flag
        UCA0IFG &= ~UCTXIFG;
        // if we have data to transmit
        if(serial_port_1_out.size)
        {   // read data from the buffer and transmit it
            UCA0TXBUF = serial_buffer_remove(&serial_port_1_out);
        }
    }
}
--------------------------------------
I received this complaint
--------------------------------------
source\isr.c: In function 'timer_a0_0_isr':
source\isr.c:662:37: error: interrupt vector 52 is beyond end of MCU
vector table
--------------------------------------

So I looked at my map file
--------------------------------------
Memory Configuration

Name             Origin             Length             Attributes
sfr              0x00000000         0x00000010
peripheral_8bit  0x00000010         0x000000f0
peripheral_16bit 0x00000100         0x00000100
bsl              0x00001000         0x00000800
infomem          0x00001800         0x00000200
infod            0x00001800         0x00000080
infoc            0x00001880         0x00000080
infob            0x00001900         0x00000080
infoa            0x00001980         0x00000080
ram              0x00001c00         0x00000800         xw
rom              0x00008000         0x00007f80         xr
vectors          0x0000ff80         0x00000080
ram2              0x00000000         0x00000000         xw
ram_mirror        0x00000000         0x00000000         xw
usbram            0x00000000         0x00000000         xw
far_rom          0x00000000         0x00000000
*default*        0x00000000         0xffffffff

.vectors         0x0000ff80         0x20
                 0x0000ff80                
PROVIDE (__vectors_start, .)       *(.vectors*)
.vectors          0x0000ff80       0x20
c:/msp430gcc/bin/../lib/gcc/msp430/4.6.3/crt0ivtbl16.o
                0x0000ff80                __ivtbl_16
                0x0000ffa0                _vectors_end = .

------------------------------------
So the .vectors seemed too me to be quite strange (16) and not span the right 
area. Could that be what the compilor was complaining about? Also I noticed 
that crt0 was STILL included for some reason. It's probably because I need to 
use the -nocrt0 option with the linker not with the normal compile stage (duh?)

Ideas and or suggestions for putting the ISR's in the correct vector location 
quite welcome :D

Stephen

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to