Hi,
I need to configure LPSPI in half duplex 4-bit mode, because the slave device(not a flash memory) communicates via QSPI interface. I understand that to do this, I must configure LPSPI1 in half duplex mode, and set PCCFG = 1, to get PCS2 and PCS3 and D2 and D3 respectively. However, I have the following doubts:
1. How do I configure all the data lines (D0, D1, D2, D3) as bidirectional lines? I did see details about the PINCFG bit, but from what I understood, it can configure only either the SDI pin or the SDO pin as bidirectional.
2. How do I tell my microcontroller to change the direction of the pin from output to input? For example, when sending the command word, the lines must be "output". But just before the slave sends the data, the direction must switch to "input". How can this be done?
Any help would be appreciated.
Solved! Go to Solution.
Hi,
Did you mean PCSCFG instead of PCCFG?
I'd recommend you to take a look to Chapter 70 in the RM.
In section 70.5.1.15 you can find the Transmit Command Register. I believe you are probably missing some settings in this register.
Have you tried modifying the RXMSK, TXMSK and WIDTH fields?
For instance, WIDTH = 10, and if you want to read set RXMSK = 1, if you want to write set TXMSK = 1.
I hope this helps,
Daniel.
Thanks, I will try these.
Hi,
Did you mean PCSCFG instead of PCCFG?
I'd recommend you to take a look to Chapter 70 in the RM.
In section 70.5.1.15 you can find the Transmit Command Register. I believe you are probably missing some settings in this register.
Have you tried modifying the RXMSK, TXMSK and WIDTH fields?
For instance, WIDTH = 10, and if you want to read set RXMSK = 1, if you want to write set TXMSK = 1.
I hope this helps,
Daniel.