Using Serial to Parallel Interface (SPI) Block

Using Serial to Parallel Interface (SPI) Block

Communication Protocols Technique

This technique is for the Serial to Parallel Interface (SPI) block, available in the SLG46140, SLG46620, and SLG46621.

The SPI block is a special macrocell that can be used for communication between a GreenPAK and a SOC. It can either translate serial data to parallel or parallel data to serial. The inputs are standard SPI I/O connections (MOSI, MISO, nCSB, SCLK, and OUTs). nCSB is an active low chip select. SCLK is the serial clock which clocks the SPI macrocell.

The SPI can be used to transfer data to such blocks as:

  • FSM
  • DCMP
  • DAC (through DCMP

The same SPI can be used to transfer data from:

  • ADC
  • FSM

All this can be used with other macrocells for functionality like:

  • Pulse Width Modulation
  • Analog to Digital Comparison
  • Digital to Analog Comparison
  • Comparing two results with DCMP
  • SDIO and LCD

The SPI can be selected to work in either 8-bits or 16-bits. Remember that the SPI macrocell cannot send and receive serial data in the same program file. It must be set up either in the S2P or P2S mode.

In the P2S mode, the “INTR” pin pulses high for one clock period each time data after transmission completes.

Otherwise, the SPI implemented in GreenPAK meets the generally accepted standard. It is possible to set the clocking frequency up to 2 MHz. It is also possible to configure the clock polarity with the CPOL bit and clock phase with the CPHA bit. When CPHA = 0, data can only be transmitted from serial to parallel, not from parallel to serial. When CPHA = 1, data can be transmitted both from serial to parallel and from parallel to serial.

Resources

GreenPAK Designer files