Utilize the bidirectional serial communication capability, compliant with the ISO9141 standard, to enable effective diagnostics in automotive systems
A
A
Hardware Overview
How does it work?
ISO 9141 Click is based on the L9637, a monolithic bus driver designed to provide bidirectional serial communication in automotive diagnostic applications according to the specification "Diagnostic Systems ISO9141" from ST Microelectronics. The L9637 is also known as the K-Line Transceiver that provides a bidirectional link, called K, and a separate comparator, called L, to the related diagnosis bus that can be connected to a terminal labeled K and L on this Click board™. The K and L pins are protected against overvoltages and reverse battery conditions. All pins show high impedance characteristics during the lack of power supply or ground. The L9637 has a wide supply voltage range from 4.5V to 36V and several modes of operation like Standby Mode with low current consumption and overtemperature Shut-Down Mode. The overtemperature Shut-Down Mode switches OFF
the K output if the L9637's temperature increases above the thermal shut-down threshold. To reactivate K again, the temperature must decrease below the K switch ON temperature value. The outputs will be switched OFF and stay at high impedance to achieve no fault for the power supply undervoltage conditions. ISO 9141 Click communicates with MCU using the UART interface with the default baud rate of 9600bps and commonly used UART RX and TX pins for the data transfer. The UART input TX and output RX of K are associated with the logic voltage level from mikroBUS™ (VCC) with its integrated pull-up resistances. Also, the L comparator output pin LO has a pull-up resistance connected to VCC. All bus-defined inputs, L and K, have supply voltage-dependent thresholds and sufficient hysteresis to suppress line spikes. This Click board™ is easy to program because it does not require an
overly demanding configuration. Only what is necessary for the errorless work is the selection of the appropriate mode of operation, whether the Click board™ will work as a receiver or transmitter. In this way, the transmitter will send the data every 2 seconds while the receiving side will receive the data in a "byte-by-byte "format. This can also be seen in an example code that contains easy-to-use functions that may be used as a reference for further development. This Click board™ is designed to be operated with both 3.3V and 5V logic voltage levels that can be selected via VCC SEL jumper. This allows both 3.3V and 5V capable MCUs to use the UART communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Features overview
Development board
Arduino UNO is a versatile microcontroller board built around the ATmega328P chip. It offers extensive connectivity options for various projects, featuring 14 digital input/output pins, six of which are PWM-capable, along with six analog inputs. Its core components include a 16MHz ceramic resonator, a USB connection, a power jack, an
ICSP header, and a reset button, providing everything necessary to power and program the board. The Uno is ready to go, whether connected to a computer via USB or powered by an AC-to-DC adapter or battery. As the first USB Arduino board, it serves as the benchmark for the Arduino platform, with "Uno" symbolizing its status as the
first in a series. This name choice, meaning "one" in Italian, commemorates the launch of Arduino Software (IDE) 1.0. Initially introduced alongside version 1.0 of the Arduino Software (IDE), the Uno has since become the foundational model for subsequent Arduino releases, embodying the platform's evolution.
Microcontroller Overview
MCU Card / MCU

Architecture
AVR
MCU Memory (KB)
32
Silicon Vendor
Microchip
Pin count
28
RAM (Bytes)
2048
You complete me!
Accessories
Click Shield for Arduino UNO has two proprietary mikroBUS™ sockets, allowing all the Click board™ devices to be interfaced with the Arduino UNO board without effort. The Arduino Uno, a microcontroller board based on the ATmega328P, provides an affordable and flexible way for users to try out new concepts and build prototypes with the ATmega328P microcontroller from various combinations of performance, power consumption, and features. The Arduino Uno has 14 digital input/output pins (of which six can be used as PWM outputs), six analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header, and reset button. Most of the ATmega328P microcontroller pins are brought to the IO pins on the left and right edge of the board, which are then connected to two existing mikroBUS™ sockets. This Click Shield also has several switches that perform functions such as selecting the logic levels of analog signals on mikroBUS™ sockets and selecting logic voltage levels of the mikroBUS™ sockets themselves. Besides, the user is offered the possibility of using any Click board™ with the help of existing bidirectional level-shifting voltage translators, regardless of whether the Click board™ operates at a 3.3V or 5V logic voltage level. Once you connect the Arduino UNO board with our Click Shield for Arduino UNO, you can access hundreds of Click boards™, working with 3.3V or 5V logic voltage levels.
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
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for ISO 9141 Click driver.
Key functions:
iso9141_generic_write
- This function writes a desired number of data bytes by using UART serial interfaceiso9141_generic_read
- This function reads a desired number of data bytes by using UART serial interfaceiso9141_send_data
- This function send data
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 ISO 9141 Click Example.
*
* # Description
* This example demonstrates the use of an ISO 9141 click board by showing
* the communication between the two click boards.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initalizes device and makes an initial log.
*
* ## Application Task
* Depending on the selected application mode, it reads all the received data or
* sends the desired text message once per second.
*
* @author MikroE Team
*
*/
#include "board.h"
#include "log.h"
#include "iso9141.h"
// Comment out the line below in order to switch the application mode to receiver
#define DEMO_APP_TRANSMITTER
// Text message to send in the transmitter application mode
#define DEMO_TEXT_MESSAGE "MIKROE - ISO 9141 click board\r\n\0"
static iso9141_t iso9141;
static log_t logger;
void application_init ( void )
{
iso9141_cfg_t iso9141_cfg;
log_cfg_t logger_cfg;
/**
* 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( logger_cfg );
log_init( &logger, &logger_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
iso9141_cfg_setup( &iso9141_cfg );
ISO9141_MAP_MIKROBUS( iso9141_cfg, MIKROBUS_1 );
if ( UART_ERROR == iso9141_init( &iso9141, &iso9141_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
#ifdef DEMO_APP_TRANSMITTER
log_printf( &logger, " Application Mode: Transmitter\r\n" );
#else
log_printf( &logger, " Application Mode: Receiver\r\n" );
#endif
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
#ifdef DEMO_APP_TRANSMITTER
iso9141_generic_write( &iso9141, DEMO_TEXT_MESSAGE, strlen( DEMO_TEXT_MESSAGE ) );
log_printf( &logger, "%s", ( char * ) DEMO_TEXT_MESSAGE );
Delay_ms ( 1000 );
#else
uint8_t rx_byte = 0;
if ( 1 == iso9141_generic_read( &iso9141, &rx_byte, 1 ) )
{
log_printf( &logger, "%c", rx_byte );
}
#endif
}
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;
}
// ------------------------------------------------------------------------ END
/*!
* @file main.c
* @brief ISO 9141 Click Example.
*
* # Description
* This example demonstrates the use of an ISO 9141 click board by showing
* the communication between the two click boards.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initalizes device and makes an initial log.
*
* ## Application Task
* Depending on the selected application mode, it reads all the received data or
* sends the desired text message once per second.
*
* @author MikroE Team
*
*/
#include "board.h"
#include "log.h"
#include "iso9141.h"
// Comment out the line below in order to switch the application mode to receiver
#define DEMO_APP_TRANSMITTER
// Text message to send in the transmitter application mode
#define DEMO_TEXT_MESSAGE "MIKROE - ISO 9141 click board\r\n\0"
static iso9141_t iso9141;
static log_t logger;
void application_init ( void )
{
iso9141_cfg_t iso9141_cfg;
log_cfg_t logger_cfg;
/**
* 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( logger_cfg );
log_init( &logger, &logger_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
iso9141_cfg_setup( &iso9141_cfg );
ISO9141_MAP_MIKROBUS( iso9141_cfg, MIKROBUS_1 );
if ( UART_ERROR == iso9141_init( &iso9141, &iso9141_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
#ifdef DEMO_APP_TRANSMITTER
log_printf( &logger, " Application Mode: Transmitter\r\n" );
#else
log_printf( &logger, " Application Mode: Receiver\r\n" );
#endif
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
#ifdef DEMO_APP_TRANSMITTER
iso9141_generic_write( &iso9141, DEMO_TEXT_MESSAGE, strlen( DEMO_TEXT_MESSAGE ) );
log_printf( &logger, "%s", ( char * ) DEMO_TEXT_MESSAGE );
Delay_ms ( 1000 );
#else
uint8_t rx_byte = 0;
if ( 1 == iso9141_generic_read( &iso9141, &rx_byte, 1 ) )
{
log_printf( &logger, "%c", rx_byte );
}
#endif
}
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;
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:CAN