Serial1.read not working with WIZ820io & Micro SD Card Adaptor

Status
Not open for further replies.

Mr.Pedro

Active member
Hi again, I'm coming from another post but since I've characterized the problem I though it was better to clearly write here again all details to see if we can find the reason of the error.

I'm trying to read through serial with Teensy 3.6 mounted with WIZ820io & Micro SD Card Adaptor (MASTER) the data coming from a Teensy 3.6 without any board mounted (SLAVE). When doing Serial1.available() return value is always 0 and Serial1.read() is -1.

Current mounting on protoboard is the one shown below, where GND pins are connected together and RX1 on pin 0 of the MASTER is connected into TX1 on pin 1 of the Slave.

1bbbeab0c6224c4ebff7dee562f3695b.png


USB cables are coming from 2 different laptops, and protoboard continuity has been checked.

/////MASTER RECEIVER CODE (LEFT BOARD)
Code:
unsigned long prev = 0;
char c;

void setup() {

Serial.begin(9600);
 Serial1.begin(9600);
 pinMode(13, OUTPUT);
 digitalWrite(13, HIGH);

}

void loop() {

if(millis() - prev>100){
  Serial.println("1");
  prev = millis();
 }

while(Serial1.available()){
   c = Serial1.read();
   Serial.print(c);    
 }

}

/////////SLAVE SENDER CODE (RIGHT BOARD)
Code:
void setup() {
  
  Serial.begin(9600);
  Serial1.begin(9600);

}

void loop() {
             
  Serial1.println("Hi Master");  
  Serial.println("Printing");

  delay(100);
    
}



Other things that have been tried:
- Successful writing from MASTER to SLAVE (TX1 from MASTER connected to RX1 of SLAVE)
- Successful reading and writing using any other Serial Ports but 1 on both SLAVE and MASTER.
- Different baudrates.
- Same power supply for both MASTER and SLAVE.
- Checked continuity for header MASTER soldering.
- Checked WIZ820io and SD card pinout (https://www.pjrc.com/store/wiz820_sd_adaptor.html) It's supposed that pins 0 and 1 are not connected to anything, they are just through holes within the adapter, so that shouldn't interfere.

The only conclusion I can have is RX1 doesn't work in the board mounted with the MASTER WIZ820io and SD card adaptor. I can't change my current configuration since the PCB is already printed and need to figure out a solution. Timing is not good for the project, so it's kinda urgent.

Thank you so much for your help and let me know any doubt.
 
Last edited:
The slave code sets the LED (pin 13) High. So the left board in the picture is the slave? But in the description you wrote that the Teensy with the WIZ820io is the Master? The wiring shows only a connection from Slave RX to Master TX - the Slave can't send data to the Master.
 
The slave code sets the LED (pin 13) High. So the left board in the picture is the slave? But in the description you wrote that the Teensy with the WIZ820io is the Master? The wiring shows only a connection from Slave RX to Master TX - the Slave can't send data to the Master.

Sorry for the confusion, picture was taken doing some testing and led was off at that moment.

Left board with the adapter for the ethernet module and the led switched on is the Master, right board with the led switched off is the Slave.

I've modified the code for avoiding confusion.
 
I don't have the WIZ820io & Micro SD Card Adaptor. Same code and same wiring works for me with both Teensy connected to a single PC: https://i.imgur.com/9AxRtfe.png https://i.imgur.com/YAK6W0M.png

You could test an alternate pin for Master RX: connect Master pin 27 to slave pin 1
Code:
unsigned long prev = 0;
char c;

void setup() {

  Serial.begin(9600);
  Serial1.setRX(27);
  Serial1.begin(9600);   
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);

}

void loop() {

if(millis() - prev>100){
  Serial.println("1");
  prev = millis();
 }

while(Serial1.available()){
   c = Serial1.read();
   Serial.print(c);    
 }

}
 
Last edited:
Am I missing a common Ground wire between the two boards? Never mind, I was thinking you had RX/TX and TX/RX...
 
I don't have the WIZ820io & Micro SD Card Adaptor. Same code and same wiring works for me with both Teensy connected to a single PC: https://i.imgur.com/9AxRtfe.png https://i.imgur.com/YAK6W0M.png

You could test an alternate pin for Master RX: connect Master pin 27 to slave pin 1
Code:
unsigned long prev = 0;
char c;

void setup() {

  Serial.begin(9600);
  Serial1.setRX(27);
  Serial1.begin(9600);   
  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);

}

void loop() {

if(millis() - prev>100){
  Serial.println("1");
  prev = millis();
 }

while(Serial1.available()){
   c = Serial1.read();
   Serial.print(c);    
 }

}

It couldn't be more stupid, I already solved, thank you so much for your help.

When mounting with the adapter pins are a little shorter than usual. It results that most of the pins make good contact but RX1. It was not making connection on neither pcb and the protoboard, so I didn't detect.

Trying to power again from VIN/GND pins Slave was not switching on, I then pressed MASTER with my finger and RX1 started reading.

8db7b89203967b549c136db8bc5a4faa.png


I've already ordered this pins: https://www.pololu.com/product/1114

Applying some heat I'll slide bottom black plastic for them to be longer than 6mm and for having some space in the middle to mount a heat sink on the microprocessor since it heats up to 62C when working in vacuum with the Ethernet module.

For your curiosity that's used at Hyperloop Space X competition, thank you so much!
 
Status
Not open for further replies.
Back
Top