This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I2c protocol.

Dear Sir,

i am using pca10001.

Actually i tried to read and write the data from EEPROM having address 0x50 though i2cbus.

i made po.0 and p0.1 as output pin then clk and sda pin respectively.

i done every thing. but once i start NWF_TWI0->STARTTX=1;

i am not geeting ack from slave.

infact ERRORSRC=2 and EVENTS_ERROR=1.

Is it needed to make data pin again as input to get ack from slave.

and is needed to send slave address or just put in ADDRESS register is sufficient. Kindly suggest me.

if you want i will post my code also.

Regards Balaji

Parents
  • Can you what is 7 bit address of Sensor.

    and tried with

    uint8_t addr=7bitaddress ; uint8_t addW=(addr<<1); uint8_t addR=(addr<<1)|0x01; uint8_t dataW[2] = {0X03, 0x83}; uint8_t dataR[2]={0x00}

    twi_master_init() twi_master_transfer(addW,dataW,2,1); nrf_delay_us(400); twi_master_transfer(addW,&dataW[0],1,0); nrf_delay_us(400); twi_master_transfer(addR,dataR,1,1); nrf_delay_us(400);

    check 0x03 is read only register or R/W register.

    Regards Balaji

Reply
  • Can you what is 7 bit address of Sensor.

    and tried with

    uint8_t addr=7bitaddress ; uint8_t addW=(addr<<1); uint8_t addR=(addr<<1)|0x01; uint8_t dataW[2] = {0X03, 0x83}; uint8_t dataR[2]={0x00}

    twi_master_init() twi_master_transfer(addW,dataW,2,1); nrf_delay_us(400); twi_master_transfer(addW,&dataW[0],1,0); nrf_delay_us(400); twi_master_transfer(addR,dataR,1,1); nrf_delay_us(400);

    check 0x03 is read only register or R/W register.

    Regards Balaji

Children
No Data
Related