Dear all:
I'm using MC13213 and CodeWarrior6.1,now I want to get a random number with following C code:
main()
{
clock_t clk;
unsigned int random_number;
EnableInterrupts;
clk = clock(); //clock always return zero,so clk is equal to zero
srand((int)clk); //feed always is zero
random_number = rand(); //the random_number is a constant every time running, not a random
......
}
I don't konw why the clock always return 0,how to solve it ?
Otherwise,call the time(),it also returns 0.
look forward to your suggestion!
Thanks and best regards!
Charly