Currently I am working with the ATxmega64A3 which receives information from a load cell through an AD7195 ADC. This ADC works with SPI, the microcontroller is configured as master and the ADC as slave. I am trying to build a function which reads the bits from the DATA register of the ADC. These bits are transferred through the MISO line (if I send a command to read from the DATA register first), if the same amount of bits is transferred through the MOSI line am I correct? This DATA register has 24 bits. So at first I have to send a byte through te MOSI line to tell the ADC that I want to read from the DATA register, after which I have to send 24 bits through the MOSI line to get 24 bits through the MISO line right? I tried this by sending 3 times 1 byte (1 variable of data type char) through the MOSI line. In this case I also receive 3 times 1 byte through the MISO line I figured. My problem however is that I don't know how to store those 3 bytes into 1 variable. I want to use this variable to convert to a decimal number. I tried searching google etc. but unfortunately I didn't find a solution for this problem.
Anyone knows how to solve this or have a better suggestion?
Thanks in advance,