AnsweredAssumed Answered

Low Level Interrupt Control Problem

Question asked by yilmaz.orhan on Nov 4, 2014
Latest reply on Aug 10, 2017 by Hank Im
Hello,
I'm trying register base interrupt control. But not working.(problem *.s files)
I do not want to use to OSAL library.
Not starting interrupt.
Example Code:
//Orhan YILMAZ
//Timer Example
typedef enum{
    FALSE,
    TRUE
}BOOL;
 
void StartupInit(void);
 
void Port_conig(void);
 
void WDT_disable(void);
 
void PIT0_Init(unsigned int TimeOut);
 
void PIT0_Start(void);
 
//void PIT_0_Handler(void);
 
void Interrup_Enable(void);
 
#include "components.h"
#include "xpc560b.h"
/*
 * Application entry point.
 */
 
unsigned long i = 0;
 
int main(void) {
 
    componentsInit();
    //CLK Init.
    StartupInit();
 
    //WDT Disable
    WDT_disable();
    //Port
    Port_conig();
    //Timer
    PIT0_Init(0xFFFFF);
 
    //IRQ Config
    Interrup_Enable();
 
    PIT0_Start();
 
      while (TRUE) {
          if(i == 0xFFFFFF)
          {
              //SIU.GPDO[90].B.PDO ^= 1;
              i = 0;
          }
          i++;
      }
}
 
 
//PORT CONFIGURATION
void Port_conig(void)
{
    //Working Led
    SIU.PCR[90].B.OBE = 1;
    SIU.GPDO[90].B.PDO = 0;//Output Low
 
}
 
//PIT0 Initial Function
void PIT0_Init(unsigned int TimeOut)
{

    PIT.PITMCR.R = 0x000000001;//Enable PIT and Configure to stop in debug mode
    PIT.CH[0].LDVAL.R = TimeOut;//Timeout enter
    //Tclk = SystemCLK
 
    INTC_PSR(PIT0_VECTOR)=5;
    //PIT_0_Handler, 59, 5;
    IRQ_HANDLER(PIT_0_Handler);
}
 
//PIT0 Start Function
void PIT0_Start(void)
{
    //TIE = 1 Timer Interrup Enable
    //TEN = 1 Timer Enable
    PIT.CH[0].TCTRL.R = 3;
}
 
void WDT_disable(void)
{
    //Watchdog Timer Disable
    SWT.SR.R = 0x0000c520; /* Write keys to clear soft lock bit */
    SWT.SR.R = 0x0000d928;
    SWT.CR.R = 0x8000010A; /* Clear watchdog enable (WEN) */
}
/*************************
 *CLK CONFIGURATION
 *************************/
void StartupInit(void)
{
     *
*
*
*
*
*
*
*
    //Check Configurations
    while(ME.GS.B.MTRANS);//Global Status Register wait for mode transition to complete
 
    while(ME.GS.B.CURRENTMODE != 4);//Global Status Register verify RUN0 Current mode
}
 
//*********IRQ***********//
void Interrup_Enable(void)
{
    INTC.CPR.B.PRI = 0; // Lower INTC's current priority
    asm("wrteei 1");    //Enable external interrupt    ================>>> PROBLEM THIS LINE
}
 
void PIT_0_Handler(void)
{
    PIT.CH[0].TFLG.B.TIF = 1;
    SIU.GPDO[90].B.PDO ^= 1;
}

Note: ivor.s and vector.s copy my project folder.

Thanks.
Best Regards,
Orhan YILMAZ

Outcomes