if transition_mode pin is high, then images are shown continuosly
(eg the next image is shown as soon as the next_image button is pressed)
but if transition_mode pin is low, then, when you press the button, the
current image disappears, and the next one appears when you press the
button again
Basically, the LPM instruction (3 cycles) does not always take 3 cycles,
(I think because of the timing needed to read the Flash memory),
and this disrupts the timing of the signal, leading to some offsets
depending on what is shown on the line.
Thus, the LPM instruction has been replaced with an RJMP one, which,
instead, always takes 3 perfect cycles to be performed, timing is
not disrupted anymore, and image appears ok.
This does not work as expected, and I don't understand why.
Clock cycle count seems ok, but if there are no changes in the pixels,
it seems to go faster
This makes the microcontroller very application dependent,
but may save use some headaches.
The idea is to write a program to produce the code to show a
complex drawing.
sufficiently handles the back/front porch without disrupting the sync
signal
todo improvement: compute a sensible amount of cycles to waste during
the porch
not the whole screen, but vertically locked
actually it has some issues, there is a single dot (at the
end/beginning of a cycle) that messes up the horizontal sync and moves
all the picture... must be fixed