In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: I needed a running, 8-bit random number for a program I jsut wrote so I stuck this little chunk of code (adapted from www.sxlist.com) into my ISR. It works really well and I just copy "seed" when I need a random value. [code] LFSR: ' randomize "seed" IF seed = 0 THEN seed = 24 ENDIF ASM MOV W, #$1D CLRB C RL seed SNB C XOR seed, W ENDASM [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=167121#m167179 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)