dirkenstein
Active member
Hi,
The onboard 3.3v regulator for the teensy 4.0 seems to be quite sensitive to spike overload current, so much so that i needed a standalone regulator for a project using a particularly power-hungry OLED display.
Is there any way to detect brown-out on the Teensy? i was getting some deeply weird results when drawing too much power with random resets, repeated hard faults, etc, and i'd like to be able to detect it and report for debugging purposes, and possibly for some logic like reducing the CPU frequency to a minimum to carry out some emergency flash/eeprom writes before the power fully goes.
For another project, I want to use the teensy battery-powered, with the power button.
The other question i have is whether there is any elegant way to use the teensy power button as a normal button input whilst retaining the power off functionality. Paralleling another pin on the teensy and digitalRead doesn't work because the power pin seems to get stuck in pulldown state on powerdown rather than hi-Z, making it impossible to power up again.
Also, the power button interrupts the main logic flow. I assume there is no way to continue processing while the button is pushed expect from an IntervalTimer call (which means I need to make most of my application reentrant, or at least rewrite my current cooperative multitasking logic). Reading the power pin from the main loop also seems to upset the IntervalTimer used by tone(), even though it is only reading one register(not that this is useful, as the main loop gets suspended if the power button is pushed anyway).
I was hoping to implement a kind of time based logic.
Short press (<5s) normal push button functionality.
Long press (>5s<15s) controlled powerdown.
Really long press (>15s) emergency (hard) powerdown.
I don't really want to add a separate power button to my project, although that is my backup option. I also need to be able to lock out the power button(except for emergency power down), which seems to be possible with the power button library.
The onboard 3.3v regulator for the teensy 4.0 seems to be quite sensitive to spike overload current, so much so that i needed a standalone regulator for a project using a particularly power-hungry OLED display.
Is there any way to detect brown-out on the Teensy? i was getting some deeply weird results when drawing too much power with random resets, repeated hard faults, etc, and i'd like to be able to detect it and report for debugging purposes, and possibly for some logic like reducing the CPU frequency to a minimum to carry out some emergency flash/eeprom writes before the power fully goes.
For another project, I want to use the teensy battery-powered, with the power button.
The other question i have is whether there is any elegant way to use the teensy power button as a normal button input whilst retaining the power off functionality. Paralleling another pin on the teensy and digitalRead doesn't work because the power pin seems to get stuck in pulldown state on powerdown rather than hi-Z, making it impossible to power up again.
Also, the power button interrupts the main logic flow. I assume there is no way to continue processing while the button is pushed expect from an IntervalTimer call (which means I need to make most of my application reentrant, or at least rewrite my current cooperative multitasking logic). Reading the power pin from the main loop also seems to upset the IntervalTimer used by tone(), even though it is only reading one register(not that this is useful, as the main loop gets suspended if the power button is pushed anyway).
I was hoping to implement a kind of time based logic.
Short press (<5s) normal push button functionality.
Long press (>5s<15s) controlled powerdown.
Really long press (>15s) emergency (hard) powerdown.
I don't really want to add a separate power button to my project, although that is my backup option. I also need to be able to lock out the power button(except for emergency power down), which seems to be possible with the power button library.