RedBearLab / nRF51822-Arduino

Moved to https://github.com/redbear/nRF5x
252 stars 109 forks source link

does Wire library send Stop condition? #81

Open shirish47 opened 7 years ago

shirish47 commented 7 years ago

I am using AT24C512 EEPROM but once the device access the chip it does not go to low power. I am currently keeping the nrf51822 in sleep. when I press button I am storing it to EEPROM and sleeping again. but now I checked the current after this implementation and I am getting 3.4mA of current. if I reset the whole system. power is below mA(I am using INA219 for measuring current). but as soon as EEPROM operation is done its not going below 3.4mA. As the AT24C data sheet shows on stop bit it should go to standby mode and use less current(3-6uA). does the Wire library sends the stop condition after every transmission?

shirish47 commented 7 years ago

I checked wire.h on mbed ble. it has following line for stop condition. if(issue_stop_condition) { twi->EVENTS_STOPPED = 0; twi->TASKS_STOP = 1; while(twi->EVENTS_STOPPED == 0) { //do nothing, wait for stop sequence is sent } } return 0; } while in wire.cpp I downloaded from this repo has if(stop) i2c_reset(&i2c); I want to save power after every operation to EEPROM AT24C512. So I have to send stop signal so AT24C can go in standby mode. please help. why does redbear implementation resets?