Thermal printing with real-time monitoring and barcode generation perfect for POS terminals, ticket machines, and industrial meters
A
A
Hardware Overview
How does it work?
Printer Click is based on the NL022, a thermal printer head controller from Norden Logic designed for high-performance control of thermal printer heads, such as Seiko’s LTP02_245 series, including models like LTP02_245_13 with a 7.2V supply and LTP02_245_C1 with a 4.2V supply, but also WinsPu TP2PX, PRT technology PT48DS-B, and YAEN YAEN208. The board receives power through the VIN terminal, which provides a stable and configurable input voltage to accommodate different thermal print heads, ensuring reliable operation across various supply requirements. This advanced controller communicates with the host MCU via the UART interface and adheres to the widely used ESC/POS programming standard, making it a highly adaptable solution for various printing applications, including medical devices, taxi meters, ticket machines, handheld POS terminals, industrial meters, and cash registers. The NL022 excels due to its ARM-based architecture, offering vast RAM and Flash memory, real-time head temperature monitoring, and a
responsive paper-out detection system. It supports user-definable flash storage and incorporates an extensive selection of built-in language fonts covering 170 languages, including UTF-8 and UTF-16 character encoding, as well as Chinese and Japanese script support. Custom font management and compatibility with ESC commands allow users to tailor text and print output to specific requirements. It is highly recommended to verify that your module is running firmware version 1.22. If it is not, you will need to upgrade the firmware to version 1.22 to ensure improved functionality and access to newly supported printer heads. The NL022 also supports a wide range of font attributes such as double width, double height, bold, italic, reverse, underline, and normal styles, ensuring customizable print output. It enables seamless 1D barcode printing, including formats like UPC-A, UPC-E, EAN-13, EAN-8, CODE39, CODE93, ITF25, CODABAR, and CODE128-A, while 2D barcodes, such as QR codes, can be generated directly on-chip using ESC commands. Additionally,
the NL022 integrates essential real-time monitoring functionalities, including an overheat monitor for thermal head protection, a paper-out detection system to prevent printing errors, and a platen-out monitor for smooth operation. As previously mentioned, this board communicates with the host MCU through the UART interface, using the TX and RX pins with a default baud rate of 115200bps for efficient data exchange. In addition to interface pins, the board also uses the INT pin, which functions as a ready-to-send signal. When the INT pin is in a LOW state, the NL022 controller is ready to receive and process data, whereas a HIGH state indicates that the controller is busy and cannot accept new data at that moment. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. It also comes equipped with a library containing functions and example code that can be used as a reference for further development.
Features overview
Development board
EasyAVR v7 is the seventh generation of AVR development boards specially designed for the needs of rapid development of embedded applications. It supports a wide range of 16-bit AVR microcontrollers from Microchip and has a broad set of unique functions, such as a powerful onboard mikroProg programmer and In-Circuit debugger over USB. The development board is well organized and designed so that the end-user has all the necessary elements in one place, such as switches, buttons, indicators, connectors, and others. With four different connectors for each port, EasyAVR v7 allows you to connect accessory boards, sensors, and custom electronics more
efficiently than ever. Each part of the EasyAVR v7 development board contains the components necessary for the most efficient operation of the same board. An integrated mikroProg, a fast USB 2.0 programmer with mikroICD hardware In-Circuit Debugger, offers many valuable programming/debugging options and seamless integration with the Mikroe software environment. Besides it also includes a clean and regulated power supply block for the development board. It can use a wide range of external power sources, including an external 12V power supply, 7-12V AC or 9-15V DC via DC connector/screw terminals, and a power source via the USB Type-B (USB-B)
connector. Communication options such as USB-UART and RS-232 are also included, alongside the well-established mikroBUS™ standard, three display options (7-segment, graphical, and character-based LCD), and several different DIP sockets which cover a wide range of 16-bit AVR MCUs. EasyAVR v7 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Architecture
AVR
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
40
RAM (Bytes)
2048
You complete me!
Accessories
Thermal Printer Head – 7.2V (LTP02-245-13C) is a high-resolution thermal line printer head from Seiko Printers that delivers precision and reliability with 384 printable dots per line. Featuring a high-density print head of 8 dots/mm and a maximum print speed of 100mm/s, it ensures clear, fast, and low-noise operation. Its compact dimensions of 67.3×18.1×30.0mm and lightweight design of 28g simplify integration, while the platen unit open mechanism enables easy paper installation. Maintenance-free functionality and precise 0.03125mm paper feed pitch further enhance its performance. This printer head is ideal for applications such as measuring instruments, analyzers, POS systems, communication terminals, and data terminal devices, where reliable and efficient printing is essential.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
This Click board can be interfaced and monitored in two ways:
Application Output
- Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
UART Terminal
- Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Software Support
Library Description
Printer Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.
Example Description
This example demonstrates the use of Printer Click board by providing user interaction with a thermal printer, allowing the user to check paper status, display commands, and execute various printing tasks based on user commands through a UART interface.
Key functions:
printer_cfg_setup
- Config Object Initialization function.printer_init
- Initialization function.printer_default_cfg
- Click Default Configuration function.printer_get_status
- This function reads the paper status and temperature of the printer and stores results in ctx->status string buffer.printer_get_fw_info
- This function reads the firmware information of the printer and stores results in ctx->fw_info string buffer.printer_print_string_lf
- This function prints a string message with line feed.
Application Init
Initializes the driver, performs the Click default configuration, and displays the list of supported commands on the USB UART.
Application Task
Checks the paper status and processes user commands.
Additional Notes and Information
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief Printer Click Example.
*
* # Description
* This example demonstrates the use of Printer Click board by providing user interaction
* with a thermal printer, allowing the user to check paper status, display commands,
* and execute various printing tasks based on user commands through a UART interface.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver, performs the Click default configuration, and displays the list
* of supported commands on the USB UART.
*
* ## Application Task
* Checks the paper status and processes user commands.
*
* @note
* The default printer head type is set to LTP02-245-13.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "printer.h"
static printer_t printer;
static log_t logger;
/**
* @brief Printer check paper function.
* @details This function checks if the paper is presented and feeds the newly inserted paper.
* @return None.
* @note None.
*/
static void printer_check_paper ( printer_t *ctx );
/**
* @brief Printer display commands function.
* @details This function displays the list of supported terminal commands on the USB UART.
* @return None.
* @note None.
*/
static void printer_display_commands ( void );
/**
* @brief Printer parse command function.
* @details This function checks if the input command is supported and executes it.
* @param[in] ctx : Click context object.
* See #printer_t object definition for detailed explanation.
* @param[in] command : Command input, for more details refer to @b printer_display_commands function.
* @return @li @c 0 - Success,
* @li @c -1 - Wrong command or command is not executed properly.
* See #err_t definition for detailed explanation.
* @note None.
*/
static err_t printer_parse_command ( printer_t *ctx, uint8_t command );
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
printer_cfg_t printer_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.
printer_cfg_setup( &printer_cfg );
PRINTER_MAP_MIKROBUS( printer_cfg, MIKROBUS_1 );
if ( UART_ERROR == printer_init( &printer, &printer_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( PRINTER_ERROR == printer_default_cfg ( &printer ) )
{
log_error( &logger, " Default configuration." );
for ( ; ; );
}
printer_display_commands ( );
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
uint8_t command = 0;
printer_check_paper ( &printer );
if ( 1 == log_read ( &logger, &command, 1 ) )
{
printer_parse_command ( &printer, command );
}
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
static void printer_check_paper ( printer_t *ctx )
{
static uint8_t valid_change = 0;
static uint8_t no_paper = 0;
if ( PRINTER_OK == printer_get_status ( ctx ) )
{
if ( '0' == printer.status[ 0 ] )
{
if ( !no_paper )
{
// Confirm paper status change with 10 consecutive validation before taking actions
if ( ++valid_change > 10 )
{
log_printf ( &logger, "No paper detected!\r\n" );
no_paper = 1;
valid_change = 0;
}
}
}
else
{
if ( no_paper )
{
// Confirm paper status change with 10 consecutive validation before taking actions
if ( ++valid_change > 10 )
{
// Feeding inserted paper
for ( uint8_t cnt = 0; cnt < 5; cnt++ )
{
printer_print_lf ( ctx );
Delay_ms ( 10 );
}
log_printf ( &logger, "Paper OK!\r\n" );
no_paper = 0;
valid_change = 0;
}
}
}
Delay_ms ( 100 );
}
}
static void printer_display_commands ( void )
{
log_printf( &logger, "--- UART commands list (no case sensitive) ---\r\n" );
log_printf( &logger, "'+' - New line / Feed paper.\r\n" );
log_printf( &logger, "'T' - Print \"MIKROE - Printer Click\" message.\r\n" );
log_printf( &logger, "'R' - Print POS receipt sample.\r\n" );
Delay_ms ( 10 );
log_printf( &logger, "'A' - Print tab and alignment sample.\r\n" );
log_printf( &logger, "'S' - Get status.\r\n" );
log_printf( &logger, "'F' - Get firmware information.\r\n" );
log_printf( &logger, "'L' - Display commands list.\r\n" );
Delay_ms ( 10 );
}
static err_t printer_parse_command ( printer_t *ctx, uint8_t command )
{
err_t error_flag = PRINTER_OK;
log_printf( &logger, "\r\n" );
switch ( command )
{
case '+':
{
log_printf( &logger, "Printing New Line / Feed paper\r\n" );
error_flag |= printer_print_lf ( ctx );
break;
}
case 'T': case 't':
{
log_printf( &logger, "Printing \"MIKROE - Printer Click\" message.\r\n" );
error_flag |= printer_soft_init ( ctx );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_CENTER );
error_flag |= printer_set_font_type ( ctx, PRINTER_FONT_TYPE_NORMAL );
error_flag |= printer_print_string_lf ( ctx, "MIKROE - Printer Click" );
error_flag |= printer_print_lines ( ctx, 1 );
break;
}
case 'R': case 'r':
{
log_printf( &logger, "Printing POS receipt sample.\r\n" );
error_flag |= printer_soft_init ( ctx );
error_flag |= printer_set_font_grayscale ( ctx, PRINTER_GRAYSCALE_4 );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_CENTER );
error_flag |= printer_set_font_type ( ctx, PRINTER_FONT_TYPE_BOLD );
error_flag |= printer_print_string_lf ( ctx, "MIKROE" );
error_flag |= printer_set_font_type ( ctx, PRINTER_FONT_TYPE_NORMAL );
error_flag |= printer_print_lines ( ctx, 1 );
error_flag |= printer_print_string_lf ( ctx, "Customer Receipt" );
error_flag |= printer_print_lines ( ctx, 2 );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_LEFT );
error_flag |= printer_print_string_lf ( ctx, "Date: DD/MM/YYYY" );
error_flag |= printer_print_string_lf ( ctx, "PID: 034/344/00288394" );
error_flag |= printer_print_lines ( ctx, 2 );
error_flag |= printer_print_string_lf ( ctx, " Qty Item Price" );
error_flag |= printer_print_string_lf ( ctx, "................................" );
error_flag |= printer_print_string_lf ( ctx, "2x 1L 1.5% Milk $3.98" );
error_flag |= printer_print_string_lf ( ctx, "6x 1L 3.5% Milk $16.75" );
error_flag |= printer_print_string_lf ( ctx, "10x 100g Yogurt Cup $8.50" );
error_flag |= printer_print_string_lf ( ctx, "................................" );
error_flag |= printer_set_font_type ( ctx, PRINTER_FONT_TYPE_BOLD );
error_flag |= printer_print_string_lf ( ctx, "Total: $29.23" );
error_flag |= printer_print_lines ( ctx, 1 );
error_flag |= printer_set_font_type ( ctx, PRINTER_FONT_TYPE_NORMAL );
error_flag |= printer_print_string_lf ( ctx, "Incl. 19% VAT $5.55 (Net $23.68)" );
error_flag |= printer_print_string_lf ( ctx, "................................" );
error_flag |= printer_set_font_type ( ctx, PRINTER_FONT_TYPE_DOUBLE_HEIGHT );
error_flag |= printer_print_string_lf ( ctx, "Credit Card $29.23" );
error_flag |= printer_print_lines ( ctx, 2 );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_CENTER );
error_flag |= printer_print_string_lf ( ctx, "THANK YOU FOR YOUR VISIT" );
error_flag |= printer_print_lines ( ctx, 2 );
break;
}
case 'A': case 'a':
{
uint8_t tabs[ 3 ] = { 8, 24, 38 };
log_printf( &logger, "Printing tab and alignment sample.\r\n" );
error_flag |= printer_soft_init ( ctx );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_LEFT );
error_flag |= printer_set_horizontal_tab ( ctx, tabs, 3 );
error_flag |= printer_set_font_type ( ctx, PRINTER_FONT_TYPE_NORMAL );
error_flag |= printer_print_string_lf ( ctx, "................................" );
error_flag |= printer_print_string_lf ( ctx, "No Tab: abcd" );
error_flag |= printer_horizontal_tab ( ctx );
error_flag |= printer_print_string ( ctx, "Tab1" );
error_flag |= printer_horizontal_tab ( ctx );
error_flag |= printer_print_string ( ctx, "Tab2" );
error_flag |= printer_horizontal_tab ( ctx );
error_flag |= printer_print_string_lf ( ctx, "Tab3" );
error_flag |= printer_print_string_lf ( ctx, "................................" );
error_flag |= printer_set_abs_print_pos ( ctx, 50 );
error_flag |= printer_print_string_lf ( ctx, "Abs: 1234" );
error_flag |= printer_print_string_lf ( ctx, "................................" );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_CENTER );
error_flag |= printer_print_string_lf ( ctx, "Center: abcd" );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_RIGHT );
error_flag |= printer_print_string_lf ( ctx, "Right: abcd" );
error_flag |= printer_set_alignment ( ctx, PRINTER_ALIGN_LEFT );
error_flag |= printer_print_string_lf ( ctx, "Left: abcd" );
error_flag |= printer_print_string_lf ( ctx, "................................" );
break;
}
case 'S': case 's':
{
error_flag |= printer_get_status ( ctx );
if ( PRINTER_OK == error_flag )
{
log_printf ( &logger, "--- Status ---\r\n" );
log_printf ( &logger, "%s", printer.status );
if ( '0' == printer.status[ 0 ] )
{
log_printf ( &logger, "No paper detected!\r\n" );
}
else
{
log_printf ( &logger, "Paper OK!\r\n" );
}
}
break;
}
case 'F': case 'f':
{
error_flag |= printer_get_fw_info ( ctx );
if ( PRINTER_OK == error_flag )
{
log_printf ( &logger, "--- Firmware information ---\r\n" );
log_printf ( &logger, "%s", printer.fw_info );
uint8_t head_type_index = strlen ( ( char * ) printer.fw_info ) - 3;
log_printf ( &logger, "Printer head type: " );
if ( '0' == printer.fw_info[ head_type_index ] )
{
log_printf ( &logger, "MM58_FTP628MCL101\r\n" );
}
else if ( '1' == printer.fw_info[ head_type_index ] )
{
log_printf ( &logger, "MM80_FTP638MCL101\r\n" );
}
else if ( '2' == printer.fw_info[ head_type_index ] )
{
log_printf ( &logger, "MM58_LTP02_245_13\r\n" );
}
else if ( '3' == printer.fw_info[ head_type_index ] )
{
log_printf ( &logger, "MM58_LTP02_245_C1\r\n" );
}
else
{
log_printf ( &logger, "UNKNOWN\r\n" );
}
}
break;
}
case 'L': case 'l':
{
printer_display_commands ( );
break;
}
default :
{
log_error( &logger, "Unknown command." );
error_flag |= PRINTER_ERROR;
break;
}
}
log_printf( &logger, "----------------------------------------------\r\n" );
Delay_ms ( 100 );
return error_flag;
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:Miscellaneous