Content originally posted in LPCWare by fanzcsc on Tue Aug 14 10:17:16 MST 2012
We're receiving 16-bit data frames into an LPC1313/1343 MCU's SSP unit. The MCU SSP is configured as a slave. Data comes from a peripheral who's clock we don't
control. We also do not signal the start of data sending. If we enable SSP reading at any given time, the first bit received may not be the start of the data frame. We need to fix this alignment issue and ensure that the first byte received in the SSP's FIFO is the start of a data frame.
We do have a signal that can indicate the start of a data frame. We can interrupt on this and immediately clear the FIFO to sync the buffer data with the start of the data frame. However, because data comes in quite fast, I'm concerned that we may not be able to respond in time. In order to clear the FIFO on a GPIO interrupt, we'd need to respond in 1/2 of the SPI CLK rate or, let's say, ~100 MCU clocks. Our MCU also works as a slave for another serial line that also requires a high priority interrupt.
So... is it possible to configure the SSP's SSEL input in hardware so that an edge indicates a data frame start? It could
- clear the FIFO on an SSEL edge,
or
- prevent filling the FIFO until the next SSEL edge
If this isn't supported in the LPC1313 or 1343, is there another model that has this?
Thanks,
Fan