(c) 2025 M10tech
Use bitbanging to directly drive the TLC5921 chips found in the Ameli buspanel,
without using the 80C32 based controller.
Use the LCM4ESP32 concept to run this
Details on https://github.com/HomeACcessoryKid/LCM4ESP32
and instructions how to deploy here
https://github.com/HomeACcessoryKid/LCM4ESP32/blob/main/deploy.md
Also read the WIKI to get background info on the hardware needed and the priciples involved.
- use addr in any message to address a single panel
- this is the first item in the config-string
- start MQTT only after IP acquired
- blank panel on start and between reboots
- make MQTT optional, if not specified - or 0.0.0.0, then ignore
- stable ping-rate = 1x per 7 seconds
- also triggers on watchdog-timeout of 9s
- system topic is able to trigger an update
- uses lcm-api for running the update firmware partition
- images picked up from 4K HD youtube
- slowed down from 30 to 20 fps for more relax
- must still find connection between head and tail (TODO)
- howto in wiki (TODO)
- see details on the Wiki (TODO) for the hardware
- use OutputEnable of TXS0108 to prevent issues at boot
- some code cleanup
- moved movie to a header file
- this defines frames columns and fps
- dynamic matching of fps results in deciding to show 8 or 7 times per frame
- to finetune fps, an extra few % of delay is added to bits 0b11 and 0b10
- without this, it would be 28 fps or 32 fps
- swapped top and bottom signal (since they were swapped)
- size of bitmaps needs const to prevent storing in dram
- flash size demands a custom partition table for the 1800kB result
- instructions how to create the bad_apple.h file in wiki (TODO)
- make an array of frames that will be played in sequence
- reduced blanking PWM to 3kHz allows lower minimum brightness
- be aware of moire effect between individual refresh rate and blanking
- take the median of 11 samples at 1 sample per second
- adjustment in 6 seconds for stable changes, spikes are ignored
- take the square root for the PWM % of BLANK
- clip between 3% and 100%
- block wave with frequencies from a few Hz to 1MHz at full sunshine
- fine tuning of reporting cycle and interrupt rate still pending
- intensity varies at an exponential scale
- this signal is somehow dirty, needed to add a 220pF capacitor to the 5V side of BLNK_PIN
might not be needed in a not experimental setup - ESP32 does not boot anymore when panel already powered before...
rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) - adjusted 0b10 brightness level to be more 'in the middle'
- made functions static (best practice)
- does not use a function but is inline
- use start%= to allow use in macro
- reduces refreshrate by 15% 170 micros/column
- the infinite while-loop did not allow the taskWatchDog to be fed, causing a TWD-report on CPU-1
- disabled the TWD with CONFIG_ESP_TASK_WDT_EN=n in sdkconfig.defaults
- protected the XLAT pin with taskENTER_CRITICAL (might not be needed...)
- better contrast at the cost of 200 micros/column refreshrate
- additional test-patterns
- reduces time per column to 46 microseconds
- with the four level brightness, faster seems difficult
- the receiving hardware seems to hold up with the speed
- much clearer level differences
- experiments with alternative delay methods
- for now, 1 microsecond with esp_timer_get_time() loop works OK
- forgot to put IDF version to 0.1.1
- with artificial delay of 10 microseconds works well
- maybe levelshifter is bandwidth limited since no-delay does not work well
- differences between led levels not easy to appreciate
- no blanking used so far, which might (or not) interfere
- note that in 0.0.3 I forgot to call init_xlat() so maybe there was still some use, but who cares?
- using on_sent isr to drive xlat has still issues since clock continues driving
- during the xlat pulse, the bits are shifted on part of the panel
- sometimes the xlat arrives late or ...
- will revert to bit-banging from here
- i2s is good for timing critical applications, which this is not
- this application is critical in sequencing of lines, without timing
- the actual bits are sent out fine, and the clock is OK, but...
- the start of SIN is not together with start of SCLK
- the timer to shutdown the SCLK is unreliable
- the timer to shutdown the SCLK has an offset of ~900 microseconds
- maybe using the interupt on send complete can provide the xlat??
- no useful functionality yet
- UDPlogger and wifi working