Arduino


We recommend that if you have been previously using CircuitPython or MicroPython on your Neuron that you erase the module prior to using Arduino. To accomplish this task please use Adafruit’s Web Serial ESPTool.

Connect your Neuron to your computer and use the Web Serial Tool over USB. You will need to put the Neuron in <BOOT> mode prior to erasing it. On your Neuron module press and hold the <BOOT> button while pressing the <RESET> button. Click <Connect> in ESPTool and select the module. It will typically be identified as follows (though the “ComXX” identifier will depend on your OS and the serial port the Neuron is using):

USB/JTAG serial debug unit (ComXX) – Paired

Once you are connected to the Neuron module, click <Erase>. The erase process will automatically reset the Neuron. Remember to exit from ESPTool (e.g., close the browser) when you have completed this task or the serial port will be locked out.

If you have not already done so, install the Arduino IDE on your computer. It is worthwhile spending some time learning Arduino prior to using the Neuron module. Before using your Neuron in Arduino you will also need to add the ESP32 support library to Arduino in File|Preferences|Additional Board Manager URLs:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Exit and restart Arduino. Install the latest ESP32X device library using Arduino’s Board Manager via the Tools menu in Arduino. The ESP32 library should be updated periodically.

Using Arduino

You will need to ensure that the Neuron is in a programmable mode prior to uploading your sketch. On your Neuron press and hold the <BOOT> button while pressing the <RESET> button. The Neuron module should be identified in Arduino as an ESP32S3 Dev Module. If not, please select this using the Boards menu.

You can verify the module is being correctly detected in Arduino by checking the Port and Info options on the Tools menu. This is the correct info for the Neuron:

BN: ESP32S3 Dev Module
VID: 303a
PID: 1001

The module selected must be ESP32S3 Dev Module. Ensure that you have selected the correct module type and serial port before proceeding with programming your Neuron in Arduino!

We recommend using the following settings to configure your Neuron in Arduino|Tools:

For Arduino 1.8.X

For the first sketch upload you may need to put the Neuron in Boot mode (Hold Boot Button and then Press Reset). This may result in the serial port changing. 

Settings for Tools:
Board: "ESP32S3 Dev Module"
Upload Speed: 921600
USB Mode: "Hardware CDC and JTAG"
Use CDC on Boot: "Enabled'
USB Firmware MSC On Boot: "Disabled"
USB DFU On Boot: "Disabled"
Upload Mode: "USB-OTG CDC (TinyUSB)"
CPU Frequency: "240Mhz (WiFi)"
Flash Mode: "QIO 120Mhz"
Flash Size: "8MB (64Mb)"
// Note Partition Schemes are Project Dependent
// If not sure, use 8M with spiffs
Partition Scheme: Typically "8M with Spiffs"
Core-Debug Level: "None"
PSRAM (enabled): "OPI PSRAM"
Arduino Runs On: "Core 1"
Events Run On: "Core 1"
Erase All Flash Before Sketch Upload: "Disabled"
JTAG Adapter: "Integrated USB JTAG"
Port: Select the Correct Serial Port for the Neuron

Note: You may need to press the Reset button on the Neuron to reboot after uploading a sketch. Resetting the Neuron may result in the Serial Port changing.


For Arduino 2.X or later

For the first sketch upload you may need to put the Neuron in Boot mode (Hold Boot Button and then Press Reset). This may result in the serial port changing. 

Settings for Tools:
Board: "ESP32S3 Dev Module"
Use CDC on Boot: Enabled
CPU Frequency: 240Mhz (WiFi)
Core-Debug Level: None
USB DFU On Boot: "Disabled"
Erase All Flash Before Sketch Upload: "Disabled"
Events Run On: "Core 1"
Flash Mode: "QIO 120Mhz"
Flash Size: "8MB (64Mb)"
JTAG Adapter: "Integrated USB JTAG"
Arduino Runs On: "Core 1"
USB Firmware MSC On Boot: "Disabled"
Partition Scheme: Typically "8M with Spiffs"
PSRAM (enabled): "OPI PSRAM"
Upload Mode: USB-OTG CDC (TinyUSB)
Upload Speed: 921600
USB Mode: "Hardware CDC and JTAG"

Note: You may need to press the Reset button on the Neuron to reboot after uploading a sketch. Resetting the Neuron may result in the Serial Port changing.

Tip

On the initial sketch upload it may be necessary to press the <RESET> button on the Neuron module to activate the uploaded sketch. Subsequent sketch uploads should automatically perform the rebooting step. You may need to re-check the serial settings (and possibly restart Arduino in extreme cases) if you are unable to connect and upload a sketch to a Neuron on the fist try. The process of uploading sketches becomes easier once the Arduino USB-OTG firmware has been installed on the Neuron; the Neuron has “received” it’s first Arduino sketch successfully. If there are errors in the sketch upload process they will be indicated in the IDE (below the code window).

You can test your Neuron module with the following “Blink” sketch:

// Blink Example

void setup() {
// initialize the blink pin 
pinMode(47, OUTPUT);
}

// blink loop function runs forever

void loop() {
digitalWrite(47, HIGH); // LED ON
delay(1000); // wait for a second
digitalWrite(47, LOW); // LED OFF
delay(1000); // wait for a second
}

BrainBoardzTM and Plug and CodeTM 
are Trademarks of BrainBoardz Inc. © Copyright, 2021