I am working on a project using a SAMD21 processor and ILI9341 TFT screen. The circuit is powered by a 12VDC power supply (obviously have DC-DC stepdown converter). I also have a 3V backup battery to power the RTC in the MCU in the event of a power loss. Everything works fine except when I shut off 12V power and then turn it back on. The TFT screen goes all white, even though the processor is running, which seems obvious why.
Any suggestions how I can sense that the screen is all white, or that power has been reintroduced to the TFT screen so I can send the display information to the TFT screen again?
Does the SAMD21 have a separate VBATT pin just for the built-in RTC? I did a search on the datasheet and it came out empty. You might have to re-initialize the TFTP display when the main power goes down
No there is no VBatt pin. All the Vdd pins connect to the 3V3 step down converter. A 3V battery is connected via a diode to the Vdd pins. As long as there is power, the MCU gets power from the power supply. Once the power supply dies, the MCU gets power from the battery.
Do you know how I would sense that there is power to the MCU again so I can re-initialize the display?
You'll need an external component to sense when the main power goes down. Maybe like an output of an analog comparator to feed one of the interrupt pins of the SAMD21. Or you could just measure the voltage output of the regulator via one of the ADC and use that to determine whether the main power is out or not.
Thanks for the reply. The circuit already has a voltage divider going to A0, so I'm set there. The software would be pretty easy. I was just curious if there was a TFT equivalent to digitalRead of an Output pin.
Kind of like
if (digitalRead(TFT screen)==all white) TFTSetup();
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.