Module Hardware Interface

The Module supports either [Serial Peripheral Interface Bus] (SPI) OR a [Universal Asynchronous Receiver/Transmitter] (UART) interface. For very simple applications, the UART interface is easier, but the SPI interface is actually easier if you are building a robust application, since you immediately get the responses from the IC. In a UART application the state machine will need to wait between each message received from the Module.

Using the UART interface
The most common problem encountered with getting the UART interface working is with the flow control pins. Be sure that you configure all the pins correctly. Select the UART functionality on your microcontroller for the Tx/Rx signals and verify that the pin labeled "Tx" on the microcontroller is connected to the pin labeled "Rx" on the radio, and vice versa. You will need to configure the microcontroller signal for RTS (Ready to Send). The signal RTS is an OUTPUT from the Module and is asserted logic high when the Module is busy. This will typically be asserted on longer messages. This signal needs to be connected to an input pin on the microcontroller and the microcontroller MUST pause transmitting when this signal is asserted. In our sendMessage method, we simply check RTS prior to sending each byte, if RTS is asserted (logic high) then we just wait. For example:

//send message out to the radio for (char i = 0; i<bufIndex; i++) {  while (P1IN & BIT1) ;   			//P1.1 is RTS - if HIGH then do not send, just wait! while (!(UC1IFG&UCA1TXIFG));                // USCI_A1 TX buffer ready? UCA1TXBUF = c;                    		// TX  character } If using a Stellaris processor then you need to be a little careful, since these have a FIFO queue on the UART. Stopping sending bytes into the queue won't work; you need to stop the flow out of the queue. For example:

if (GPIOPinRead(GPIO_PORTD_BASE, RADIO_RTS)) 			       //if RTS is high (asserted) {  HWREG(UART1_BASE + UART_O_CTL) &= ~UART_CTL_TXE;  	//	...turn off UART TX } else {  							       //if RTS is low HWREG(UART1_BASE + UART_O_CTL) |= UART_CTL_TXE; 	//	...turn UART TX back on } Danger: If RTS is not configured correctly then some of the messages will work but the longer commands will not; the Module will just ignore them and behave erratically. CTS (Clear to Send) is an optional input to the Module to instruct it to pause transmitting. Use this if your application cannot receive a message or has a full buffer. It is optional and most applications don't use it. Please note: the UART interface is EXPERIMENTAL and only supported on the Module Development Board 1 (MDB1).

Using the SPI
The examples are written for the SPI because it is faster and ties up the processor for less time. When using a different microcontroller with the Module: Using SPI has a few little tricks, like the write-to-read functionality as well as the timing. Follow the examples and when in doubt, refer to a logic analyzer.
 * Be sure that you configure CS to be active LOW
 * Check the Clock Polarity and Phase with the examples

If you are seeing RESET_IND correctly but no other commands, check that MRDY is connected. The examples are written with MRDY connected to CS, although it could be controlled separately.