Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] SPI MOSI line control override

Status
Not open for further replies.

ArticCynda

Advanced Member level 1
Joined
May 8, 2013
Messages
439
Helped
82
Reputation
164
Reaction score
81
Trophy points
1,308
Activity points
4,238
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!
 

The datasheet says DIN should be held low while reading data, not DIN must be hold low permanently. The former will be easily achieved by sending all zero data while reading.
 
You're right as usual FvM, that worked! The text and timing diagram suggest different things, that's what got me confused. Thanks for the help!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top