I have a problem with Raspberry Pi 3b+.

I need to connect two DACs (MCP4911) to SPI bus 1. The two DACs are expected to output the different DC voltage level.

However, I found that when I connected the SCK (pin40, BCM21) to two DACs (DAC A use SPI1CE2, DAC B uses SPI1CE1) at the same time, then both two DACs will not work properly (i.e. the output remains unchanged, no matter what numerical values I send). If I disconnected the CLK to DAC B, then the data can be properly sent to DAC A.

I want to know whether it is a hardware problem or a coding problem. How should I control two DACs with Python?

  • It sounds like a wiring problem. If you want help add clear photos of the connections and a listing of the software you are using to read the devices. – joan Oct 13 '19 at 17:39
  • @realypz, Ah let me see. First thing first, let us do it step by step. Do you mean the following: (1) DAC 1 works OK, if only it is connected, (2) DAC 1 is not working, as soon as DAC2 joins in. (3) If DAC2 unplugged, DAC1 works again. Obviously DAC2 is trouble making bad guy. To make sure, you can swap CE0/1 to compare and contrast. Or even go further, swap DAC1/2's SCL/SDA wires to locate the bad wire. "MCP4911 SPI DAC" ww1.microchip.com/downloads/en/DeviceDoc/22248a.pdf – tlfong01 Oct 14 '19 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy