Hi,
whenever I set my SPI clock to a value other than 24 MHz, I see no activity on SCK. Here is the value I use for CTAR0:
Transfers are then initiated by writing to PUSHR, using these functions:
This works on my breadboard, though I have serious doubts that a breadboard would allow such speeds. But the connected display does what I tell it to, and the onboard LED seems to be on (it must be flashing at an insane speed).
Whatever change I make to the SCK speed (enable double baud rate, different PBR, different BR), the display displays some garbage and the onboard LED seems to be off.
Has anyone else seen this behavior? What could be wrong in my setup or usage of the SPI?
Regards
Christoph
whenever I set my SPI clock to a value other than 24 MHz, I see no activity on SCK. Here is the value I use for CTAR0:
Code:
SPI0_CTAR0 = SPI_CTAR_FMSZ(7) | SPI_CTAR_PBR(0) | SPI_CTAR_BR(0)
Code:
void spi_out_1(const uint8_t val)
{
while (!(SPI0_SR & SPI_SR_TFFF)) // wait for space in FIFO
;
SPI0_PUSHR = val; // write byte
while(!(SPI0_SR & SPI_SR_TCF)) // wait for transfer complete
;
SPI0_SR = SPI_SR_TCF; // clear transfer complete flag
}
void spi_out_stream(const uint8_t val)
{
while (!(SPI0_SR & SPI_SR_TFFF)) // wait for space in FIFO
;
SPI0_PUSHR = val; // write byte
}
void spi_out_last(const uint8_t val)
{
while (!(SPI0_SR & SPI_SR_TFFF)) // wait for space in FIFO
;
SPI0_PUSHR = val | SPI_PUSHR_EOQ; // write byte (end of queue)
while(!(SPI0_SR & SPI_SR_EOQF)) // wait for end of queue
;
SPI0_SR = SPI_SR_EOQF; // clear end of queue flag
}
Whatever change I make to the SCK speed (enable double baud rate, different PBR, different BR), the display displays some garbage and the onboard LED seems to be off.
Has anyone else seen this behavior? What could be wrong in my setup or usage of the SPI?
Regards
Christoph