manjuk123 wrote: ↑Thu May 09, 2019 9:48 am
Nothing on the OLED too...
Hi
if you talk from the esp azure io kit
and
example
have a note to the
include of the main.c and the
settings of I2C
Code: Select all
..
#include "iot_bh1750.h"
#include "iot_ssd1306.h"
#include "ssd1306_fonts.h"
#include "iot_mpu6050.h"
#define I2C_MASTER_SCL_IO 26 /*!< gpio number for I2C master clock */
#define I2C_MASTER_SDA_IO 25 /*!< gpio number for I2C master data */
#define I2C_MASTER_NUM I2C_NUM_1 /*!< I2C port number for master dev */
#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master do not need buffer */
#define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master do not need buffer */
#define I2C_MASTER_FREQ_HZ 100000 /*!< I2C master clock frequency */
..
it points to
iot_ssd1306.h
but which is pin set different to the main and shematic of the board itself
I2C_NUM must be 1 not 0
SSD1306-CLK_NUM must be 26 not 4
SSD1306_DIN_NUM must be 25 not 17
OLED_IIC_SCL_NUM must be (gpio_num_t)26 not (gpio_num_t)4
OLED_IIC_SDA_NUM must be (gpio_num_t)25 not (gpio_num_t)17
OLED_IIC_NUM must be I2C_NUM_1 not I2C_NUM_0
also for GPIO MUX the pins set differnt to the main and shematic of the board itself
Code: Select all
..
#define SSD1306_CS_MUX PERIPHS_IO_MUX_GPIO23_U
#define SSD1306_CS_NUM 23
#define SSD1306_CS_FUNC FUNC_GPIO23_GPIO23
#define SSD1306_CLK_MUX PERIPHS_IO_MUX_GPIO4_U
#define SSD1306_CLK_NUM 4
#define SSD1306_CLK_FUNC FUNC_GPIO4_GPIO4
#define SSD1306_DIN_MUX PERIPHS_IO_MUX_GPIO17_U
#define SSD1306_DIN_NUM 17
#define SSD1306_DIN_FUNC FUNC_GPIO17_GPIO17
#define SSD1306_RES_MUX PERIPHS_IO_MUX_GPIO18_U
#define SSD1306_RES_NUM 18
#define SSD1306_RES_FUNC FUNC_GPIO18_GPIO18
#define SSD1306_DC_MUX PERIPHS_IO_MUX_GPIO5_U
#define SSD1306_DC_NUM 5
#define SSD1306_DC_FUNC FUNC_GPIO5_GPIO5
#define __SSD1306_CS_SET() GPIO_OUTPUT_SET(SSD1306_CS_NUM, 1)
#define __SSD1306_CS_CLR() GPIO_OUTPUT_SET(SSD1306_CS_NUM, 0)
#define __SSD1306_RES_SET() GPIO_OUTPUT_SET(SSD1306_RES_NUM, 1)
#define __SSD1306_RES_CLR() GPIO_OUTPUT_SET(SSD1306_RES_NUM, 0)
#define __SSD1306_DC_SET() GPIO_OUTPUT_SET(SSD1306_DC_NUM, 1)
#define __SSD1306_DC_CLR() GPIO_OUTPUT_SET(SSD1306_DC_NUM, 0)
#define __SSD1306_CLK_SET() GPIO_OUTPUT_SET(SSD1306_CLK_NUM, 1)
#define __SSD1306_CLK_CLR() GPIO_OUTPUT_SET(SSD1306_CLK_NUM, 0)
#define __SSD1306_DIN_SET() GPIO_OUTPUT_SET(SSD1306_DIN_NUM, 1)
#define __SSD1306_DIN_CLR() GPIO_OUTPUT_SET(SSD1306_DIN_NUM, 0)
//I2C
#define OLED_IIC_SCL_NUM (gpio_num_t)4 /*!< gpio number for I2C master clock IO4*/
#define OLED_IIC_SDA_NUM (gpio_num_t)17 /*!< gpio number for I2C master data IO17*/
#define OLED_IIC_NUM I2C_NUM_0 /*!< I2C number >*/
#define OLED_IIC_FREQ_HZ 100000 /*!< I2C colock frequency >*/
#define OLED_IIC_TX_BUF_DISABLE 0 /*!< I2C Tx buffer disable >*/
#define OLED_IIC_RX_BUF_DISABLE 0 /*!< I2C Rx buffer disable >*/
..
simple change to the right pins.
Code: Select all
// CLK old 4
// #define SSD1306_CLK_MUX PERIPHS_IO_MUX_GPIO4_U
// #define SSD1306_CLK_NUM 4
// #define SSD1306_CLK_FUNC FUNC_GPIO4_GPIO4
// CLK new 26
#define SSD1306_CLK_MUX PERIPHS_IO_MUX_GPIO26_U
#define SSD1306_CLK_NUM 26
#define SSD1306_CLK_FUNC FUNC_GPIO26_GPIO26
// SDA (DIN) old 17
// #define SSD1306_DIN_MUX PERIPHS_IO_MUX_GPIO17_U
// #define SSD1306_DIN_NUM 17
// #define SSD1306_DIN_FUNC FUNC_GPIO17_GPIO17
// SDA (DIN) new 25
#define SSD1306_DIN_MUX PERIPHS_IO_MUX_GPIO25_U
#define SSD1306_DIN_NUM 25
#define SSD1306_DIN_FUNC FUNC_GPIO25_GPIO25
//I2C
// SCL, SDA old 4 and 17
// #define OLED_IIC_SCL_NUM (gpio_num_t)4 /*!< gpio number for I2C master clock IO4*/
// #define OLED_IIC_SDA_NUM (gpio_num_t)17 /*!< gpio number for I2C master data IO17*/
// SCL, SDA new 26 and 25
#define OLED_IIC_SCL_NUM (gpio_num_t)26 /*!< gpio number for I2C master clock IO26*/
#define OLED_IIC_SDA_NUM (gpio_num_t)25 /*!< gpio number for I2C master data IO25*/
// also
// #define OLED_IIC_NUM I2C_NUM_0 /*!< I2C number >*/
#define OLED_IIC_NUM I2C_NUM_1 /*!< I2C number >*/
pins for CS, DC, RST are set different to the shematic and header too
sry i have no Azure Board hardware to test this byself but i think it is a Oled driver Problem with different OLED header and Pin setup in this. have a try and write how you can go on in this and which solution was helping you
also see
the issue on git and the suggestion ( you are not allone with this problem )
you can perhabs download the
PDF from espressif
or here
hope this helps
best wishes
rudi