New guy here trying to talk to an AD board via SPI. Was hoping someone might help me troubleshoot.
I have an ATmega2560 attached to a STK600 development board. I'm trying to get data off of a LTC2440cgn AD board. But all I get out is 0...
The AD board is 24 bit resolution, but produces a 32 bit value with the data being in bits 5-28... so I figure first I need to read in 4 bytes from the AD via SPI. Then I combine 4 those four bytes into one and peel off the data bits. Then I send the 8 most significant bits to LEDs to see if I'm getting anything.
Here is my function to initialize the SPI...
void InitSPI(void) { //SPI is done through PORTB. SS is pin0, SCK is pin1, MOSI is pin2 DDRB = (1