-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPIFFS, FLASH SPI and PWM (Timer1) bug #604
Comments
I use |
Okay, i was wrong. |
Interrupts are disabled while accessing the flash, for reading or writing. This is necessary because code can not be run from the flash while accessing it. Writing might be especially slow and could this cause the pwm problems? The extras/pwm implementation appears to use an interrupt that would be disabled. It might be possible to run the pwm from a NMI. All the code in the interrupt handler would need to be in the IRAM. Never tried this, but perhaps Also saw some discussion that the esp8266 might have a hardware pwm, and perhaps support could be added for that. For example, see esp8266/Arduino#1654 Does anyone know or a hardware pwm implementation? |
Fwiw the hardware pwm seems to work, and the registers appear to be already defined. Where this were adequate it might be smoother than a software pwm and less burden on the system. The example below could dim the blue led on a nodemcu. If someone could confirm the frequency and duty calculations then we could add a description to gpio_regs.h and perhaps even some supporting functions and an example.
|
o yeah, That will be nice to get this HW pwm !! Before, i was trying to work with overlap SPI without succes to connect the flash SPI wire with my screen. Edit: the resolution is 256 ? or it can be greater ? |
Wow @ourairquality, where did you learn about this HW PWM capability? I thought there wasn't one. So is this really different from the HW delta-sigma modulator that has been known to exists? Do you know if it supports multiple channels? |
@flannelhead The definitions were already in the include files, and it is described there as a PWM. I think this is the sigma-delta modulator. It seems to support only one channel, but it seems possible to route that one channel to all of gpio 0 to 15. It does appear to be limited to a resolution of 256. So it is limited, but still it might suit some uses and be smoother and less burden than the software solutions. If the name 'PWM' is misleading then perhaps we should rename the definitions in the include file, and we need to confirm and documentation the frequency and duty cycle. @Zaltora Can this PWM address your use case? If not then have you tried using the NMI timer? I could try to write an example if needed? |
I'm not 100% positive what you are referring to, but I believe this is Espressif's implementation of their software PWM. The most noticable issue is that it does not work well on 100% duty. |
i had begin to write a HW PWM driver with same API that SOFT PWM driver. I can't confirm this:
I don't no how set the variable "target". We got just a prescale in register definition. @ourairquality : I can't use this HW PWM for my app. I need more precision on duty. I didn't test NMI yet, i don't no what i need to change. My first thought was to use |
Hi i got a recent bug,
It is feel that receive UART interrupt > Timer1 interrupt. The motor is disrupting when i wrote on keyboard some text.
Before, this problem was not present.
I try to found what PR or sub-module does this bug. recent "lock" change maybe ?
It is not a HW bug, and i didn't change the uart part of my app.
The text was updated successfully, but these errors were encountered: