GPS doesn't work with Serial (TX0, RX0)

Hi, When I connecting GPS NEO-6M to Due pin 0 (RX0) and 1 (TX0) I'm not getting any readings whilst when I connect it to Serial 1 or 2 or 3 it works perfect. Ps. Due is not connected to PC via programming port so there shouldn't be a conflict.

Does anyone know why?

Thanks Piotr

Isn't that the port which is connected directly to the Atmega16u2? Serial1 works just fine for my GPS setup.

Yes, Serial is connected to Atmega16u2. Yes, GPS works fine on Serial1, Serial2 and Serial3 but I need to have one more port and I want to use TX0 RX0.

Any idea if that is possible? If not why they left those two pins available to connect to? Piotr

...but I need to have one more port...

If you need an additional Serial port on the Due, there's one on pins A11 (TX4) and D52 (RX4) that uses USART2 and can be assigned as Serial4.

Here's a test program that echos back characters from the console:

// Use the Arduino core to set-up the unused USART2 on Serial4
RingBuffer rx_buffer5;
RingBuffer tx_buffer5;
USARTClass Serial4(USART2, USART2_IRQn, ID_USART2, &rx_buffer5, &tx_buffer5);
//void serialEvent4() __attribute__((weak));
//void serialEvent4() { }

void USART2_Handler(void)   // Interrupt handler for UART2
{
  Serial4.IrqHandler();     // In turn calls on the Serial4 interrupt handler
}

void setup() {
  // put your setup code here, to run once:
  PIO_Configure(PIOB, PIO_PERIPH_A, PIO_PB20A_TXD2 | PIO_PB21A_RXD2, PIO_DEFAULT);
  Serial4.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial4.available())        // Check if incoming data is available
  {
    byte byteRead = Serial4.read();    // Read the most recent byte 
    Serial4.write(byteRead);      // Echo the byte back out on the serial port
  }
}

MartinL, You solved my problem with lack of serial port. Thank you!

Serial4 works perfect but mistery with Serial stays :)

Piotr