The easiest and simplest way to start with a Random Number seed is to employ the services of the User (unbeknown to them of course).
If you have an On/Off BUTTON, then the PIC powers up very quickly when the ON Button is pressed, and starts counting how long the Button remains pressed until the user releases it. Counting from 0-256 continuously with fosc at 4MHz, there's little chance the User would be able to throw the result even if they knew the Random seed was linked to the ON Button.
The component count in this instance is minimal and you have Push-Button On/Off for your device, which is easier and neater to install than a actual change-over switch (also allows you to have software control of Power-Off if needed).
Melanie
Bookmarks