Project check against the datasheet; fix column parity

The datasheet numbers columns from 1 (Fig. 3: "row 1", "Last pixel
(512 / 256)") and puts odd columns on TVID, so x = 0 (column 1) now
goes to TVID and x = 1 to VID; the encoder had them swapped.

README wiring now lists the J1/J2 pins and power rails from Table 1,
the 5 V buffer, and a pull-down on ENABLE so the panel stays off while
the ESP32 boots without VCLK. encodeRow() documents its T4/T5 margins.
docs/README.md open items are regrouped into done, hardware checks and
software work. main.cpp counts seconds, not frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-05 21:17:29 +02:00
1 parent 37d5bcc1f8
commit ab3e6ad0ac
6 files changed
+72 -31

No files matched your search

+7 -5
View File
@@ -118,8 +118,9 @@ void EL512Panel::clear(bool on) {
void EL512Panel::encodeRow(uint16_t line, uint8_t* out) const {
// VS is held high during the last blanking line so that the first HS high
// time ending after its rising edge is row 0 (datasheet: video input timing).
// TODO: verify VS/HS setup and hold (T4/T5) on hardware.
// time ending after its rising edge is row 0 (datasheet: Video Data Input).
// VS rises 1104 clocks after the previous HS fall (T4 >= 1 VCLK) and 272
// clocks = 54.4 us before the next HS rise (T5 >= 3 us); check on a scope.
const uint8_t vs = (line == LINES_PER_FRAME - 1) ? BIT_VS : 0;
if (line >= HEIGHT) {
@@ -129,11 +130,12 @@ void EL512Panel::encodeRow(uint16_t line, uint8_t* out) const {
const uint8_t* src = _fb + (size_t)line * (WIDTH / 8);
for (uint16_t c = 0; c < DATA_CLOCKS_PER_ROW; c++) {
// Clock c carries columns 2c (VID, even) and 2c+1 (TVID, odd).
// Clock c carries x = 2c and 2c+1. The datasheet numbers columns from 1, so
// x = 2c is column 2c+1 (odd -> TVID) and x = 2c+1 is column 2c+2 (even -> VID).
const uint8_t bits = (uint8_t)(src[c >> 2] << ((c & 3) * 2));
uint8_t v = BIT_HS | vs;
if (bits & 0x80) v |= BIT_VID;
if (bits & 0x40) v |= BIT_TVID;
if (bits & 0x80) v |= BIT_TVID;
if (bits & 0x40) v |= BIT_VID;
// 8-bit I2S LCD mode sends each 32-bit word as bytes 2, 3, 0, 1.
out[c ^ 2] = v;
}