4.5.4. UART
There are 2 UARTs in Waspmote: UART0 and UART1. Besides, there are several ports which might be connected
to these UARTs through 2 different multiplexers, one for each UART.
UART0 is shared by the USB port and the Socket0. This socket is used for XBee modules, LoRaWAN module,
•
LoRa module, Sigfox module, RFID/NFC module, Bluetooth modules, WiFi module, RS-485 module, etc. The
multiplexer in this UART controls the data signal which by default is always switched to Socket0. When the
USB needs to send info through the UART0, the multiplexer is momentarily switched to the USB port and
set back again to Socket0 after printing.
UART1 is shared by 4 ports: Socket1, GPS socket, Auxiliar1 and Auxiliar2 sockets. It is possible to select in
•
the same program which of the 4 ports is connected to UART1 in the microcontroller. UART1 multiplexer
configuration is carried out using the following instructions:
{
Utils.setMuxAux1(); // set Auxiliar1 socket
Utils.setMuxAux2(); // set Auxiliar2 socket
Utils.setMuxGPS();
Utils.setMuxSocket1(); // set Socket1
}
4.5.5. I2C
The I2C communication bus is also used in Waspmote where several devices are connected in parallel: the
accelerometer, a crypto-authentication memory and the RTC. In all cases, the microcontroller acts as master while
the other devices connected to the bus are slaves.
4.5.6. SPI
The SPI port on the microcontroller is used for communication with the micro SD card. All operations using the bus
are performed clearly by the specific library. The SPI port is also available in the SPI/UART connector and Socket0.
4.5.7. USB
USB is used in Waspmote for communication with a computer or compatible USB devices. This communication
allows the microcontroller's program to be loaded.
For USB communication, microcontroller's UART0 is used. The FT232RL chip carries out the conversion to USB
standard.
4.6. Real Time Clock - RTC
Waspmote has a built in Real Time Clock – RTC, which keeps it informed of the time. This allows Waspmote to be
programmed to perform time-related actions such as:
"Sleep for 1h 20 min and 15sec, then wake up and perform the following action.."
Or even programs to perform actions at absolute intervals, e.g.:
"Wake on the 5th of next month at 00:20 and perform the following action.."
All RTC programming and control is done through the I2C bus.
Alarms:
Alarms can be programmed in the RTC specifying day/hour/minute/second. That allows total control about when
the mote wakes up to capture sensor values and perform actions programmed on it. This allows Waspmote to
be in the saving energy modes (Deep Sleep and Hibernate) and makes it wake up just at the required moment.
// set GPS socket
-61-
Hardware
v8.2
Need help?
Do you have a question about the Waspmote and is the answer not in the manual?