Part Number: TMS320F28075 Tool/software: TI-RTOS Please I need help, System timer seem not running at all, Idle task and other SCI interrupt are running good, I also add cpu timer in the .cfg and still not working. something else is missing and I do not know where. var Task = xdc.useModule('ti. sysbios .knl.Task'); var Hwi = xdc.useModule('ti. sysbios .family.c28.Hwi'); var Idle = xdc.useModule('ti. sysbios .knl.Idle'); var GIO = xdc.useModule('ti. sysbios .io.GIO'); var System = xdc.useModule('xdc.runtime.System'); var SysStd = xdc.useModule('xdc.runtime.SysStd'); var Boot = xdc.useModule('ti.catalog.c2800.initF2837x.Boot'); var Timestamp = xdc.useModule('xdc.runtime.Timestamp'); var Clock = xdc.useModule('ti. sysbios .knl.Clock'); var Timer = xdc.useModule('ti. sysbios .hal.Timer'); var ti_ sysbios _family_c28_Timer = xdc.useModule('ti. sysbios .family.c28.Timer'); Boot.bootFromFlash = true; Boot.configureFlashController = false; //var Boot = xdc.useModule('ti.catalog.c2800.initF2837x.Boot'); System.SupportProxy = SysStd; System.SupportProxy = SysMin; /* not really necessary since SysMin is the default */ SysMin.bufSize = 0x1000; SysMin.flushAtExit = true; System.maxAtexitHandlers = 4; BIOS.heapSize = 0x800; BIOS.libType = BIOS.LibType_Custom; /* System stack size (used by ISRs and Swis) */ Program.stack = 512; /* Circular buffer size for System_printf() */ SysMin.bufSize = 0x200; /* * Create and install logger for the whole system */ //var loggerBufParams = new LoggerBuf.Params(); //loggerBufParams.numEntries = 32; //var logger0 = LoggerBuf.create(loggerBufParams); //Defaults.common$.logger = logger0; //Main.common$.diags_INFO = Diags.ALWAYS_ON; System.SupportProxy = SysMin; //BIOS.logsEnabled = true; //BIOS.assertsEnabled = true; BIOS.clockEnabled = true; BIOS.customCCOpts = "-v28 -DLARGE_MODEL=1 -ml -q -mo --program_level_compile -o3 -g"; Idle.idleFxns[0] = "&Idle"; Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; Boot.disableWatchdog = true; Boot.bootCPU2 = false; Boot.configSharedRAMs = false; BIOS.common$.diags_ASSERT = Diags.ALWAYS_ON; BIOS.logsEnabled = false; BIOS.assertsEnabled = false; BIOS.rtsGateType = BIOS.GateSwi; BIOS.cpuFreq.lo = 2500000; BIOS.heapTrackEnabled = true; Clock.tickSource = Clock.TickSource_TIMER; Clock.tickPeriod = 100; var clock0Params = new Clock.Params(); clock0Params.instance.name = "clock0"; clock0Params.startFlag = true; clock0Params.period = 500; Program.global.clock0 = Clock.create("& myclk ", 1000, clock0Params); var ti_ sysbios _family_c28_Timer0Params = new ti_ sysbios _family_c28_Timer.Params(); ti_ sysbios _family_c28_Timer0Params.instance.name = "ti_ sysbios _family_c28_Timer0"; ti_ sysbios _family_c28_Timer0Params.period = 5; ti_ sysbios _family_c28_Timer0Params.emulationModeInit.free = 1; Program.global.ti_ sysbios _family_c28_Timer0 = ti_ sysbios _family_c28_Timer.create(null, "& mytimer ", ti_ sysbios _family_c28_Timer0Params); Main() // one shot timer Clock_Params_init(&clkParams); clkParams.period = 0; clkParams.startFlag = TRUE; clk1 = Clock_create(clk0Fxn, 1000, &clkParams, &eb); // periodic timer Clock_Params_init(&clkParams); clkParams.period = 50; clkParams.startFlag = TRUE; clk2 = Clock_create(clk1Fxn, 1000, &clkParams, &eb); if ((clk1 == NULL) || (clk2 == NULL)) BIOS_exit(0); ...... BIOS_Start(); } /* * ======== clk0Fxn ======= */ Void clk0Fxn() { UInt32 ntime; //Do nothing with this event yet //Event_post(evt, Event_Id_02); ntime = Clock_getTicks() ; mtime= ntime - timepr; timepr = ntime;; System_printf("clk0Fxn %d: time is %d : %d\n", mtime,time); System_flush(); } // cpu_timer Void myclk () { UInt32 ntime; //Do nothing with this event yet //Event_post(evt, Event_Id_02); ntime = Clock_getTicks() ; mtime= ntime - timepr; timepr = ntime;; } // cpu_timer Void mytimer () { UInt32 ntime; //Do nothing with this event yet //Event_post(evt, Event_Id_02); ntime = Clock_getTicks() ; mtime= ntime - timepr; timepr = ntime;; } /* * ======== clk1Fxn ======= */ Void clk1Fxn() { UInt32 ntime; ntime = Clock_getTicks() ; mtime= ntime - timepr; timepr = ntime;; } I got the periodic default ISR interrupt void TIMER0_ISR(void) I was expecting to get myTimer() I know I doing something wrong not sure what. TRemaining is struck
↧