Difference between revisions of "radino32 software"

From InCircuit
Jump to: navigation, search
(WiFi)
 
(32 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<span style="color:red;">This page is currently under construction and is daily updated with new information.</span>
+
{{ood_sw}}
 
+
{| class="wikitable"
+
|
+
|colspan=4 | [[radino Library]]
+
|-
+
|
+
|colspan=3 | '''radino'''
+
|'''radino32'''<br />[[radino32 software]]
+
|-
+
|[[radino software]]
+
|colspan=3 | [[radino WiFi software]]<br />[[radino WiFi software#First_Steps|First Steps]] | [[radino WiFi software#Howto|Howto]] | [[radino WiFi software#FAQ|FAQ]]
+
|
+
|-
+
|
+
|[[IC ESP]]
+
|[[ESP8266EX HTTPD]]
+
|[[IC ESP8266EX interface]]
+
|
+
|-
+
|}
+
  
 
<div style="float:left;">__TOC__</div>
 
<div style="float:left;">__TOC__</div>
Line 27: Line 7:
  
 
Descriptions are limited mostly to differences to the radino modules.
 
Descriptions are limited mostly to differences to the radino modules.
 +
For the rest see [[radino WiFi software]].
  
 
</div>
 
</div>
Line 32: Line 13:
  
 
==Overview==
 
==Overview==
The [[radino Library]] since version 4 includes all files required to compile and upload sketches using the Arduino IDE 1.6.0 or 1.6.1.
+
The [[radino Library]] since version 4 includes all files required to compile and upload sketches using the [https://www.arduino.cc/en/Main/OldSoftwareReleases#previous Arduino 1.6.0 / 1.6.1].
  
Extract this library into your %ARDUINO_APPDATA% folder as described at [[radino software]].
+
Extract this library into your %ARDUINO_APPDATA% folder as described at [[radino/radino32 software#Install radino library|Install radino library]].
  
Afterwards the radino32 is selectable within the Arduino IDE under "Tools->Board".
+
Afterwards the radino32 is selectable within the Arduino IDE under "Tools->Board" as "radino32 USB-Load".
  
 +
==Howto==
  
==Implementation Progress==
+
===Compiling sketches===
 +
As the Arduino team removed the gcc compiler for ARM based devices from Arduino IDE 1.6.2 and following. The sketches for the radino32 can only be compiled with versions 1.6.0 or 1.6.1 of the Arduino IDE.
 +
* Select "radino32 USB-Load" under "Tools->Board". (All radino32 can be programmed using this option)
 +
* Hit the Verify button.
  
The example sketch "Blink" is included and tested. Soon some examples for the [[radino32 WiFi]] and [[radino32 CC1101]] will follow.
+
===Uploading sketches===
 
+
* Start the bootloader on the radino32 as described here: [[radino/radino32_software#Set the radino32 to bootloader|Starting the bootloader]]
The sketch "radino32_WiFi_Firmwareupdate" allows to flash the Firmware of the ESP8266EX on the [[radino32 WiFi]] and direct communication with it.
+
** If necessary, install the bootloader drivers as described here: [[radino/radino32_software#Driver for radino32|Installing bootloader drivers]]
 
+
* Start uploading within the Arduino IDE.
Implemented and tested features:
+
* After the upload finished. Reset the radino32 and it will execute the uploaded sketch.
* Serials 1-3
+
* SPI
+
* GPIOs
+
* Interrupts
+
 
+
Soon to come
+
* Utilizing ESP8266EX on [[radino32 WiFi]]
+
* Utilizing CC1101 on [[radino32 CC1101]]
+
* USB serial
+
* I2C
+
 
+
==Howto==
+
  
 
===Starting the bootloader===
 
===Starting the bootloader===
Line 68: Line 41:
 
* Disable supply voltage to the module.
 
* Disable supply voltage to the module.
 
* Pull pin "BOOT_SEL" high (You can achieve this by shortening the pin with "VCC" derectly besides it).
 
* Pull pin "BOOT_SEL" high (You can achieve this by shortening the pin with "VCC" derectly besides it).
* Apply suply voltage.
+
* Apply supply voltage.
 
* Release pin "BOOT_SEL".
 
* Release pin "BOOT_SEL".
  
 +
Method 3:
 +
* this method works on modules that contain a BSL-button (e.g.  [[radino Leonardo]], [[radino Spider RP-SMA]], [[radino USB Stick]], [[radino RS485/RS232-Bridge IP65]], [[radino DinRail Adapter]])
 +
* Apply supply voltage.
 +
* press & hold BSL- '''and''' RESET-Button
 +
* release RESET-button
 +
* release BSL-button
 +
* (repeat these steps if your radino doesn't enter bootloader mode right away.)
  
===Installing drivers===
+
===Installing bootloader drivers===
 
* After entering the Bootloader windows will detect the new device.
 
* After entering the Bootloader windows will detect the new device.
* Use the driver installation tool under "%ARDUINO_APPDATA_FOLDER%/hardware/ICT_Boards/stm32l1/driver/win" to install drivers for the STM32 Bootloader.
+
* Use the zadig driver installation tool under "%ARDUINO_APPDATA_FOLDER%/hardware/ICT_Boards/stm32l1/driver/win" to install drivers for the STM32 Bootloader.
 
* Make sure within the installation tool "libusbK (v3.0.7.0)" is selected.
 
* Make sure within the installation tool "libusbK (v3.0.7.0)" is selected.
  
 +
On Windows 7 or newer it is necessary to prevent installation of other stm32 drivers. [[radino/radino32 software#Wrong driver with Windows 7|radino32 driver installation on Windows 7]] explains how to do so.
  
===Compiling sketches===
+
===Bootloader is not recognized===
As the Arduino team removed the gcc compiler for ARM based devices from Arduino IDE 1.6.2 and following. The sketches for the radino32 can only be compiled with versions 1.6.0 or 1.6.1 of the Arduino IDE.
+
Please look at [[radino/radino32 software#radino32_USB_connection_fails|radino32 USB connection fails]]
* Select radino32 under "Tools->Board".
+
* Hit the Verify button.
+
 
+
 
+
===Uploading sketches===
+
* Start the bootloader on the radino32 as described above.
+
* Start uploading within the Arduino IDE.
+
* After the upload finished. Reset the radino32 and it will execute the uploaded sketch.
+
  
 
==Usage==
 
==Usage==
Line 95: Line 68:
 
The radino32 module has two external hardware UARTS, named Serial1 and Serial2.
 
The radino32 module has two external hardware UARTS, named Serial1 and Serial2.
 
Both support baud rates up to 115200.
 
Both support baud rates up to 115200.
 +
 +
 +
===USB serial===
 +
The USB serial is started by using
 +
serial.begin();
 +
within your setup routine.
 +
Afterwards it is used simliar to the UARTs.
 +
If problems arise please have a look at [[radino/radino32 software#radino32_USB_connection_fails|radino32 USB connection fails]]
 +
 +
====Getting USB serial drivers====
 +
* st offers drivers for the stm32s virtual com port on their website [https://www.st.com http://www.st.com]. Find them by searching for '''virtual com port driver'''
 +
* Direct link to the drivers page: [http://www.st.com/web/en/catalog/tools/PF257938 http://www.st.com/web/en/catalog/tools/PF257938]
  
 
===GPIOs===
 
===GPIOs===
  
The radino32 module has 23 multifunctional GPIOs (15 PWM, 10 ADC IN, 1 DAC OUT).
+
The radino32 module has 23 multifunctional GPIOs (14 PWM, 10 ADC IN, 1 DAC OUT).
 
See the table below for which pins belong to which group.
 
See the table below for which pins belong to which group.
  
Line 106: Line 91:
 
|-
 
|-
 
|style="text-align:center;"|PWM (out)
 
|style="text-align:center;"|PWM (out)
|style="text-align:center;"|A0, A1, A3, 2, 3, 5, 6, 10, 11, 12, 13, 14, 15, 16, 18
+
|style="text-align:center;"|A0, A3, 2, 3, 5, 6, 10, 11, 12, 13, 14, 15, 16, 18
 
|-
 
|-
 
|style="text-align:center;"|DAC (out)
 
|style="text-align:center;"|DAC (out)
Line 118: Line 103:
 
|-
 
|-
 
|}
 
|}
 +
  
 
====Writing====
 
====Writing====
Line 153: Line 139:
 
|-
 
|-
 
|}
 
|}
 +
  
 
====Reading====
 
====Reading====
Line 171: Line 158:
 
It will not work if you try to read a digital pin with analogRead or vice-versa.
 
It will not work if you try to read a digital pin with analogRead or vice-versa.
  
[[category:radino]]
+
===WiFi===
 +
 
 +
Sketches using WiFi (IC_ESP library) only need modified include headers:
 +
 
 +
  #include <radino32_UART.h>
 +
  #include <IC_ESP.h>
 +
 
 +
The rest works similar to the sketches for the radino modules.

Latest revision as of 10:41, 25 July 2017

This product is End of Life

This page is out of date
visit radino/radino32 software

This page describes how to use the radino32 module.

Descriptions are limited mostly to differences to the radino modules. For the rest see radino WiFi software.

[edit] Overview

The radino Library since version 4 includes all files required to compile and upload sketches using the Arduino 1.6.0 / 1.6.1.

Extract this library into your %ARDUINO_APPDATA% folder as described at Install radino library.

Afterwards the radino32 is selectable within the Arduino IDE under "Tools->Board" as "radino32 USB-Load".

[edit] Howto

[edit] Compiling sketches

As the Arduino team removed the gcc compiler for ARM based devices from Arduino IDE 1.6.2 and following. The sketches for the radino32 can only be compiled with versions 1.6.0 or 1.6.1 of the Arduino IDE.

  • Select "radino32 USB-Load" under "Tools->Board". (All radino32 can be programmed using this option)
  • Hit the Verify button.

[edit] Uploading sketches

  • Start the bootloader on the radino32 as described here: Starting the bootloader
  • Start uploading within the Arduino IDE.
  • After the upload finished. Reset the radino32 and it will execute the uploaded sketch.

[edit] Starting the bootloader

Method 1:

  • Pull pin "BOOT_SEL" high (You can achieve this by shortening the pin with "VCC" directly besides it).
  • Apply a high pulse to pin "RESET".
  • Release pin "BOOT_SEL".

Method 2:

  • Disable supply voltage to the module.
  • Pull pin "BOOT_SEL" high (You can achieve this by shortening the pin with "VCC" derectly besides it).
  • Apply supply voltage.
  • Release pin "BOOT_SEL".

Method 3:

[edit] Installing bootloader drivers

  • After entering the Bootloader windows will detect the new device.
  • Use the zadig driver installation tool under "%ARDUINO_APPDATA_FOLDER%/hardware/ICT_Boards/stm32l1/driver/win" to install drivers for the STM32 Bootloader.
  • Make sure within the installation tool "libusbK (v3.0.7.0)" is selected.

On Windows 7 or newer it is necessary to prevent installation of other stm32 drivers. radino32 driver installation on Windows 7 explains how to do so.

[edit] Bootloader is not recognized

Please look at radino32 USB connection fails

[edit] Usage

[edit] UART

The radino32 module has two external hardware UARTS, named Serial1 and Serial2. Both support baud rates up to 115200.


[edit] USB serial

The USB serial is started by using

serial.begin();

within your setup routine. Afterwards it is used simliar to the UARTs. If problems arise please have a look at radino32 USB connection fails

[edit] Getting USB serial drivers

[edit] GPIOs

The radino32 module has 23 multifunctional GPIOs (14 PWM, 10 ADC IN, 1 DAC OUT). See the table below for which pins belong to which group.

Available GPIOs on the radino32 module.
group pins
PWM (out) A0, A3, 2, 3, 5, 6, 10, 11, 12, 13, 14, 15, 16, 18
DAC (out) A2
digital A0, A1, A2, A3, A5, 0, 1, 2, 3, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 25, 26, 27
ADC (in) A0, A1, A2, A3, A5, 6, 10, 11, 12, 13


[edit] Writing

In order to write to a GPIO you have to set the pinMode first. Digital pins can use mode OUTPUT or OUTPUT_OPEN_DRAIN. For analog pins you have to set mode to PWM.

   pinMode(digitalPin, OUTPUT);
   pinMode(analogPin, PWM);

To write a GPIO you can use digitalWrite (values: LOW, HIGH) and analogWrite (values: 0 - 1023) respectively.

   digitalWrite(digitalPin, HIGH);
   analogWrite(analogPin, 1023);

To set the GPIO in one cycle you have to use constants as pin numbers. This way you can toggle the GPIO with full clock speed.

   digitalWrite(5, HIGH);
This table shows which pinMode can be used for digital and analog pins.
mode PWM pins
pinMode(PWM)
DAC pin
pinMode(PWM)
output
pinMode(OUTPUT)
pinMode(OUTPUT_OPEN_DRAIN)
analog yes
(pwm signal)
yes
(voltage level)
-
digital - - yes


[edit] Reading

Similar to writing you have to setup the GPIO pins first. You can set pinMode to INPUT or INPUT_PULLUP. INPUT_FLOATING is a synonym for INPUT. For Analog pins use INPUT_ANALOG

   pinMode(digitalPin, INTPUT_PULLUP);
   pinMode(analogPin, INTPUT_ANALOG);

To read a GPIO you can use digitalRead and analogRead respectively.

  int digitalValue = digitalRead(digitalPin);
  int analogValue = analogRead(analogPin);

It will not work if you try to read a digital pin with analogRead or vice-versa.

[edit] WiFi

Sketches using WiFi (IC_ESP library) only need modified include headers:

  #include <radino32_UART.h>
  #include <IC_ESP.h>

The rest works similar to the sketches for the radino modules.

Personal tools