Logic levels from HardwareSerial


benediktsch

Recommended Posts

Hello together,

I was trying to get three HardwareSerials working on the DUO Board. When I was watching at the signals with my Logic Analyzer only the second UART seems to work fine.
But as you can see in the attached image it seems like the first UART (Channel 0) is also sending data, but on a Logic Level of something around 0.35Volts. So why isn't this working like the second one, but going from low to high instead of from high to low and has such a low logic level? I also tried initalizing the Serials like in the given example withe the Wishbone Slot inserted, but I guess this got outdated in v2.0.

Edit: In the schematic the TX RX are: SerialRed : RX = Arduino_0 ; TX = Arduino_1
                                                            SerialGreen : RX = Arduino_2; TX = Arduino_3
                                                            SerialBlue : RX = Arduino_4; TX = Arduino_5

I also tried using other PINs than the ones above but everywhere seems to be the same issue.

This is my Code:

HardwareSerial SerialRed(2);
HardwareSerial SerialGreen(3);
HardwareSerial SerialBlue(4);

void setup() {

  Serial.begin(115200);
  delay(50);
  SerialRed.begin(57600);
  delay(50);
  SerialGreen.begin(57600);
  delay(50);
  SerialBlue.begin(57600);

}

void loop()
{
  SerialSendData(TData);
  delay(1000);
}

void SerialSendData(uint8_t TData[3072]) {
  SerialRed.write(startsequence);
  for (int i = 0; i < 1024; i++) {
    SerialRed.write(TData[i]);
  }
  Serial.println("Red transmit");
  SerialGreen.write(startsequence);
  for (int i = 1024; i < 2048; i++) {
    SerialGreen.write(TData[i]);
  }
  Serial.println("Green transmit");
  SerialBlue.write(startsequence);
  for (int i = 2048; i < 3072; i++) {
    SerialBlue.write(TData[i]);
  }
  Serial.println("Blue transmit");
  SerialRed.write(setFrame);
  SerialGreen.write(setFrame);
  SerialBlue.write(setFrame);
}

 

LLPP.JPG

llPPP.JPG

Link to comment
Share on other sites

Another Problem I found is, that the UART is dropping bytes in the beginning or at the end of a transmission randomly. Even thou everything is transmitted from the other Papilio Board. I just read data in my loop and print it, after it was transferred, so I don't really think I can make the program any shorter.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.