This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADC101C027: adc

Part Number: ADC101C027

hai,

i am using pic 24f series as I2C master and I2C slave is adc101c027, SCL is 400KHz, address pin of ADC101C027 is floating thus its address according to its datasheet is 50h. I want to read the data in conversion register, whose addr is 00h, the ide i am using is MPLAB v8.53(c30 compiler). first i send addr 50h, then i send addr 00h after that a repeated start, then again 50h with read bit set. is this way correct?

  • Hello,

    Are you still having trouble communicating with the device?

    If the address pointer is not preset, then your flow seems to be generally correct.

    First a start, then slave address, a write bit,

    the address pointer, a Repeated Start (if appropriate), the slave address, and a read bit

    Figure 27 in the datasheet can help to further understand this

    Regards

    Cynthia

  • hai,

    in datasheet page 24, 2 ways for read operation is given , i didn't understand how to preset the address pointer. i coded as per figure 27.

    starti2c- setting start bit

    write slave address(50h) including read bit it becomes A0, then i send conv reg add 00(write bit set), then repeated start, again send address with read bit set(A1) , wen i read the value in I2c rcv register in pic24f. it returns 0b, as per datasheet for reading 2nd byte i have send ack, i did so, then again called read function. but this time also i am getting 0b. since adc conversion reg is 16 bit i have to get 2 byte data, as the converted data remains d[11:2] of register. i2c rcv reg of pic is 8 bit . i am confused at this point . please help to figure out this condition

  • Hello,

    Figure 27 is a good example of how to write to the pointer and then read. To read a conversion result, I suggest using a KNOWN DC value at the input, so you know what you should expect as the output.

    The first frame, you are doing is correct, sending the address with a Write bit.

    After this, the second frame, you need to set the pointer register, shown below. To read the conversion result, you need to set the last three bits to 0, thus the command will be 0h.

    The third frame, the master will do a repeat start. Then address byte from frame 1 is sent again, but with the read bit set, which means it will be: A1h

    the last two frames will be the conversion result.  Note though that the conversion result is from bits 2-11. the conversion result register is shown below