Introduction: Introduce

Last time we have achieved “Interact AT command between pcDuino and Spyder” via USB port of pcDuino, today we are going to use the UART(GPIO 0, GPIO 1) on pcDuino to achieve powerline communication for pcDuino.

Step 1: Diagram

1. Connect Spyder’s pin 2 to GPIO 1 on pcDuino, spyder’s pin 3 to GPIO 0 on pcDuino, pin 10 to GND of pcDuino.

2.Connect the powerline interfaces of these two spyder and power them up( DC5-12V).

3.Power up pcDuino.

Step 2: Part List

  1. pcduino V2 x 1
  2. pcduino lite Wifi x 1 (Two pcDuino V2 would also be acceptable.) s
  3. pyder x 2
  4. jumper wires

Step 3: Sample Code

/*************

…. **************/ The code in above structure can achieve interacting AT command between pcDuino and Spyder, but this time we use UART of pcDuino instead of USB port. You can cancel the comments to see how it goes if you want, but do not forget to add these comments to the original code without comments. Code for pcDuino Lite wifi:

#include 
/*********************
static unsigned char i = 0;
void setup(){Serial.begin(9600);}
void loop(){if(i == 0)
{Serial.print(“+++”);
printf(“+++ have send!\n”);}
else if (i == 1)
{Serial.print(“ATSN”);Serial.print(‘\n’);
printf(“ATSN have send!\n”);}
else if (i == 2)
{Serial.println(“ATEX”);
printf(“ATEX have send!\n”);}
while(Serial.available() > 0)
{printf(“%c”,Serial.read());}i++;delay(3000);}
************************/void setup()
{Serial.begin(9600);}
void loop(){Serial.println(“Lite Wifi:520linksprite!”);
delay(1000);
while(Serial.available() > 0)
{char c = Serial.read();
printf(“%c”,c);}}
Code for pcDuino V2:
#include 
/********************* 
static unsigned char i = 0;
void setup(){Serial.begin(9600);
} 
void loop()
{ 
if(i == 0)
{Serial.print(“+++”);
printf(“+++ have send!\n”);
}
else if (i == 1)
{
Serial.print(“ATSN”);
Serial.print(‘\n’);
printf(“ATSN have send!\n”);}
else if (i == 2){Serial.println(“ATEX”);
printf(“ATEX have send!\n”);}
while(Serial.available() > 0)
{
printf(“%c”,Serial.read());
}
i++;delay(3000);}************************/
void setup(){Serial.begin(9600);} 
void loop()
{Serial.println(“Pcduino V2:520linksprite!”);
delay(1000);
while(Serial.available() > 0)
{char c = Serial.read();printf(“%c”,c);}}

Step 4: Result

You may search useful information online about how to get Arduino-ish API and compile it on pcDuino.

Screen shot on pcDuino Lite Wifi :

Screen shot on pcDuino V2:

pcDuino Lite wifi sends “Lite Wifi: 520linksprite” to spyder via UART from the code, the message shows up on pcDuino V2. Similarly, pcDuino V2 sends “pcDuinov2: 520linsprite” to Spyder via UART, the message shows up on pcDuino Lite wifi.

Step 5:

Comments

author
MayankB2 made it! (author)2016-07-25

Hi Yanny,

Thank you for the nice tutorial. I recently purchased two Spyder-UART modules and connected them as instructed. I'm using two MCUs (one MCU is programmed to send data at 9600bps and the other one is programmed to receive data at 9600bps and turn on/off leds based on the data received). The two MCUs when connected directly to each other are able to communicate properly, however, interfacing them with Spyder UART module as instructed does not work. Do I need to set something to get the communication started?

Thanks
Mayank

author
ArifSae made it! (author)2016-05-31

flew right pass me, but the board looks cool :P

About This Instructable

1,843views

16favorites

License:

More by Yanny Guo:Use pcDuino as Photo Booth ControllerUse Si4703 FM Breakout Board on Arduino UnoUse SIM900 GPRS/GSM Shield on pcDuino
Add instructable to: