altos: Crank down STM SPI speed for MM
authorKeith Packard <keithp@keithp.com>
Thu, 21 Jun 2012 16:46:50 +0000 (09:46 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 21 Jun 2012 16:46:50 +0000 (09:46 -0700)
The cc1120 is noisy enough to break SPI data transfers at 4MHz, so
crank things down to 1MHz. It's "stable" now, but clearly needs a
filter and shorter traces.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_spi_stm.c

index 8784d98564feeb5f45e914ed014d8e3824a7269a..d337864816392b04a2f5507a56dcf20bfbeea271 100644 (file)
@@ -282,7 +282,7 @@ ao_spi_get(uint8_t spi_index)
                        (1 << STM_SPI_CR1_SSI) |                        /*  ... */
                        (0 << STM_SPI_CR1_LSBFIRST) |                   /* Big endian */
                        (1 << STM_SPI_CR1_SPE) |                        /* Enable SPI unit */
-                       (STM_SPI_CR1_BR_PCLK_8 << STM_SPI_CR1_BR) |     /* baud rate to pclk/4 */
+                       (STM_SPI_CR1_BR_PCLK_16 << STM_SPI_CR1_BR) |    /* baud rate to pclk/4 */
                        (1 << STM_SPI_CR1_MSTR) |
                        (0 << STM_SPI_CR1_CPOL) |                       /* Format 0 */
                        (0 << STM_SPI_CR1_CPHA));