ESP8266: Difference between revisions
Tags: Mobile edit Mobile web edit |
Tags: Mobile edit Mobile web edit |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
==Hardware== | ==Hardware== | ||
A Tensilica Diamond Standard 106Micro runs the Xtensa instruction set at 80MHz by default, and can be run at 160MHz. 32KB of code memory and 80KB of data are available to the user. There is no cache. | A Tensilica Diamond Standard 106Micro runs the Xtensa instruction set at 80MHz by default, and can be run at 160MHz. 32KB of code memory and 80KB of data are available to the user. There is no cache. IEEE 802.11 b/g/n support is available in AP, STA, and monitor modes. | ||
===GPIO=== | ===GPIO=== | ||
| Line 12: | Line 12: | ||
===PWM=== | ===PWM=== | ||
Four PWM channels on pins 10, 13, 9, and 16: | |||
{| class="wikitable" | |||
! Pin name !! Pin number !! IO Function !! Name | |||
|- | |||
| MTDI || 10 || IO12 || PWM0 | |||
|- | |||
| MTDO || 13 || IO15 || PWM1 | |||
|- | |||
| MTMS || 9 || IO14 || PWM2 | |||
|- | |||
| GPIO4 || 16 || IO4 || PWM3 | |||
|- | |||
|} | |||
The minimum PWM resolution is 45ns (an approximate PWM clock of 22.72MHz), supporting 14 bits of PWM resolution at 1KHz. Active PWM prevents the system from entering Deep Sleep mode, and entering Light Sleep will disrupt PWM. | |||
Unfortunately, the Espressif-provided PWM API only supports frequencies up to 1KHz. Libraries such as [https://github.com/StefanBruens/ESP8266_new_pwm ESP8266_new_pwm] can exceed these limitations. It ought be possible to achieve 7-bit PWM at the 25KHz required for [[PC Fans|pc fans]]. | |||
===ADC=== | ===ADC=== | ||
There is only one (10-bit) ADC, and it reports values between [0, 1], ''not'' [0, 3.3]. This is not a scaling--the input voltage should not exceed 1V. The NodeMCU changes this significantly: | There is only one (10-bit) ADC, and it reports values between [0, 1], ''not'' [0, 3.3]. This is not a scaling--the input voltage should not exceed 1V. The NodeMCU changes this significantly: | ||