ssd1306 oled on i2c not showing up ( esp Azure iot kit )

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ssd1306 oled on i2c not showing up ( esp Azure iot kit )

Postby ESP_Sprite » Thu May 09, 2019 11:30 am

Hmm, that almost sounds like your board is faulty... If you have a scope or LA, you can see if there actually are signals on the SCL/SDA pin, but if not, I'd contact wherever you got this board from, to see if you can get a replacement.

manjuk123
Posts: 7
Joined: Fri May 03, 2019 3:58 am

Re: ssd1306 oled on i2c not showing up ( esp Azure iot kit )

Postby manjuk123 » Thu May 23, 2019 12:53 pm

@ESP_Sprite Sorry for late reply. I saw your reply yesterday because this forum ui confused me a little and your reply was on the page 2 and I thought all the replies will be in the same page.

I bought a USB logic analyzer, i dont know how to debug it with this board. can you guide me or give me some links to go through on how to setup this.

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ssd1306 oled on i2c not showing up ( esp Azure iot kit )

Postby ESP_Sprite » Fri May 24, 2019 4:17 am

It depends on your logic analyzer, but normally you'd connect it to the I2C lines and see what signals are on that, and if it corresponds with what you send in software. I have no clue about good tutorials, but plunking "using logic analyzer i2c tutorial" into Google seems to bring up a fair amount of hits.

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ssd1306 oled on i2c not showing up ( esp Azure iot kit )

Postby rudi ;-) » Sat Aug 10, 2019 11:49 am

manjuk123 wrote:
Thu May 09, 2019 9:48 am
Nothing on the OLED too...
Hi

if you talk from the esp azure io kit


Image
Image
Image
Image

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


Image


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
Image


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
esp32-azure_iot_kit_hardware_design_guide__en.pdf
(4.77 MiB) Downloaded 547 times


hope this helps

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Who is online

Users browsing this forum: No registered users and 10 guests