2nd Serial Port Access
Posted: Tue Oct 11, 2016 3:56 am
Taking @ESP_me_no_dev's advice "@a2retro You can attach all 3 UARTs to any pins you like (almost). Pins 9 and 10 are tied to your flash chip, so I would not use them for Serial. You can check esp32-hal-uart.h if you want C style api to the serial or just use HardwareSerial Serial1(1); and then Serial1.begin(baudrate, SERIAL_8N1, rxPin, txPin); to start and use it like any other Arduino Serial"
I seem to be stuck trying to access my serial jpeg camera (Adafruit_VC0706)
So I have confirmed the camera functions correctly when directly connected to a PC and using the provide utility software. I have my FT2232 based programmer sending compiled code down to the esp32 via the default serial port.
I chose to use pin 17 and pin16 as RX and TX respectively.
HardwareSerial Serial1(1);
Adafruit_VC0706 cam = Adafruit_VC0706(&Serial1);
// Try to locate the camera
if (cam.begin((unsigned long) 38400, (uint32_t) SERIAL_8N1, (int8_t) 17, (int8_t) 16)) {
Serial.println("Camera Found:");
} else {
Serial.println("No camera found?");
return;
}
I get no camera found.
I hacked up the default Adafruit sample code to just use HardwareSerial as I got SoftwareSerial compile errors previously.
It's possible i messed something up in my edits of the Adafruit sample code but I am wondering if I am missing anything else at the top level to enable the rx/tx on the second serial port?
Edit: I confirmed by putting my programmers serial port onto pin 17 and 16 that the data is getting through (well at least the printable characters show up in the console) so that's encouraging.
I seem to be stuck trying to access my serial jpeg camera (Adafruit_VC0706)
So I have confirmed the camera functions correctly when directly connected to a PC and using the provide utility software. I have my FT2232 based programmer sending compiled code down to the esp32 via the default serial port.
I chose to use pin 17 and pin16 as RX and TX respectively.
HardwareSerial Serial1(1);
Adafruit_VC0706 cam = Adafruit_VC0706(&Serial1);
// Try to locate the camera
if (cam.begin((unsigned long) 38400, (uint32_t) SERIAL_8N1, (int8_t) 17, (int8_t) 16)) {
Serial.println("Camera Found:");
} else {
Serial.println("No camera found?");
return;
}
I get no camera found.
I hacked up the default Adafruit sample code to just use HardwareSerial as I got SoftwareSerial compile errors previously.
It's possible i messed something up in my edits of the Adafruit sample code but I am wondering if I am missing anything else at the top level to enable the rx/tx on the second serial port?
Edit: I confirmed by putting my programmers serial port onto pin 17 and 16 that the data is getting through (well at least the printable characters show up in the console) so that's encouraging.