I may be misunderstnading but previously you said that you needed some random numbers on power up. Now you're running the routine in a loop (at least that's how I understand it) - that's not the same thing. Each time thru the loop the seed will be what the last RANDOM statement generated. But when you start from scratch (ie power up) the seed will always be 0. As long as the seed is the same (ie 0 at power up) you'll get the same results - and I'll stick to that for a little while longer ;-)
Run this on a 16F870 and on a 12F683Cycle the power and run it again. Does it really give you A) Random numbers on the 16F870 but not on the 12F683 and/or B) Different results on 16F870 compared to the 12F683?Code:GENERATE: 'CVLADEBIS GENERACIA RANDOM DROEBITI PIRVELI=(DROEBITI//6)+1 RANDOM DROEBITI MEORE=(DROEBITI//6)+1 RANDOM DROEBITI MESAME=(DROEBITI//6)+1 RANDOM DROEBITI MEOTXE=(DROEBITI//6)+1 lcdout $fe,$c0,"1=",#pirveli, " 2=",#meore, " " pause 50 end
/Henrik.




Bookmarks