Part Number:TMS320F28035
在网找到的例子
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
void main(void)
{
……………………..
srand((unsigned)time(NULL));
fRandValue = rand();
}
仿真后,点运行报错
Break at address "0x3ff599" with no debug information available, or outside of program code.
这是什么原因,有什么办法处理?
Jun Zhang:
srand形参调用time()有问题吧,在dsp上如何获取时间?
尝试用AD采样数据作为随机数种子看看?
,
Yale Li:
楼上的回复正解。除了AD采样值,还可以使用ePWM、timer计数器的值作为随机数种子。
Compiler/TMS320F28379D: random number generator does not work in Standalone – C2000 microcontrollers forum – C2000︎ microcontrollers – TI E2E support forums