JuanCar Orozco

Random number generation on 8 bit MCU

Discussion created by JuanCar Orozco on Aug 11, 2011
Latest reply on Sep 3, 2011 by JuanCar Orozco



I am currently trying to find a solution for random number, my program will randomize a list of guys that have to do certain task.


We are 6 people, so the solution i thought was:


rand_person = TPM1CNT % 6 so the output will give me 0,1,2,3,4,5. But it isn´t working as espected.


also the TPM1MOD = 655; so it interrupts every 10 ms


So i will be pleased if someone could tell me the best way to generate a random number.