This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem with DM648 SPI

Hi,

     When I use SPI to control peripherals(MCP2515,FRAM), it requires that the SPI CS signal is  pulled low  at first and then raised after read/write is done. For DM648, SPI CS pin cannot be configured as GPIO, referring to the PINMUX0 register description.

    So,how to control the CS state in the software? 

BR,

Joshua

  • Hi Joshua,

    The DM648 device has 2 dedicated CS signals (SPICS1/UARTTX, SPICS2/UARTRX). So there is no need to configure GPIO as chip select for SPI access.

    Since the SPI controller has dedicated chip select signals, the controller itself will take care of the CS transitions.
  • Arvind Singh said:
    Hi Joshua,

    The DM648 device has 2 dedicated CS signals (SPICS1/UARTTX, SPICS2/UARTRX). So there is no need to configure GPIO as chip select for SPI access.

    Since the SPI controller has dedicated chip select signals, the controller itself will take care of the CS transitions.

    If I read/write a spi peripheral, I should do the following steps according to the peripheral datasheet:

    SPI_activate_cs();

    SPI_master_transmit(CMD_WRITE);

    SPI_master_transmit(addr);

    SPI_master_transmit(data);

    SPI_deactivate_cs();

    How should I implement the two functions: SPI_activate_cs() ,SPI_deactivate_cs() , since the CS pin can't be configured as GPIO on DM648?

  • Hi Joshua,

    You can use any GPIO line (it may not be SPI's CS) and make that GPIO to low in "SPI_activate_cs();" function to active SPI transfer and make it high in "SPI_deactivate_cs();"

    But you must connect that GPIO to MCP2515FRAM's CS pin to drive the FRAM.

    How did you connect that MCP2515FRAM's CS pin to processor (hardware) ?

    I hope it helps.

  • Hi Titusrathinaraj,

    Thank you for your quick reply.  On my DM648 board, the spi devices' CS pin are directly connected to DM648 SPICS pins. Since the SPICS cannot be configured as GPIO, the way you mention can't work.

     Is it possible to pull up or raise the SPICS pin by configuring some DM648 SPI registers?   I read the DM648 SPI user's guide, but I'm not sure which register I can use.

    BR

    Joshua 

  • Hi Joshua,

    Which CS pin was connected to FRAM ?

    You need to configure (PINMUX) that particular SPI's CS pin for SPI data transfer into FRAM.

    Then SPI controller will take care of CS pin activity when you transfer.
    It would get assert (pulled low) automatically when you do transfer and get de-asserted (pulled high or drive high) when you stop the transfer or after data transfer.

    Please refer to the SPI user guide of DM648.