是否可以在两个 TFT 显示器和 AD9850 信号发生器之间共享 SPI 引脚?

Is it possible to share SPI pins between two TFT displays and AD9850 signal generator?

这个有点棘手,因为 AD9850 没有 CS 引脚。TFT 显示器有。因此,在显示器之间共享引脚(当然除了 CS)似乎很简单,但我们如何同时使用 AD9850:Do we need to use separate pins for AD9850 with bit-banging, or is it possible to share所有三个设备都在同一个引脚上?

注意AD9850并没有真正的SPI接口,但串行接口的时序似乎是兼容的,所以你可以使用SPI主控来写入AD9850。但是,需要另一个引脚 (FQ_UD) 来更新数据。

正如您已经提到的,主要问题是它没有芯片 select (CS) 输入。这意味着串行接口上​​的所有数据都将由 AD9850 提供时钟。 datasheet:

中清楚地记录了并行模式的行为

In the parallel load mode, the register is loaded via an 8-bit bus; the full 40-bit word requires five iterations of the 8-bit word. The W_CLK and FQ_UD signals are used to address and load the registers. The rising edge of FQ_UD loads the (up to) 40-bit control data-word into the device and resets the address pointer to the first register. Subsequent W_CLK rising edges load the 8-bit data on words [7:0] and move the pointer to the next register. After five loads, W_CLK edges are ignored until either a reset or an FQ_UD rising edge resets the address pointer to the first register.

根据我的解释,这意味着如果您要向它写入 10 个字节,则会存储前 5 个字节(并将使用 FQ_UD 信号“激活”),最后 5 个字节被忽略。这在您的用例中是有问题的。

对于串行模式,确切的行为记录稍少,但似乎大致相同:

In serial load mode, subsequent rising edges of W_CLK shift the 1-bit data on Pin 25 (D7) through the 40 bits of programming information. After 40 bits are shifted through, an FQ_UD pulse is required to update the output frequency (or phase).

那你能做什么呢?

  • 最佳解决方案是为 AD9850 使用专用接口。这将需要 3 个引脚并让您完全控制所有设备。我 highly 推荐这个如果你有可能这样做(也就是说,如果你可以控制硬件和足够的可用引脚)。

  • 如果您只需要在启动期间写入 AD9850,您可能可以通过首先配置 AD9850(禁用用于 TFT 显示器的芯片 selects)和然后配置显示(虽然从不切换 FQ_UD,因此 AD9850 的配置将不再更新)。这取决于您的具体用例,我怀疑会是这样。

  • 我还想知道您是否可以通过切换 FQ_UD 然后立即写入正确的配置来“清除”输入到 AD9850 的无效数据。但是,这似乎很危险,因为某些控制代码可能会使设备变砖:

    There are specific control codes, used for factory test purposes, that render the AD9850 temporarily inoperable. The user must take deliberate precaution to avoid inputting the codes listed in Table II. If you can guarantee there will be no invalid codes and you can accept invalid configurations for a short time, this is something you could consider, but I think it's asking for troubles.

注意:我的第一个建议是对 AD9850 进行一些测试,以确认我对数据表的解释是否正确。用移位寄存器实现串行接口是很常见的,在这种情况下,只会使用 last 40 位(而不是前 40 位)。恕我直言,数据表没有明确确认或否认这一点。如果它确实使用了最后 40 位,那么共享引脚就很简单了。