Post links and attach files for documentation here, also chat about these docs freely

User avatar
By robov
#16794
eriksl wrote:From what I've read/understand:

1: There is one timer available through the "os" layer, you can have it call a function every x milliseconds (or one shot), also microseconds resolution seems to be available with a new undocumented sdk function. It's not a "timer" in the common microcontroller sense.

2: Quite a lot, I think, from what I read. What do you need?

3: All GPIO's can be connected to the one generic PWM generator, all with their own duty cycle. So far the good news. The bad news: the resolution is only 8 bits and there are not that may pins available (about six). Also all PWM output share the same frequency (which doesn't have to be a real problem imho).

4: Only one analog input. But that's no problem. Actually all low-end microcontroller only have one analog input, which is multiplexed internally using an analog CMOS switch (like CD4066). You can add something like that yourself, using some GPIO's as input select. I've been using that method for years.


Thanks for proper reply and my bad if created duplicate topic. Lets find it.

First of all, I been using nodemcu firmware. What about you ?

1. One timer, I see. But I don't get what nodemcu wiki mentioned id: 0-6
https://github.com/nodemcu/nodemcu-firm ... n#tmralarm

2. This particular feature is like for I need to auto-on/auto-off something after an hour or so.

3. But nodemcu doc says only 3 pins at most.https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en#pwmsetup

4. Yes one analog Tout as I see only available in ESP-07 and ESP-12. That is enough for my purpose. By the way you mean add GPIO expander to it. What method you using.

Thanks :)
User avatar
By eriksl
#16796 I am currently using the transparent bridge firmware, but I am planning to going to make some myself. No nodemcu.

The number of GPIO's I am referring to is when all GPIO's are "reachable". This is on the esp201. On other models not all GPIO's may be "reachable" for the user.
User avatar
By mampomat
#18701
eriksl wrote:1: There is one timer available through the "os" layer, you can have it call a function every x milliseconds (or one shot), also microseconds resolution seems to be available with a new undocumented sdk function. It's not a "timer" in the common microcontroller sense.

How did you find out that there is only one timer? I am currently using up to 3 timers concurrently with wildly different frequencies and it seems to work fine. I agree that the whole system is very opaque and I would like to know how efficient it is to use those timers. Are they mapped to some hardware functionality (the MCU seems to have hardware timers according to the manufacturers web-site)? How many timers are supported in hardware? The timer related document on the Espressif BBS is not live yet, that might shed some light...
User avatar
By eriksl
#18737 It looks like there actually is only one timer available (I guess others are used for wlan etc). It's fairly simple to emulate multiple timers in software, which looks like is done here.