ADI GMSL2 SERDES SPI

https://www.analog.com/media/en/technical-documentation/user-guides/gmsl2-general-user-guide.pdf

https://www.analog.com/media/en/technical-documentation/data-sheets/max96752.pdf

https://www.analog.com/media/en/technical-documentation/data-sheets/max9295d.pdf

GMSL2 General User Guide

Key Features

• Four-wire main (connects to remote peripheral) or four-wire subordinate (connects to µC/SoC).

• Remote-side SPI bus supports SPI modes 0 or 3; local-side SPI bus supports SPI mode 0.

• Device filtering on (multiple SPI interfaces with different SPI IDs) or off (point-to-point SPI interface).

• Subordinate Select active low or high.

• 600kHz to 25MHz or 50MHz SPI clock (depending on device).

• MSB first (for control commands).

• Pin or I2C control of RO and BNE input/output.

18.Serial Peripheral Interface

image.png

18.3.3.1 SPI Burst Write

  1. Set RO.
  2. Send 0xA0 (Set SPI Target = 0, optional if only one device).
  3. Send 0xA4/A5 (Assert SS1/SS2).
  4. Clear RO.
  5. Send Cmd Byte (Read/Write and Address MS bit).
  6. Send Addrs Byte.
  7. Send Write Byte.
  8. Set RO.
  9. Wait for BNE = 1.
  10. Send 0xA6/Read Byte (Discard).
  11. Clear RO.
  12. Repeat 7 - 11 until all data is written.
  13. Set RO.
  14. Wait for BNE = 1.
  15. Send 0xA6/Read Byte (Discard) (Clear SS).
  16. Send 0xA6/Read Byte (Discard) (Clear SS).

18.3.3.2 SPI Burst Read

  1. Set RO.
  2. Send 0xA0 (Set SPI Target = 0, optional if only one device).
  3. Send 0xA4/A5 (Assert SS1/SS2).
  4. Clear RO.
  5. Send Cmd Byte (Read/Write and Address MS bit).
  6. Send Addrs Byte.
  7. Set RO.
  8. Wait for BNE = 1.
  9. Send 0xA7/Read Byte (Read Data) (Discard first two reads, remaining are valid).
  10. Repeat Steps 8 - 9 until all but two bytes are read.
  11. Wait for BNE = 1.
  12. Send 0xA6/Read Byte (Valid Data) (Clear SS).
  13. Send 0xA6/Read Byte (Last Valid Data) (Clear SS).

硬件框图

image.png

SPI 初始化

详细寄存器描述可以参考官网提供的 DataSheet

IndexDeviceRegValueDesc
1MAX9295D0x1730xFA
2MAX9295D0x1740xFASCK 600KHz
3MAX9295D0x1750xFASCK 600KHz
4MAX9295D0x1760x0C
5MAX967520x4E60x030x4E6 0x4F6
6MAX967520x4E90x000x4E9 0x4F9
7MAX9295D0x1720x00#SPI mode 0
8MAX967520x4E00x090x4E0 0x4F0
9MAX9295D0X1700X0B

SPI mode 0 的波形

image.png

image.png

image.png

image.png

SPI mode 3 配置

0x172 设置 0x0C OK

image.png

image.png

image.png

错误的配置:0x172 设置 0x04

image.png

image.png

image.png