TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320C6678: 如何在代码里面动态配置cfg文件里的CLOCK模块

Part Number:TMS320C6678Other Parts Discussed in Thread:SYSBIOS

如题所述:

由于多核共用同一个cfg文件,在cfg里面没法为每个核配置clock模块。

所以想从代码的角度动态配置clock模块,而不影响使用(不影响task_sleep的使用)。

Nancy Wang:

可参考 5.2 Clock

Runtime example:

https://www.ti.com/lit/ug/spruex3v/spruex3v.pdf

,

wapdasta:

这种方法试过了,这只是在原先系统默认的clock上再加了一个clock。clock基于的timer还是同一个id。

我的目的是想用代码配置每个核clock所依赖的timer id。但是查找了好多方法基本上是不支持这样的操作。

现在遇到的问题是,多核共用同一个cfg文件,导致多核clock所依赖的timer id是一样的,(多核用同一个定时器)这会出问题的。

如果要每个核用不同的timer id ,是不是每个核必须单独用一个cfg文件?

,

Nancy Wang:

If you want to use a custom configured timer for the Clock module's tick source, use the following example configuration as a guide:var Clock = xdc.useModule('ti.sysbios.knl.Clock');// Tell the Clock module that YOU are providing the periodic interruptClock.tickSource = Clock.TickSource_USER;// this example uses the ti.sysbios.timers.dmtimer.Timer modulevar Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');// Change Timer 3 frequency to 24 Mhz from default if necessaryTimer.intFreqs[3] = { hi:0, lo:24000000 };// create a dmtimer config parameter objectvar timerParams = new Timer.Params();// make sure you set the period to 1000 us (1ms)timerParams.period = 1000;// custom dmtimer config parameters here...timerParams.twer.ovf_wup_ena = 1;// Create the timer.// This example uses timer id 3.// Provide your own timer interrupt handler function.Timer.create(3, '&myTimerTick', timerParams);
In your 'C' code, add your timer interrupt handler and have it call Clock_tick(), which will perform all of the Clock module tick duties:#include <ti/sysbios/knl/Clock.h>Void myTimerTick(UArg arg){Clock_tick();...}

重新指定timer了吗?第一条文档中的示例没有重新指定timer.

ti-processor-sdk-rtos-c667x-evm-06.03.00.106-Windows/bios_6_76_03_01/docs/cdoc/ti/sysbios/knl/Clock.html

,

wapdasta:

对,就是这个意思。这样用代码配制出来的timer也能和CLOCK关联起来。关键就是在timer中断响应函数里调用Clock_tick()函数吧。

赞(0)
未经允许不得转载:TI中文支持网 » TMS320C6678: 如何在代码里面动态配置cfg文件里的CLOCK模块
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1