AUTOSAR ISR timer activation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AUTOSAR ISR timer activation

1,111 Views
yuriy_serdyuk
Contributor III

Hello,

I want activate periodic timer 1 sec, but i don't know how describe TimerHardware. Can you give me example. Board is MPC5748G

     TargetMCU = MPC5748G {
     
            TPTimer = TRUE {
                TimerHardware = STM0 {
                    Prescaler = OS {
                        Value = 0;
                    };
                    Freeze = TRUE;
                };
            };
...


...
    ISR ISR1
    {
        STACKSIZE = 512;
        PRIORITY = 5;
        CATEGORY = 2;
        IrqChannel = EXTERNAL {
            IrqNumber = 2;
        };
        TIMING_PROTECTION = TRUE {
            EXECUTIONTIME = 0;//2000000;
            TIMEFRAME = 0;
            MAXOSINTERRUPTLOCKTIME=0;
            MAXALLINTERRUPTLOCKTIME=0;
        };
    };
...

    APPLICATION TRUSTED_APP {
...
 ISR = ISR1;
        CORE = 0;
    };
Tags (2)
0 Kudos
3 Replies

947 Views
yuriy_serdyuk
Contributor III

I think should i use AUTOSAR MCAL GPT?

0 Kudos

947 Views
yuriy_serdyuk
Contributor III

i want configure PIT1 timer, it is IrqNumber = 227 interrupt according reference manual 

pastedImage_1.png

i configured ISR with  IrqNumber = 227, but i got error when i was compiling OIL file. 

pastedImage_2.png

     TargetMCU = MPC5748G {
     
            SysTimer = HWCOUNTER {
                COUNTER = SYSTEMTIMER;
                ISRPRIORITY = 2;   
                TimerHardware = eMIOS0{
                    Freeze = TRUE;
                    Channel = 0;
                    GlobalMIOSPrescaler = OS{
                        Value = 0;
                    };    
                    Prescaler = OS{
                        Value = 0;
                    };    
                };
            };     
     
            SecondTimer = SWCOUNTER {
                COUNTER = SECONDTIMER;
                ISRPRIORITY = 4;
                TimerHardware = PIT {
                    Channel = 1;
                    Freeze = TRUE;
                    TimerModuloValue = 30000;
                };
            };
....

    COUNTER SYSTEMTIMER {
        MAXALLOWEDVALUE = 0xFFFF;
        TICKSPERBASE = 10;
        MINCYCLE = 1;
        TYPE=HARDWARE
        {
           DRIVER = OSINTERNAL;
        };
    };
    
    COUNTER SECONDTIMER {   
        MAXALLOWEDVALUE = 30000;
        TICKSPERBASE = 10;
        MINCYCLE = 1;
        TYPE=SOFTWARE;
    };
....


    ISR ISR1
    {
        STACKSIZE = 512;
        PRIORITY = 5;
        CATEGORY = 2;
        IrqChannel = EXTERNAL {
            IrqNumber = 227;//PIT1
        };
    };

0 Kudos

947 Views
yuriy_serdyuk
Contributor III

Can you give me any example with ISR timer?

0 Kudos