Badwolf wrote: Fri May 09, 2025 2:54 pm
ijor wrote: Fri May 09, 2025 2:01 pm
I see. But I would still use it for debugging purposes. Make a firmware version that only makes statistics for the data transfer. Count the number of transfers and the time between each zero address (screen start). See if there is a problem. You can perform, say, a dozen screen transfers, then display the statistics.
Possibly doable if I can isolate a couple of pins for a serial connection out.
Can't you just disconnect the screen for this test? Or just integrate some screen library and just printf on that screen.
But a custom firmware could possibly concentrate on logging rather than processing.
Yeah, that's precisely the idea.
So my conclusion is that I'm resetting the counter correctly, but somewhere in the chain the address (offset from screen ptr) and the data are becoming misaligned. My shonky parsing of the data transfer being the most likely culprit now.
Then build some kind of test to debug the data transfer. Forget about the ST, Shifter or Vsync. Make sure your transfer works, otherwise this doesn't make any sense.
Built a test firmware on the Pico, to see if what you are receiving is correct. And then, separately, build a test on the CPLD that sends the correct data by itself, completely disconnected from the ST hardware, just for the purpose of testing the Pico side. Divide and conquer.
I suspect they will be exactly correct and I'm actually handling the input buffer parsing poorly. But that's just my current theory.
It doesn't matter your theory, or my theory. Just implement good testing strategies. You also have to learn to simulate, and to learn that even when it involves extra work (sometimes a lot extra work) to setup a simulation, it is worth.
Yes, sorry. I'm completely self-taught from little in the way of sources (mostly Stephen's' TF330) which mostly doesn't do that. Pistorm has two branches. One that does and one that doesn't for Max V and Xilinx respectively. I've tended to follow the Xilinx way.
Sorry if I sound a little bit harsh. But people that don't follow good synchronous design practices are either amateurs that don't know what they do. Or either they are experts that know exactly what they do, when they can break the rules and why. In either case it is not a very good idea to learn from them.
Thanks. I can give it a try. I did actually deglitch VSYNC with a four stage history, but it produced exactly the same results.
I implemented a small glitch filter just for completeness and because it was easy. I don't think that's your problem. Good synchronization is more important here. VSYNC glitches, at least at the edges, are completely harmless in your application. LOAD glitches, on the other hand, could be a serious problem. I don't expect you will get glitches on LOAD, but it might be a good idea to verify this, just in case.