TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 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 (136643 times)
  2. FAT32 Library (69857 times)
  3. Network Ethernet Library (55899 times)
  4. USB Device Library (46236 times)
  5. Network WiFi Library (41869 times)
  6. FT800 Library (41097 times)
  7. GSM click (28951 times)
  8. PID Library (26403 times)
  9. mikroSDK (26321 times)
  10. microSD click (25333 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: 8747 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

RS485 6 click

0

RS485 6 Click offers a half-duplex RS-485 communication with integrated surge protection

[Learn More]

Rotary R click

5

Rotary R click carries a 15-pulse incremental rotary encoder with detents, surrounded by a ring of 16 LEDs. It’s a perfect solution for adding a precision input knob to your design. The encoder outputs A and B signals (out of phase to each other); the knob also acts as a push-button which sends an interrupt to the target board MCU.

[Learn More]

IrDA2 click

0

IrDA2 click features the TFDU4101 infrared transceiver module as well as MCP2120 infrared encoder/decoder from Microchip connected with the 7.3728 MHz external crystal. The click is designed to run on either 3.3V or 5V power supply. It communicates with the target board via UART interface and the following mikroBUSâ„¢ pins: AN, RST, CS.

[Learn More]