TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136853 times)
  2. FAT32 Library (69999 times)
  3. Network Ethernet Library (55996 times)
  4. USB Device Library (46293 times)
  5. Network WiFi Library (41896 times)
  6. FT800 Library (41204 times)
  7. GSM click (29012 times)
  8. PID Library (26423 times)
  9. mikroSDK (26394 times)
  10. microSD click (25385 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

OOK RX click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.13

mikroSDK Library: 2.0.0.0

Category: Sub-1 GHz Transceivers

Downloaded: 105 times

Not followed.

License: MIT license  

OOK RX click is a wireless receiver that operates at the frequency of 433MHz (sub-GHz). This device allows realization of a simple, low-speed wireless ad hoc communication network between a receiver and compatible transmitter.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "OOK RX click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "OOK RX click" changes.

Do you want to report abuse regarding "OOK RX click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


OOK RX click

OOK RX click is a wireless receiver that operates at the frequency of 433MHz (sub-GHz). This device allows realization of a simple, low-speed wireless ad hoc communication network between a receiver and compatible transmitter.

ookrx_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Nov 2023.
  • Type : GPIO type

Software Support

We provide a library for the OOK RX Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for OOK RX Click driver.

Standard key functions :

  • ookrx_cfg_setup Config Object Initialization function.

    void ookrx_cfg_setup ( ookrx_cfg_t *cfg );
  • ookrx_init Initialization function.

    err_t ookrx_init ( ookrx_t *ctx, ookrx_cfg_t *cfg );

Example key functions :

  • ookrx_enable_device This function enables device by setting the EN pin to high logic state.

    void ookrx_enable_device ( ookrx_t *ctx );
  • ookrx_wait_ready This function waits for all training bytes to arrive which indicates data ready.

    static void ookrx_wait_ready ( ookrx_t *ctx );
  • ookrx_read_packet This function reads data packet and stores it in a packet_buf only if the OOKRX_PREAMBLE bytes are received successfully.

    static uint8_t ookrx_read_packet ( ookrx_t *ctx );

Example Description

This example demonstrates the use of OOK RX click board by reading and parsing packet messages received from the transmitter.

The demo application is composed of two sections :

Application Init

Initializes the driver and enables the device and squelch mode.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    ookrx_cfg_t ookrx_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    ookrx_cfg_setup( &ookrx_cfg );
    OOKRX_MAP_MIKROBUS( ookrx_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == ookrx_init( &ookrx, &ookrx_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    ookrx_enable_squelch ( &ookrx );
    ookrx_enable_device ( &ookrx );

    log_info( &logger, " Application Task " );
}

Application Task

Waits for a data ready indication, then reads all packet data, verifies the CRC bytes in a packet, and displays its data as well as the RSSI value on the USB UART.

void application_task ( void )
{
    static float rssi_v = 0;
    static uint8_t packet_len = 0;
    static uint8_t msg_cnt = 0;
    static uint16_t crc = 0;

    log_printf( &logger, "\r\n Waiting for data ready...\r\n" );
    ookrx_wait_ready ( &ookrx );
    packet_len = ookrx_read_packet ( &ookrx );
    if ( packet_len )
    {
        ookrx_read_rssi_voltage ( &ookrx, &rssi_v );
        crc = ( ( uint16_t ) packet_buf[ packet_len - 2 ] << 8 ) | packet_buf[ packet_len - 1 ];
        if ( crc == micrftx2_calculate_crc16 ( packet_buf, packet_len - 2 ) )
        {
            log_printf( &logger, " Received message: " );
            for ( msg_cnt = 0; msg_cnt < packet_buf[ 2 ]; msg_cnt++ )
            {
                log_printf( &logger, "%c", ( uint16_t ) packet_buf[ msg_cnt + 3 ] );
            }
            log_printf( &logger, "\r\n RSSI: %.1f dBm\r\n", OOKRX_RSSI_V_TO_DBM ( rssi_v ) );
        }
    }
    Delay_ms ( 100 );
}

Note

The OOK TX click board is a compatible transmitter for the OOK RX click. Here are a few steps for troubleshooting if you are experiencing issues running this example:

  • Check the MCU clock configuration, use an external oscillator instead of the MCU's internal one for better accuracy on manchester data rate delay.
  • Measure the actual data rate on the data line and adjust the OOKRX_MAN_BIT_LEN_US value accordingly.

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.OOKRX

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

Stepper 8 click

5

Stepper 8 Click is Click board based on TC78H670FT from Toshiba, a clock-in and serial controlled Bipolar Stepping Motor Driver which can drive a 128 micro-stepping motor with a power supply ranging from 2.5V to 16V for wide range of applications includes USB-powered, battery-powered, and standard 9-12V system devices.

[Learn More]

Matrix R click

0

Matrix R click is a mikroBUS add-on board with two red 5x7 matrices driven by two MAX7219 8-bit LED Display Drivers. The active area of each matrix is 7.62mm high and 5.08 mm wide. 7x5 is a standard resolution for displaying ASCII characters, so the click is essentially a dual-character display capable of showing letters in more readable typefaces compared to a 14-segment display. The click communicates with the target MCU through the mikroBUS:tm: SPI interface with two separate Chip Select lines for each matrix (CSL for the left, CSR for the right). This board is designed to use a 5V power supply.

[Learn More]

TouchKey 2 click

1

TouchKey 2 click has four capacitive pads powered by ATtiny817 which has an integrated touch QTouch® controller. The click is designed to run on a 3.3V power supply. The four LEDs onboard the click indicate the Key (Pad) is pressed. TouchKey 2 click communicates with the target microcontroller over UART and SPI interface.

[Learn More]