TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 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 (136947 times)
  2. FAT32 Library (70063 times)
  3. Network Ethernet Library (56015 times)
  4. USB Device Library (46332 times)
  5. Network WiFi Library (41951 times)
  6. FT800 Library (41264 times)
  7. GSM click (29050 times)
  8. mikroSDK (26472 times)
  9. PID Library (26444 times)
  10. microSD click (25408 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

OBD II click

Rating:

0

Author: MIKROE

Last Updated: 2018-07-12

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: CAN

Downloaded: 8793 times

Followed by: 1 user

License: MIT license  

OBDII click offers a unique opportunity to tap inside the car diagnostic systems. It features the STN1110 Multiprotocol OBD to UART Interface, developed by the ScanTool technologies.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "OBD II click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "OBD II click" changes.

Do you want to report abuse regarding "OBD II click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

OBD II Click

OBD II Click

Native view of the OBD II Click board.

View full image
OBD II Click

OBD II Click

Front and back view of the OBD II Click.

View full image

The library carries generic functions, necessary for communication with the module. 

Key functions:

obdII_sendCommand- Sends provided command to the module

obdII_readResponse - Reads current response inside buffer

obdII_process- State machine function. This function is being called frequently

Examples Description

The example demonstrates how to read RPM from your vehicle. 
 

  • System Initialization - Initializes UART module and GPIO pins
  • Application Initialization - Powers on the module and sets it to Automatic protocol detection by sending "ATSP0"
  • Application Task - (code snippet) - Sequentially sends command for RPM and converts read response to a valid RPM value
void applicationTask()
{
    uint8_t tmp[ 25 ];

    obdII_sendCommand( &RPM_CMD[0] );
    while( !obdII_responseReady() )
        ;
    obdII_readResponse( &rsp[0] );

    memcpy( &tmp[0], &rsp[11], 4 );
    tmp[5] = 0;
    rpm = xtoi( &tmp[0] );
    rpm = rpm / 4;
    WordToStr(rpm, &tmp[0]);

    mikrobus_logWrite( "Current RPM : ", _LOG_TEXT );
    mikrobus_logWrite( tmp, _LOG_LINE );
}

Note that not all vehicles use the same set of commands - it might happen that routine for reading RPM on your vehicle is not the same as the ones provided in the example.

Other MikroElektronika libraries used in the example:
 

  • Conversions
  • String
  • Stdlib

Additional notes and information

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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.

ALSO FROM THIS AUTHOR

GSM 3 click

5

GSM3 click carries SIM800H, a quad-band (850/900/1800/1900MHz) GSM/GPRS module that transmits voice, sms and data information. Utilizing the module’s full potential, GSM3 click also has an audio input/output connection pad (for a microphone and earphones, which can also be used as an FM antenna).

[Learn More]

EERAM 3 click

0

EERAM 3 Click is a compact add-on board that contains EERAM memory designed to retain data during power loss without the aid of external batteries. This board features the 48L256, a serial EERAM with SRAM memory core, including hidden EEPROM backup from Microchip Technology.

[Learn More]

IoT ExpressLink 3 click

0

IoT ExpressLink 3 Click is a compact add-on board that allows users to connect easily to IoT ExpressLink services and securely interact with cloud applications and other devices. This board features the NORA-W256WS, a standalone multi-radio module from u-blox. The module supports Wi-Fi radio at 802.11b/g/n standard and 2.4GHz of ISM band. It also supports the Bluetooth Low Energy 5. The embedded AWS IoT ExpressLink-compliant software includes secured pre-flashed certificates in the module.

[Learn More]