Statistics: Posted by beyondhong — Wed Nov 02, 2016 11:39 pm
eriksl wrote:
It shouldn't be too hard to reproduce. Connect PWM channels to io 14 and io 15, activate one of them (or both) and wait.
Statistics: Posted by scargill — Sat Jul 23, 2016 5:09 am
Code:
/*
* ESPRSSIF MIT License
*
* Copyright (c) 2015 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
*
* Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
* it is free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
* to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or
* substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#include "esp_common.h"
#include "../sample_lib/wifi/wifi_test.h"
#include "uart.h"
#include "gpio_test.h"
/*Definition of GPIO PIN params, for GPIO initialization*/
#define PWM_4_OUT_IO_MUX PERIPHS_IO_MUX_MTDI_U
#define PWM_4_OUT_IO_NUM 12
#define PWM_4_OUT_IO_FUNC FUNC_GPIO12
#define PWM_1_OUT_IO_MUX PERIPHS_IO_MUX_MTDO_U
#define PWM_1_OUT_IO_NUM 15
#define PWM_1_OUT_IO_FUNC FUNC_GPIO15
#define PWM_2_OUT_IO_MUX PERIPHS_IO_MUX_GPIO4_U
#define PWM_2_OUT_IO_NUM 4
#define PWM_2_OUT_IO_FUNC FUNC_GPIO4
#define PWM_3_OUT_IO_MUX PERIPHS_IO_MUX_MTMS_U
#define PWM_3_OUT_IO_NUM 14
#define PWM_3_OUT_IO_FUNC FUNC_GPIO14
//#define PWM_4_OUT_IO_MUX PERIPHS_IO_MUX_GPIO5_U
//#define PWM_4_OUT_IO_NUM 5
//#define PWM_4_OUT_IO_FUNC FUNC_GPIO5
uint32 io_info[][3] = {
{PWM_1_OUT_IO_MUX,PWM_1_OUT_IO_FUNC,PWM_1_OUT_IO_NUM},
{PWM_2_OUT_IO_MUX,PWM_2_OUT_IO_FUNC,PWM_2_OUT_IO_NUM},
{PWM_3_OUT_IO_MUX,PWM_3_OUT_IO_FUNC,PWM_3_OUT_IO_NUM},
{PWM_4_OUT_IO_MUX,PWM_4_OUT_IO_FUNC,PWM_4_OUT_IO_NUM}
};
void user_init(void)
{
uint32 duty[3]={0,0,0},i;
pwm_init(1000,duty,4,io_info);//1000us
pwm_set_duty(20,0);/*20us */
pwm_set_duty(10,1);/*10us This is IO4*/
pwm_set_duty(15,2);/*15us */
pwm_set_duty(5,3);/*5us */
pwm_start();
}
Statistics: Posted by ESP_Yuhao — Fri Jul 15, 2016 4:53 pm
Code:
while(1) {
// try this..
system_soft_wdt_feed();
// your pwm call
}
Statistics: Posted by rudi — Fri Jul 08, 2016 2:53 am
Statistics: Posted by eriksl — Fri Jul 08, 2016 12:58 am
Statistics: Posted by Guest — Wed Jul 06, 2016 7:58 pm
Statistics: Posted by eriksl — Wed Jul 06, 2016 2:21 am
Statistics: Posted by Guest — Mon Jul 04, 2016 12:12 pm
Statistics: Posted by eriksl — Fri Jul 01, 2016 10:12 pm
Statistics: Posted by ESP_Faye — Mon Jun 20, 2016 9:26 am
Statistics: Posted by eriksl — Sun Jun 19, 2016 6:24 pm