bitluni / ESP32Lib

http://bitluni.net/esp32-vga/
441 stars 78 forks source link

Composite color #48

Closed Martin-Laclaustra closed 3 years ago

Martin-Laclaustra commented 4 years ago

I updated PR #47 with code to produce color composite signals. Drawing on the canvas is slow but colors are bright and nice! NTSC color works well in all TVs I checked (CRT and LCD), through DAC or through R2R. PAL color works in CRT TVs. Maybe the code needs to be reviewed because I hacked the formula to get the right colors. In LCD TV only green and blue appeared. PAL at the programmed frequency did not always work (no image) with my toy ladder. It should be tested with your hardware. However, a lower frequency produced PAL colors in my ladder (see example), although the frequency is too low and vertical black bars appear.

Martin-Laclaustra commented 4 years ago

Drawing on the canvas is slow but colors are bright and nice!

I moved all formulas to integer arithmetic and now it is reasonably fast.

NTSC color works well in all TVs I checked (CRT and LCD), through DAC or through R2R.

But now faster...

PAL color works in CRT TVs. Maybe the code needs to be reviewed because I hacked the formula to get the right colors.

Now PAL color works well in all TVs I checked (CRT and LCD), through DAC or through R2R. There was a silly bug in the code generating the burst that was not alternating the phase between lines.

Some frequencies clog I2S in parallel output (for the ladder) in my modules. I am not sure of the cause. It should be tested with other hardware. A lower frequency produced PAL colors in my ladder (only 4 bits) (see example), although the frequency is low, pixels are wide and colors appear with vertical banding.

I moved all this development to my advanced-redesign branch (see #50 )

Martin-Laclaustra commented 3 years ago

Some frequencies clog I2S in parallel output (for the ladder) in my modules. I am not sure of the cause. It should be tested with other hardware. A lower frequency produced PAL colors in my ladder (only 4 bits) (see example), although the frequency is low, pixels are wide and colors appear with vertical banding.

Just adding: "WiFi.begin();" at the start of "setup()" unblocks the output (the chip does not stall any more). I tried this after I read this answer to the stalling issue: https://github.com/bitluni/ESP32Lib/issues/21#issuecomment-692276626

Composite color is included in the "development" branch here and eventually it will be merged into "master".