I am using the SPIUARTTERMINAL code to test to see if the SPI-Uart Bridge is working properly. Using the code, the code stops at “Attempting to connect to SPI UART…” Besides pin connections of the SPI-UART Bridge connected to the Arduino (particularly I am using the Mega) that could be a problem, what is a potential problem that prevents the code to go through? For easy access here is the code:
void setup() {
Serial.begin(9600);
Serial.println(“SPI UART on WiFly Shield terminal tool”);
Serial.println(“--------------------------------------”);
Serial.println();
Serial.println(“This is a tool to help you troubleshoot problems with the WiFly shield.”);
Serial.println(“For consistent results unplug & replug power to your Arduino and WiFly shield.”);
Serial.println(“(Ensure the serial monitor is not open when you remove power.)”);
Serial.println();
Serial.println(“Attempting to connect to SPI UART…”);
SpiSerial.begin(9600);
Serial.println(“Connected to SPI UART.”);
Serial.println();
Serial.println(" * Use $$$ (with no line ending) to enter WiFly command mode. ("CMD")");
Serial.println(" * Then send each command followed by a carriage return.");
Serial.println();
Serial.println(“Waiting for input.”);
Serial.println();
}
void loop() {
// Terminal routine
// Always display a response uninterrupted by typing
// but note that this makes the terminal unresponsive
// while a response is being received.
while(SpiSerial.available() > 0) {
Serial.print(SpiSerial.read(), BYTE);
}
if(Serial.available()) { // Outgoing data
SpiSerial.print(Serial.read(), BYTE);
}
}