Waiting for USB Serial Are you using this with your Serial.begin command on an Arduino with USB serial? We found on the MKR GSM 1400 and Arduino Micro this would cause the program to not run if the Arduino serial monitor was not open! Doing this fixed it:
All posts by
Soft Reset
LED Pin
Always given the IO pin define: LED_BUILTIN Will be automatically set as an output
MKR GSM 1400
Product page: https://store.arduino.cc/mkr-gsm-1400 Arduino guide page https://www.arduino.cc/en/Guide/MKRGSM1400 Arduino GSM Library: https://www.arduino.cc/en/Reference/MKRGSM https://github.com/arduino-libraries/MKRGSM Schematic: https://content.arduino.cc/assets/MKRGSM_V2.2_sch.pdf GSM Specs 3G with 2G fallback Serial ports USB connector – virtual serial port using the Serial object Serial1 – Hardware serial port on pins 13/14, instead Reset button Reset button causes the microcontroller to reset and resets USB communication. IO […]
Registers
Setting microcontroller registers directly Examples Reading microcontroller registers directly Examples
Arduino Mega2560
https://store.arduino.cc/mega-2560-r3 Microcontroller: ATmega2560https://www.microchip.com/wwwproducts/en/atmega2560 Power Power in: From the USB connectors (5V) or the DC plug (7-12V) 5V reg: LD1117S50CTR, 2%, 1V dropout, 800mA output current rated IO Pins IO voltage: 5V IO pin high voltage (for VCC = 5V): min 0.6VCC to max VCC + 0.5So digital IO pins are compatible with 3.3V input signals. IO […]
Disable interrupts
9 bit data, mark space parity
The Atmega supports 9 bit data, but the Arduino library doesn’t. Your only option using it (at least currently) is odd or even parity for the 9th data bit, there is no mark of space parity made available in via the library. This is a problem when communicating on say RS485 busses where mark and […]
UART RX
Clearing the incoming Serial buffer The flush() method only clears the transmit buffer, it has no effect on the rx buffer. This code will clear the receive buffer:
UART TX
Waiting for TX to complete – Flush When you issue a Serial.print() or Serial.write() , the function returns almost immediately. Instead of waiting until the string or data has been transmitted, it sets up a buffer for the data which is then transmitted via interrupts one byte at a time. I.e., your program keeps running, […]
