0

I want to use Arduino DUE board as a FTDI programmer.

The task is to program ESP32 module which is connected to the Arduino Serial port.

I can use only DUE Native port. There is no DUE programming port in my design.

  • Cool story dude. Why do you mention this? – Mark Smith Jan 6 '17 at 9:27
  • Forgot to ask. Is it possible? – Tigran Jan 6 '17 at 9:29
1

Yes, it is possible, and not too difficult.
Also, the native port is a lot faster than the programming port ;)

All you need to do is to read the serialUSB data in and write it to the SerialX port, and read the data in from the SerialX port and write it to the SerialUSB port. It's best to do it on a byte by byte basis, and the due should be plenty fast enough.

This code should do the job. Let me know if it doesn't, and I'll take a look. (I have a Due and esp32)

void setup(void) {
  SerialUSB.begin(9600); //speed here doesn't matter as far as I am aware.
                         //the serial baud here should match the speed that 
                         //you try to upload at to the esp32 
  Serial1.begin(9600);   //change the Serial port to suit your needs
}
void loop(){ 
   if(SerialUSB.available()> 0){
    Serial1.write(SerialUSB.read());
   }
   if(Serial1.available()> 0){
    SerialUSB.write(Serial1.read());
   }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.