Removed GPIOs, that are already used for Flash chip and rtc(xtal)

Added docu for PWM and Pulse
This commit is contained in:
jumjum123 2017-01-22 22:43:48 +01:00
parent 73dea78b70
commit eca56f1f4e
3 changed files with 46 additions and 4 deletions

View File

@ -133,13 +133,13 @@ boards = [ board_esp12, board_esp01 ];
def get_pins():
pins = pinutils.generate_pins(0,19);
pins = pinutils.generate_pins(0,5);
#6-11 are used by Flash chip
pins.extend(pinutils.generate_pins(21,22));
pins.extend(pinutils.generate_pins(25,27));
pins.extend(pinutils.generate_pins(32,39));
#32-33 are routed to rtc for xtal
pins.extend(pinutils.generate_pins(34,39));
pins = pinutils.fill_gaps_in_pin_list(pins);

View File

@ -0,0 +1,15 @@
Digital Pulse
===
Espruino supports a command digitalPulse
##General##
ESP32 supports a so called RMT with a lot of timers. This is defined generally to support Remote Control. Anyway we will use it to create digital pulses.
##Usage for Espruino##
First version of digital pulse uses rmt driver.
There are 8 channel available. Each one with is connected to a pin. Timimg goes down to micro secs.
##Status##
Still waiting for my digital oscilloscope for testing.

27
targets/esp32/docs/PWM.md Normal file
View File

@ -0,0 +1,27 @@
PWM
===
Espruino supports Analog output using PWM
##General##
ESP32 supports (at least) 2 optiins for PWM. Both have pros and cons.
- sigmadelta
driver for sigmadelta is very easy to use. Problem is a limitation in frequency.
Base of frequency is 80Mhz, which can be divided by a values from 1 to 255.
Therefore a frequency of 30khz is impossible this way
- ledc
driver for ledc is designed to control leds. Not a big surprise, if you see the name :-)
Driver allows a lot of options, like fadein and fadeout. There are 8 channel, which can be assigned to a GPIO. In the background are 4 timer, where each channel needs to be assigned to a specific timer. Therefore only 4 different frequencies are possible.
Last not least, Frequency is limited to about 75Khz
##Usage for Espruino##
First version of PWM uses ledc driver. Usually, this matches needs for frequency much more than sigmadelta. Mapping of PWM channel to timer is done in a special way.
There are 5 channel usable, as long as 5Khz are ok for frequency. Channels are internally controlled. If you try to use more than 5, you will get a message.
Left 3 channels are designed to support a frequency of your choice, as long as it is between 1hz and 78 Khz. If you try to use a 4th channel with a frequency, other than 5Khz you will a meesage.
##Problem##
Handling of PWM with those 5/3 method is not always easy to follow. As long as we don't have a better solution, its better to have this than nothing.
Limitation of frequency is boring, but as long as we use it for analog output, it should be acceptable.
Please have in mind, PWM via analog always need a lowpass filter, usually a simple RC.
##Status##
As mentioned above, this is a first step. Hopefully we get a better solution in the future. We could build our own solution, using RMT. If somebody wants to go into this direction, you are welcome. In that case please take care on implementation of digitalPulse, see jshardwarPulse for more information.