Hallo,
i'm using the ADC128D818. I'm able to communicate with the device. I can read and write data to and from the registers.
But i don't understand how i can read the channel reading registers.
My Initialization routine is:
1. Load the default value form the Configuration Register (0x08h)
2. Check if Device is converting-> read Busy Status Register -> if it is not working an ready go head
3. Set operation mode to 1 and use external ref -> write to the Advanced Configuration Register (0x03h)
4. Set a Continuos Conversion Mode -> write to the Conversion Rate Register (0x01h)
5. Enable all Inputs -> write to the Channel Disable Register (0x00h)
6. Set Limit Registes-> write to all High Registers (0xFFh) and to all Low Registers (0x00h)
7. Start the device -> write to the Configuration Register (0x01h)
If i check by reading the registers, all the values are assumed.
Then i will read the channel inputs. But only the last 8bits from the 16-bit register are correct.
My Routine:
Write to device the register addresse from the disired input channel (20h-27h). Then read the next to bytes from the channel.
send( DEVICE_ADDRESS, CHANNEL1_REG);
read( DEVICE_ADDRESS, DATA, 2); -> DATA is an unsigned int 8 bit array with size 2.
For example i know the channel 1 has a 5V input, so i would expect on the channel reading register a value of 0x0FFF.
But i only get 0x00FF.
Have someone a advice what could be wrong?