-
-
Notifications
You must be signed in to change notification settings - Fork 34
[Feature Request] Add SoftwareSerial / Uart lib to Nano 33 #38
Comments
Which Nano 33 are you using, the Nano 33 IoT or the Nano 33 BLE/BLE Sense? |
It's BLE Sense |
Hi @pierre-b , |
Hi @facchinm , yes I meant Serial1 when I said:
So I would need a Serial2 or SoftwareSerial / Uart libs. I didn't express myself clearly. Are SoftwareSerial / Uart libs a possibility in the near future or should I ditch the Nano 33 BLE? Thanks |
Got it, sorry for the confusion. nRF52480 has support for two hardware UART; we are using just one (on pins 0 and 1) but you can easily instantiate another. diff --git a/variants/ARDUINO_NANO33BLE/defines.txt b/variants/ARDUINO_NANO33BLE/defines.txt
index e995d15e..2365b15e 100644
--- a/variants/ARDUINO_NANO33BLE/defines.txt
+++ b/variants/ARDUINO_NANO33BLE/defines.txt
@@ -21,7 +21,7 @@
-DDEVICE_PORTINOUT=1
-DDEVICE_PORTOUT=1
-DDEVICE_PWMOUT=1
--DDEVICE_SERIAL=1
+-DDEVICE_SERIAL=2
-DDEVICE_SERIAL_ASYNCH=1
-DDEVICE_SERIAL_FC=1
-DDEVICE_SLEEP=1
diff --git a/variants/ARDUINO_NANO33BLE/pins_arduino.h b/variants/ARDUINO_NANO33BLE/pins_arduino.h
index 5937dba1..3ff156e6 100644
--- a/variants/ARDUINO_NANO33BLE/pins_arduino.h
+++ b/variants/ARDUINO_NANO33BLE/pins_arduino.h
@@ -60,6 +60,9 @@ static const uint8_t A7 = PIN_A7;
#define PIN_SERIAL_RX (1ul)
#define PIN_SERIAL_TX (0ul)
+#define PIN_SERIAL1_RX (3ul)
+#define PIN_SERIAL1_TX (4ul)
+
// SPI
#define PIN_SPI_MISO (12u)
#define PIN_SPI_MOSI (11u)
@@ -111,9 +114,11 @@ static const uint8_t SCK = PIN_SPI_SCK;
// Mbed specific defines
-#define SERIAL_HOWMANY 1
+#define SERIAL_HOWMANY 2
#define SERIAL1_TX (digitalPinToPinName(PIN_SERIAL_TX))
#define SERIAL1_RX (digitalPinToPinName(PIN_SERIAL_RX))
+#define SERIAL2_TX (digitalPinToPinName(PIN_SERIAL1_TX))
+#define SERIAL2_RX (digitalPinToPinName(PIN_SERIAL1_RX))
#define SERIAL_CDC 1
#define HAS_UNIQUE_ISERIAL_DESCRIPTOR (you can change PIN_SERIAL1_RX / PIN_SERIAL1_TX as you prefer 🙂 ) or from the code, inside the sketch
(change 4 and 3 as you prefer, the processor can mux any functionality on any pin) |
Thank you @facchinm , will those modifications to the core be released officially? Also, does the "UART mySerial(..." config work without modifiying the core? |
The |
diff --git a/variants/ARDUINO_NANO33BLE/defines.txt b/variants/ARDUINO_NANO33BLE/defines.txt where can i find this route?? |
Hello Arduino, |
Hi @Maximumotion , |
Thank you for your reply! So by default, Arduino Nano 33 IoT has Serial1 set to pin 0 and 1. Uart mySerial (&sercom3, 3, 2, SERCOM_RX_PAD_3, UART_TX_PAD_2); Thank you! |
@Maximumotion Nano33IoT is already using sercom 2,3,5 internally (https://github.com/arduino/ArduinoCore-samd/blob/master/variants/nano_33_iot/variant.cpp#L188-L207) , so you need to check these lines to find the supported sercom (if it exists). In the end, your extra serial port becomes
|
Thank you for your help! |
Hi, I am using the Arduino Nano BLE 33 Sense, and I want to use ### UART mySerial(digitalPinToPinName(4), digitalPinToPinName(3), NC, NC);. May I know the procedures of using the code as I do not understand the instruction above. Am I supposed to download a library? Thanks in advance |
Hello Arduino,
For an IoT project I need to connect a GPS and GPRS board, each needs a Serial port.
As there is only one Serial port available (the USB is taken) I need a second Serial port. Unfortunately SoftwareSerial and Uart libs don't work on Nano 33 and I'm stuck.
Is it something you could add? or clearly I can't build my project with a Nano 33?
Thanks
ping @ostaquet
The text was updated successfully, but these errors were encountered: