AVR

Si4463 Wireless Library: A Wireless Communication Solution for AVR and Arduino

This is a library for the Silicon Labs Si4463 wireless IC, which has been used in (or will be used in) some of my projects. The Si4463 offers various configuration options, including modulation, data packet format, and CRC algorithm, and can output up to +20dBm (100mW) of power. Additionally, the Si4463 is also used in many pre-made modules, such as the HopeRF RFM26W and the Dorji_Com DRF4463F. The entire Si446x transceiver series should also be compatible with this library.

This library allows users to configure the chip to send and receive variable-length data packets (up to 128 bytes) and trigger callback functions when events occur (such as receiving new data packets and completing data packet transmission). These callback functions run directly from the interrupt routine, making the program’s response to events much faster than with polling libraries.

Download from GitHub
Documentation

Pinout

Si4463ATmega328Arduino UnoArduino MegaDescription
VCC3.3V3.3V3.3VPower (3.3V)
GPIO0
GPIO1
SDOB4 (18)1250SPI MISO
SDIB3 (17)1151SPI MOSI
SCLKB5 (19)1352SPI SCK
NSELB2 (16)1010

High-Precision Timing Library for AVR

This lightweight library is specifically designed for millisecond-level time tracking. It supports the “unsigned long long” data type, allowing it to accurately track up to 584.9 million years! Additionally, it can adapt to clock frequencies of up to 20MHz, with most common frequencies having no timing errors.

Compared to Arduino’s built-in millis() timer, this library is especially useful when running at clock frequencies of 8MHz or below or when tracking time for more than 50 days.

Download from GitHub

Brief comparison against the Arduino millis()

Arduino millis()

  • Microsecond support
  • Doesn’t loose or gain time at any clock frequency
  • Loss of resolution at lower frequencies

This library

  • Faster execution
  • Less RAM used
  • Always updates millisecond count every millisecond
  • Support for ‘unsigned long long’ data type, 64 bit integer allows tracking time for up to 584.9 million years, Arduino millis() uses ‘unsigned long’ which goes up to 49.71 days
  • Uses CTC mode for the timer, which might make it a little bit more difficult to use the timer for multiple things

Accuracy at commonly used clock frequencies

ClockThis library (TIMER0)This library (TIMER1)

From Arduino to AVR Microcontrollers: My Electronic Journey

I’ve been following Arduino and finally got my hands on an Uno and a 16×2 character LCD with RGB backlight. This new electronic world is exciting me. For years, I’ve been interested in digital control devices like LCDs, wondering how to use them, but was always blocked by the complexity of microcontrollers. However, using Arduino’s LCD library made it easy to connect the LCD, and I quickly made a stereo audio VU meter and a basic FFT spectrum analyzer.

Next, I started exploring wireless technology. I bought NRF24L01 wireless modules, a USBASP AVR programmer, a USB to UART converter, and an ATMega168 microcontroller from Ebay. Using the Mirf library, I successfully made one controller change the LCD backlight color of another controller.

After getting used to the Arduino IDE, I wanted to dive deeper into how the code truly controls the chip. So, I downloaded Atmel Studio 6, the ATMega168 chip datasheet, and followed tutorials on avrfreaks.net to learn the basics of AVR microcontrollers, starting from timers and interrupts. Now, I’ve grasped the basics of AVR microcontrollers and have many project ideas involving AVR uCs.