There’s some sync inside you, it’s hard to explain

The synchronizer module

As stated in my previous post as well as Salomé’s post, the synchronization module has to do some heavy lifting.

It must indeed control the timing of data sent on all led band controllers. Basically, we need two state machines: one for the function control, the other for the grayscale data. I started to implement the GS state machine today, but this will need extensive testing.

Furthermore, we need to generate the essential SCLK and GCLK signals (see the led driver description), this is done using two clock dividers. I implemented this module, but the division factors are still to be discussed.

A very important role of the synchronizer is to infer the current angle from the number of cycles it took to make the previous turn. I implemented this module, however it could use improvement. I assumed that the turn signal, which comes from the rotation sensor (hall effect or infrared) is clean. If it bounces, the module breaks because it assumes that the last bounce was an entire turn. This can be filtered later if needed by setting a lower bound to the number of cycles a turn can last.

Leave a Reply

Your email address will not be published. Required fields are marked *