ArticCynda
Advanced Member level 1
Hi everyone,
I'm trying to write a software driver for the AD7689 8 channel 16 bit ADC on an Atmel ATmega328p microcontroller using the Arduino software framework. I can read back commands with a time shift of 2 frames, which proves that my hardware connections and SPI configuration are set up correctly.
However, using the internal channel sequencer of the AD7689 requires the DIN line (connected to MOSI) to be held low after the last command. See RAC mode in figure 41 on page 30 of the datasheet. However, as long as MOSI is under SPI control, the line idles high (has been verified on logic analyzer). This causes the channel sequencer to reset to channel 0 each frame, defeating its purpose.
Is there a way to override the MOSI output pin after shifting out the command to keep it low? I still need SCLK and MISO to work as they currently do, so I can't disable SPI control completely.
I already considered an external tristate buffer as a hardware solution, but this requires an extra digital IO pin and seems less elegant if a software solution is possible.
Thanks in advance!
I'm trying to write a software driver for the AD7689 8 channel 16 bit ADC on an Atmel ATmega328p microcontroller using the Arduino software framework. I can read back commands with a time shift of 2 frames, which proves that my hardware connections and SPI configuration are set up correctly.
However, using the internal channel sequencer of the AD7689 requires the DIN line (connected to MOSI) to be held low after the last command. See RAC mode in figure 41 on page 30 of the datasheet. However, as long as MOSI is under SPI control, the line idles high (has been verified on logic analyzer). This causes the channel sequencer to reset to channel 0 each frame, defeating its purpose.
Is there a way to override the MOSI output pin after shifting out the command to keep it low? I still need SCLK and MISO to work as they currently do, so I can't disable SPI control completely.
I already considered an external tristate buffer as a hardware solution, but this requires an extra digital IO pin and seems less elegant if a software solution is possible.
Thanks in advance!