Hello,
I have a pic32 Starter Kit with i/o expansion board. I am trying to set up uart communication between the starter kit and my pc using 2 XBee Pro 50mW Series 2.5 Chip Antenna(2.4GHz XBee XBP24-BCIT-004 ). I have the Starter Kit connected to the first XBee module (XBee1) which is mounted in a breakout board on my solderless breadboard. XBee1 is powered by a 3.3V regulated power supply on the breadboard. The second XBee module (XBee2) is mounted on an XBee USB Explorer that is connected by USB to my pc. The connections between XBee1 and the Starter Kit(SK) are as follows:
- SK UART2 RX to XBee1 DOut (with a 15k ohm resistor in series)
- SK UART2 TX to XBee1 Din (with a 15k ohm resistor in series)
- LEDs from the XBee1 power pin and associate pin to ground (with resistors in series)
- 3.3V from the breadboard regulated power supply to XBee1 Vcc
- XBee1 GND to breadboard regulated power supply ground
- common ground between breadboard regulated power supply, XBee1, and Starter Kit
I do not have U2CTS or U2RTS connected to anything.
I tested this configuration with an Arduino I had laying around and was able to send and receive data between XBee1 and XBee2 with no problem, so I know that the XBee modules are configured correctly. The XBees are set to 9600 baud, 8-N-1, no flow control.
When I power everything up, the LEDs turn on and the associate LED begins to blink as it should. However, I am not receiving any data from the Starter Kit via UART.
Do I have to use U2CTS and U2RTS?
Do I have to configure the UART2 RX and TX pins in code in a way other than I have?
I have written a very simple bit of code to test this set up. If anyone can think of what I am doing wrong I would be very appreciative.
#include
// Configuration Bit settings //
SYSCLK = 80 MHz (8MHz Crystal/ FPLLIDIV * FPLLMUL / FPLLODIV) // PBCLK = 40 MHz // Primary Osc w/PLL (XT+,HS+,EC+PLL) // WDT OFF
#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF #pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_2 //Fpb=40,000,000
int main(void) { SYSTEMConfigPerformance(80000000L);
long i;
// Open UART2 with Receive and Transmitter enable.
OpenUART2(UART_EN, UART_RX_ENABLE | UART_TX_ENABLE, 259); //(Fpb/16/9600)-1=259
while(1) { for(i=0; i<2000000; i++); // put a delay
//send the letter "a" over UART2
putsUART2("a
"); };
return 0; }