Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mgolu
New Contributor II
943 Views

I2C - hanging in write function

I'm trying to send some data via I2C interface as below

# define MAX_RETRY_COUNT 5

int retry_count = 0;

qm_i2c_status_t status = 0;

qm_i2c_status_t *ptr_status = &status;

uint8_t all_data[] = {0b00000000, 0b01000000}; //cmd + on

/* Master read all registers*/

while ((qm_i2c_master_write(QM_I2C_0, SSD1306_ADDRESS_WRITE, all_data, sizeof(all_data), true, ptr_status) != 0) && (retry_count < MAX_RETRY_COUNT)) {

retry_count++;

}

but nothing is sent and program is hanged into below "while" any idea why ?

/* this is a blocking call, wait until FIFO is empty or tx abrt

* error */

while (!(controller->ic_status & QM_I2C_IC_STATUS_TFE))

;

0 Kudos
2 Replies
idata
Community Manager
78 Views

Hi Mark,

Thanks for contacting us!

I appreciate the information provided, however, I would like to know if you can share your code in order to try to test it and give you further assistance, also, we would like to know which I2C device you are trying to communicate to.

Moreover, I have found this link: http://www.allaboutcircuits.com/projects/quark-d2000-development-board-i2c-interfacing-add-light-sen... Quark D2000 I2C Interfacing, there you can find helpful information regarding the use of the d2000 i2c, it might be interesting.

Regards,

-Yermi

idata
Community Manager
78 Views

Hi Mark,

We would like to know if you still need assistance in this case, if so, could you please provide the information requested above?

Regards,

-Yermi

Reply