Emulating an SPI bus on a SAM3X

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

Posts: 1
Joined: Fri Jul 10, 2015 6:36 pm

Emulating an SPI bus on a SAM3X

Fri Jul 10, 2015 7:01 pm

Hello, I would like to know if it is possible to emulate a SPI master-like behavior with an SSC peripheral on a SAM3X. Basically I just need a TX clock, a TX data and a RX data (I can drive the chip select manually). The TX clock has to be active only when I send data on TX, and it has to be used also to receive data on RX.
Based on the datasheet this should be possible with a configuration like this:

SSC_TCMR.CKS=0 (TK clock generated from MCK)
SSC_TCMR.CKO=2 (TK clock active only during data transfer)
SSC_RCMR.CKS=1 (receive clock taken from TK clock signal)
SSC_RCMR.START=1 (start on transmit start)

Sadly, this doesn't work. The TX part is ok (TX and TK are activated when I write data on THR, all flags are as they should be) but the RX part isn't. As soon as I set SSC_RCMR.CKS=1, the data is received continuously, not waiting at all the transmissions.

I've tried to modify the registers in several ways, but I didn't manage to obtain a result.

What am I missing?

Thank you!

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 3 guests