Random Number Generator for Microcontrollers

by Tom Dickens

Back to articles.

Since 1/20/2003

Last updated:

This is an example technical paper for the 2003 Robothon call for papers hosted by the Seattle Robotics Society. Please contact me, the Robothon Technical Papers Chair, for information on the Robothon call for papers and how to submit your paper for publication at Robothon 2003:
Tom Dickens .


The use of random numbers in small microcontrollers can be very useful and fun in robotic programming to yield different behaviors from the same robotic-control program. Due to limited memory, the lack of floating-point math capabilities, and the limited size of integers in some microcontrollers, the practical implementation of a software-based random number generator for a microcontroller is difficult. This paper looks at the generation of random numbers, and compares a variety of implementations on the 68HC11 microcontroller. A good implementation is chosen and the 68HC11 source code is provided that implements it.

Full article in PDF form

Full article in Word form, ZIPped

Assembly source code