Other Parts Discussed in Thread: CC2541, , CC2543
Hi guys,
I'm using a CC2533F96 to communicate (SPI master) with an external flash (SPI slave). When I use USART1 Alt. 2 (MISO P1.7 MOSI P1.6 SCLK P1.5), I'm able to get the manufacturer/device information from the slave (observed by debugging in IAR as well as using the Saleae logic analyzer).
However, when I use USART0 Alt. 2 (MOSI P1.5 MISO P1.4 SCLK P1.3), there is no clock generation neither outputed signal on MOSI pin .
For both implementations, I'm using SS P1.2 as GPIO output with the same configuration.
Here the code for both solutions:
// UART1 Alt. 2 in SPI mode /* Mode select UART1 SPI Mode as master. */ U1CSR = 0; /* Setup for 250kHz baud. */ U1GCR = 13; U1BAUD = 0; /* Set bit order to MSB */ U1GCR |= BV(5); /* Set UART1 I/O to alternate 2 location on P1 pins. */ PERCFG |= 0x02; /* U1CFG */ /* Select peripheral function on I/O pins but SS is left as GPIO for separate control. */ P1SEL |= 0xE0; /* SELP1_[7:4] */ /* Give UART1 priority over Timer3. */ P2SEL &= ~0x20; /* PRI2P1 */ /* When SPI config is complete, enable it. */ U1CSR |= 0x40;
and
// UART0 Alt. 2 in SPI mode. /* Mode select UART0 SPI Mode as master. */ U0CSR = 0; /* Setup for 250kHz baud. */ U0GCR = 13; U0BAUD = 0; /* Set bit order to MSB */ U0GCR |= BV(5); /* Set UART0 I/O to alternate 2 location on P1 pins. */ PERCFG |= 0x01; /* U0CFG */ /* Select peripheral function on I/O pins but SS is left as GPIO for separate control. */ P1SEL |= 0x38; /* Give UART0 priority */ P2DIR &= ~0xC0; /* PRIP0 */ P2SEL &= ~0x40; /* PRI3P1 */ P2SEL &= ~0x08; /* PRI0P1 */ /* When SPI config is complete, enable it. */ U0CSR |= 0x40;
There is no other peripheral connected to the microcontroller.
It is a custom board where the pins can be switched in order to route the signals in the desired way. All pins have been tested and there is no electrical problem.
What could be wrong?