top bar

Difference between revisions of "Arduino32bitBoards"

(Advantages and Disadvantages of Arduino 32 Bit-boards in general)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{| style="text-align: left"
 
{| style="text-align: left"
 
!Summary:
 
!Summary:
|Adapter for[http://www.arduino.cc/ 32bit Arduino boards]
+
|Adapter for [http://www.arduino.cc/ 32bit Arduino boards]
 
|-
 
|-
 
!Author:
 
!Author:
Line 26: Line 26:
 
----
 
----
  
The original [Micro-Manager Arduino firmware] was specifically written for the Arduino UNO and does not work on the newer and faster 32-bit Arduinos. This project aims to rewrite the original firmware to get compatibility with the newer arduino compatible boards. The original firmware and guide can be found on the micro-manager website link.
+
The Arduino32bitBoards device adapter contains extra features compared to the regular [[Arduino]] device adapter.
  
Most 32-bit Arduino boards are damaged when 5V is applied to the input pins. Voltage level conversion must be used for 5V input on  boards that do not tolerate 5V. Also, the digital output is 3.3V. Most devices that work with 5V input also work fine with 3.3V input but this is not guaranteed.
+
Currently the Teensy 3.5 is the recommended board to be used with this device adapter, bur there is also firmware available for the teensy 3.2, ESP32 and feather M4.
  
The Teensy 3.5 is currently the recommended board.
+
Differences compared to regular Arduino Device Adapter:
Advantages of the sketches provided in this repo:
+
* Two extra output channels to a total of 8
* Works on newer and faster boards, pin registers don't have to be used
+
* Added Pulse-width modulation (PWM) control
* Easier to adapt since pin registers aren't used
+
* Unified DAC and PWM
** This allows PWM + blanking
+
* Unified digital-out channels and DAC/PWM channels, this allows DAC/PWM blanking on all 8 channels
** DAC + blanking
+
* Changed unit of DAC/ PWM from "Volt" to "Power %" and the default scale to 0-100
** Possibility to choose different pins
+
* In the Firmware: Channels 1 - 2 are by default DAC channels, channels 3-8 are by default PWM
* No need for external DAC with most boards
+
 
+
==Advantages of 32 Bit-boards in general==
+
  
 +
== Advantages and Disadvantages of Arduino 32 Bit-boards in general ==
 +
'''Advantages:'''
 
* Much faster, because of higher clock speed and more work performed per clockcycle.
 
* Much faster, because of higher clock speed and more work performed per clockcycle.
 
* Baudrate increased to 500 000, nearly 9 times the transferspeed between Arduino and Micro-Manager (there are some exceptions). This can be even increased to 2 000 000, with micro-manager 2
 
* Baudrate increased to 500 000, nearly 9 times the transferspeed between Arduino and Micro-Manager (there are some exceptions). This can be even increased to 2 000 000, with micro-manager 2
 
* Most 32-bit Arduinos have a build-in DAC (max 3.3V output)
 
* Most 32-bit Arduinos have a build-in DAC (max 3.3V output)
 
* Higher PWM frequencies and PWM bitresolutions
 
* Higher PWM frequencies and PWM bitresolutions
 +
* More flexibility with pins used
 +
 +
'''Disadvantages:'''
 +
*'''Most are not 5V tolerant''', this means you'll need voltage level converter when using the triggerpin. It is recommended to use Teensy 3.5 since this board does have 5V tolerant inputs. When using a not 5V tolerant board it is recommended to use a voltage level converter like this one [https://www.adafruit.com/product/757 link] or this one [https://www.sparkfun.com/products/12009 link]
 +
 +
* Library support might not always be great
 +
 +
== Arduino boards information ==
 +
 +
Firmware code for these boards can be found on [https://github.com/bonnom/Arduino32BitBoards/tree/master/Firmwares Bonno Meddens github repository].
 +
 +
=== ESP32 ===
 +
* Baudrate: 115200
 +
* DAC1 on pin 25 and DAC2 on pin 26
 +
* ADC not implemented
 +
* Able to set PWM frequency and Resolution
 +
* Low Price boards available
 +
* KEEP IN MIND: NOT 5V TOLERANT!!
 +
* Pins used:
 +
** Trigger: Pin 5
 +
** Channel 1: Pin 25 (DAC)
 +
** Channel 2: Pin 26 (DAC)
 +
** Channel 3: Pin 27 (PWM)
 +
** Channel 4: Pin 15 (PWM)
 +
** Channel 5: Pin 14 (PWM)
 +
** Channel 6: Pin 4  (PWM)
 +
** Channel 7: Pin 23 (PWM)
 +
** Channel 8: Pin 19 (PWM)
 +
 +
=== ItsyBitsy M4 ===
 +
* Baudrate 500 000
 +
* The ADC does not work at the moment because of DAC implementation
 +
* 12 bit PWM
 +
* KEEP IN MIND: NOT 5V TOLERANT!!
 +
* Pins Used
 +
** Trigger: Pin 5
 +
** Channel 1: Pin A0 (DAC)
 +
** Channel 2: Pin A1 (DAC)
 +
** Channel 3: Pin 6  (PWM)
 +
** Channel 4: Pin 9  (PWM)
 +
** Channel 5: Pin 10 (PWM)
 +
** Channel 6: Pin 11 (PWM)
 +
** Channel 7: Pin 12 (PWM)
 +
** Channel 8: Pin 13 (PWM)
 +
 +
=== Teensy 3.x and 4.0 Boards ===
 +
* All 3.x boards
 +
** Able to set PWM frequency and Resolution, for more information [https://www.pjrc.com/teensy/td_pulse.html link]
 +
** At least one DAC
 +
** handy:  [https://www.pjrc.com/teensy/pinout.html Pinouts page]
 +
** Baudrate 500 000 
 +
 +
 +
*Teensy 3.1 & 3.2 (96 Mhz)
 +
** All currently used pins in the sketch are 5V tolerant
 +
** Only one DAC on pin A14
 +
** Current PWM frequency: 11718.75 Hz
 +
** Pins used:
 +
*** Trigger: Pin 2
 +
*** Channel 1: Pin A14 (DAC)
 +
*** Channel 2: Pin 20  (PWM)
 +
*** Channel 3: Pin 3  (PWM)
 +
*** Channel 4: Pin 4  (PWM)
 +
*** Channel 5: Pin 5  (PWM)
 +
*** Channel 6: Pin 6  (PWM)
 +
*** Channel 7: Pin 21  (PWM)
 +
*** Channel 8: Pin 22  (PWM)
  
==Working Arduino boards:==
 
  
*ESP32
+
* Teensy 3.5 (Recommended) & Teensy 3.6
**       Baudrate: 115200
+
** All currently used pins in the firmware for Teensy '''3.5''' are 5V tolerant
**         DAC1 on pin 25 and DAC2 on pin 26
+
** KEEP IN MIND: Teensy '''3.6''' is not 5V tolerant!!
**         ADC not implemented
+
** DAC1 on pin 21 and DAC2 on pin 22
**       Able to set PWM frequency and Resolution
+
** Current PWM frequency: 14648.437 Hz
**         Low Price boards available
+
** Pins used:
**         KEEP IN MIND: NOT 5V TOLERANT!!
+
*** Trigger: Pin 2
 +
*** Channel 1: Pin A21 (DAC)
 +
*** Channel 2: Pin A22  (DAC)
 +
*** Channel 3: Pin 3  (PWM)
 +
*** Channel 4: Pin 4  (PWM)
 +
*** Channel 5: Pin 5  (PWM)
 +
*** Channel 6: Pin 6  (PWM)
 +
*** Channel 7: Pin 7  (PWM)
 +
*** Channel 8: Pin 8  (PWM)
  
*    ItsyBitsy M4
 
**        The ADC does not work at the moment because of DAC implementation
 
**        Channel 8 has become channel 7
 
**        KEEP IN MIND: NOT 5V TOLERANT!!
 
  
*Teensy 3.x Boards
+
* Teensy 4.0
**All 3.x boards
+
** KEEP IN MIND: not 5V tolerant!!
 +
** Very fast
 +
** Does not have a DAC
 +
** Current PWM frequency: 468750 Hz (At 7-bits)
 +
** Pins used :
 +
*** Trigger: Pin 8
 +
*** Channel 1: Pin 23 (PWM)
 +
*** Channel 2: Pin 15 (PWM)
 +
*** Channel 3: Pin 3  (PWM)
 +
*** Channel 4: Pin 4  (PWM)
 +
*** Channel 5: Pin 10 (PWM)
 +
*** Channel 6: Pin 9  (PWM)
 +
*** Channel 7: Pin 6  (PWM)
 +
*** Channel 8: Pin 5  (PWM)
  
***    Able to set PWM frequency and Resolution, for more information link
+
== Installation and Drivers ==
***    At least one DAC
+
This Section is an overview of the installation links for Arduino and the respective boards
***    handy:  [https://www.pjrc.com/teensy/pinout.html Pinouts page]
+
  
**Teensy 3.1 & 3.2
+
=== Arduino IDE ===
***        Seems to work fine, but more testing is needed
+
Arduino offers two solutions, an online editor and a local Integrated development environment (IDE) program.
***        All currently used pins in the sketch are 5V tolerant
+
It is recommended to use the local IDE software.
***        Only one DAC on pin A14
+
The page for the software can be found [https://www.arduino.cc/en/Main/Software here].
***        All other pins are the same as the original UNO firmware
+
  
**    Teensy 3.5 (Recommended)
+
=== Adafruit ===
***        Not yet tested
+
Adafruit makes two programming environments to use on their 32-bit boards. One is circuit python and Arduino. Circuitpython currently doesn't work with micro-manager.
***        All currently used pins in the firmware are 5V tolerant
+
Guide for installing the Adafruit Feather M4 board can be found [https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/setup here].
***        DAC1 on pin 21 and DAC2 on pin 22
+
Just the driver can be downloaded from [https://github.com/adafruit/Adafruit_Windows_Drivers/releases/latest here]. This also includes multiple drivers that work on many other boards as well.
***        Able to set PWM frequency and Resolution
+
  
**    Teensy 3.6
+
=== Esp32 ===
***        Uses same sketch as teensy 3.5
+
ESP32 arduino core installation link can be found [https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md here].
***        Faster than teensy 3.5
+
Also when using an windows version older than Windows 10 driver installation might be needed. There are two types of USB to serial chips used with each their own driver. If you are not sure what IC is used just install both drivers.
***        KEEP IN MIND: NOT 5V TOLERANT!!
+
  
==Boards that do not work with this firmware/device adapter:==
+
These two are the most common type of drivers:
 +
* [https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers SiLabs cp210x]
 +
* [https://cdn.sparkfun.com/assets/learn_tutorials/8/4/4/CH341SER.EXE CH340]
  
*    Esp8266 board
+
=== Teensy Boards ===
*    Arduino Due
+
Teensy requires its own installation software that can be downloaded [https://www.pjrc.com/teensy/td_download.html here].
*    Sipeed Maix boards
+
Just the drivers can be found [https://www.pjrc.com/teensy/serial_install.exe here].
  
==To be tested:==
 
  
*Teensy LC
 
*    A SAMD21 board
 
*    Teensy 3.5 (Very likely Works)
 
  
  
 
{{Devices_Sidebar}}
 
{{Devices_Sidebar}}

Latest revision as of 00:22, 19 August 2019

Summary: Adapter for 32bit Arduino boards
Author: Bonno Meddens
License: LGPL
Platforms: Linux, Mac, and Windows
Since version: 1.4.23 - 20190731
Automated Serial Port Setup: Yes
Peripheral device discovery: No
Wiki page: Bonno Meddens
Nico Stuurman

The Arduino32bitBoards device adapter contains extra features compared to the regular Arduino device adapter.

Currently the Teensy 3.5 is the recommended board to be used with this device adapter, bur there is also firmware available for the teensy 3.2, ESP32 and feather M4.

Differences compared to regular Arduino Device Adapter:

  • Two extra output channels to a total of 8
  • Added Pulse-width modulation (PWM) control
  • Unified DAC and PWM
  • Unified digital-out channels and DAC/PWM channels, this allows DAC/PWM blanking on all 8 channels
  • Changed unit of DAC/ PWM from "Volt" to "Power %" and the default scale to 0-100
  • In the Firmware: Channels 1 - 2 are by default DAC channels, channels 3-8 are by default PWM

Advantages and Disadvantages of Arduino 32 Bit-boards in general

Advantages:

  • Much faster, because of higher clock speed and more work performed per clockcycle.
  • Baudrate increased to 500 000, nearly 9 times the transferspeed between Arduino and Micro-Manager (there are some exceptions). This can be even increased to 2 000 000, with micro-manager 2
  • Most 32-bit Arduinos have a build-in DAC (max 3.3V output)
  • Higher PWM frequencies and PWM bitresolutions
  • More flexibility with pins used

Disadvantages:

  • Most are not 5V tolerant, this means you'll need voltage level converter when using the triggerpin. It is recommended to use Teensy 3.5 since this board does have 5V tolerant inputs. When using a not 5V tolerant board it is recommended to use a voltage level converter like this one link or this one link
  • Library support might not always be great

Arduino boards information

Firmware code for these boards can be found on Bonno Meddens github repository.

ESP32

  • Baudrate: 115200
  • DAC1 on pin 25 and DAC2 on pin 26
  • ADC not implemented
  • Able to set PWM frequency and Resolution
  • Low Price boards available
  • KEEP IN MIND: NOT 5V TOLERANT!!
  • Pins used:
    • Trigger: Pin 5
    • Channel 1: Pin 25 (DAC)
    • Channel 2: Pin 26 (DAC)
    • Channel 3: Pin 27 (PWM)
    • Channel 4: Pin 15 (PWM)
    • Channel 5: Pin 14 (PWM)
    • Channel 6: Pin 4 (PWM)
    • Channel 7: Pin 23 (PWM)
    • Channel 8: Pin 19 (PWM)

ItsyBitsy M4

  • Baudrate 500 000
  • The ADC does not work at the moment because of DAC implementation
  • 12 bit PWM
  • KEEP IN MIND: NOT 5V TOLERANT!!
  • Pins Used
    • Trigger: Pin 5
    • Channel 1: Pin A0 (DAC)
    • Channel 2: Pin A1 (DAC)
    • Channel 3: Pin 6 (PWM)
    • Channel 4: Pin 9 (PWM)
    • Channel 5: Pin 10 (PWM)
    • Channel 6: Pin 11 (PWM)
    • Channel 7: Pin 12 (PWM)
    • Channel 8: Pin 13 (PWM)

Teensy 3.x and 4.0 Boards

  • All 3.x boards
    • Able to set PWM frequency and Resolution, for more information link
    • At least one DAC
    • handy: Pinouts page
    • Baudrate 500 000


  • Teensy 3.1 & 3.2 (96 Mhz)
    • All currently used pins in the sketch are 5V tolerant
    • Only one DAC on pin A14
    • Current PWM frequency: 11718.75 Hz
    • Pins used:
      • Trigger: Pin 2
      • Channel 1: Pin A14 (DAC)
      • Channel 2: Pin 20 (PWM)
      • Channel 3: Pin 3 (PWM)
      • Channel 4: Pin 4 (PWM)
      • Channel 5: Pin 5 (PWM)
      • Channel 6: Pin 6 (PWM)
      • Channel 7: Pin 21 (PWM)
      • Channel 8: Pin 22 (PWM)


  • Teensy 3.5 (Recommended) & Teensy 3.6
    • All currently used pins in the firmware for Teensy 3.5 are 5V tolerant
    • KEEP IN MIND: Teensy 3.6 is not 5V tolerant!!
    • DAC1 on pin 21 and DAC2 on pin 22
    • Current PWM frequency: 14648.437 Hz
    • Pins used:
      • Trigger: Pin 2
      • Channel 1: Pin A21 (DAC)
      • Channel 2: Pin A22 (DAC)
      • Channel 3: Pin 3 (PWM)
      • Channel 4: Pin 4 (PWM)
      • Channel 5: Pin 5 (PWM)
      • Channel 6: Pin 6 (PWM)
      • Channel 7: Pin 7 (PWM)
      • Channel 8: Pin 8 (PWM)


  • Teensy 4.0
    • KEEP IN MIND: not 5V tolerant!!
    • Very fast
    • Does not have a DAC
    • Current PWM frequency: 468750 Hz (At 7-bits)
    • Pins used :
      • Trigger: Pin 8
      • Channel 1: Pin 23 (PWM)
      • Channel 2: Pin 15 (PWM)
      • Channel 3: Pin 3 (PWM)
      • Channel 4: Pin 4 (PWM)
      • Channel 5: Pin 10 (PWM)
      • Channel 6: Pin 9 (PWM)
      • Channel 7: Pin 6 (PWM)
      • Channel 8: Pin 5 (PWM)

Installation and Drivers

This Section is an overview of the installation links for Arduino and the respective boards

Arduino IDE

Arduino offers two solutions, an online editor and a local Integrated development environment (IDE) program. It is recommended to use the local IDE software. The page for the software can be found here.

Adafruit

Adafruit makes two programming environments to use on their 32-bit boards. One is circuit python and Arduino. Circuitpython currently doesn't work with micro-manager. Guide for installing the Adafruit Feather M4 board can be found here. Just the driver can be downloaded from here. This also includes multiple drivers that work on many other boards as well.

Esp32

ESP32 arduino core installation link can be found here. Also when using an windows version older than Windows 10 driver installation might be needed. There are two types of USB to serial chips used with each their own driver. If you are not sure what IC is used just install both drivers.

These two are the most common type of drivers:

Teensy Boards

Teensy requires its own installation software that can be downloaded here. Just the drivers can be found here.



© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact