The UART port is a standard TTL level 3-pin serial port (RX, TX, GND). The UART port can be used directly with directly with flight controllers such as the PixHawk 4. It is also possible to setup a network to serial relay, or a direct serial to serial link over the network. Please refer to Doodle Labs’ Tech Library for an Application Note on using the serial port for further details.
The USB Device Port only supports Ethernet over USB protocols. It works with Laptops and Tablets as long as they support Ethernet over USB. The USB Device Port uses the ETH0 interface logically.
The USB port is a host port and is pre-configured as an Ethernet over USB interface. When plugged into a USB device or OTG port with a compatible Ethernet over USB configuration, a new interface, USB0, will be instantiated and bridged to the WAN interface. It is then possible to access the Smart Radio over the web browser or SSH at the default static IP address defined earlier. It is possible to install other USB packages to include other USB functions for your application.
The Smart Radio has a USB hub inside and USB ports are accessible on the main and secondary connectors. USB0 on the main connector does not have a 5-V supply associated with it.
In hardware version J and later, GPIOs are available for programming. The GPIOs are provided by an on-board MCU and interfaced to the Operating System over USB HID. A program “sr-ctrl-usb” is pre-installed in the system and is used to access the GPIOs. The general syntax for accessing the MCU is
r/w is either “0” for read or “1” for write. The parameter numbers for the three GPIOs are tabulated below. The possible values which can be read or written are “0 and “1” and correspond to 0-V and 3.3-V. Table 2 summarizes GPIO parameters.
Table 2: GPIO Parameters
Param # |
Function |
6 |
Logic level of GPIO1, 0 is GND and 1 is 3.3-V |
7 |
Logic level of GPIO2, 0 is GND and 1 is 3.3-V |
8 |
Logic level of GPIO3, 0 is GND and 1 is 3.3-V |
11 |
Direction of GPIO1, 0 is Output and 1 is Input |
12 |
Direction of GPIO2, 0 is Output and 1 is Input |
13 |
Direction of GPIO3, 0 is Output and 1 is Input |
As an example, if we want to write a level 1 to GPIO2, we first set the direction of GPIO2 to 0 and then we set the logic level to 1.
We can read the logic level of GPIO3 with,
Note that the GPIO directions are reset to input when the MCU is reset. When the MCU is reset, a reset flag is raised at param # 13 and it should be reset to zero by the user.
For very low power monitoring applications, the Smart Radio can be configured to completely shut down and wake up on a timer. In order to conserve power, the CPU itself shuts down and it requires around 30 seconds to boot up again. The command to shutdown the system is,
where <time in seconds> is the amount
of time that the CPU should shut down for. This feature is only available in -J
hardware variants.