Skip to content
Rob Stave edited this page Oct 30, 2015 · 6 revisions

One of the basic building blocks used here is the Linear Feedback Shift Register. This is used to generate random values. The one used here is a 16 bit shift register. The values at certain taps are xor'ed together and feed back into the shift register. The number of unique states should be 2^n -1. In this case 2^16 -1 = 65535.

This is the same LFSR as is described in the wikipedia. https://en.wikipedia.org/wiki/Linear_feedback_shift_register

(https://github.com/robstave/ArduinoComponentSketches/blob/master/ACS-85%20ATTiny85%20sketches/ACS-85-0520/images/ACS-85-0520_ex.png)

Clone this wiki locally