# BP_Haniska_OBD

Program developed for development board NUCLEO, fitted by chip STM32F-103RB, as part of bachelor thesis, written by Jan Haniška. Function of program is ability to load data from ECU (or ECU emulator) by CAN bus and GPS position data from GPS module by UART interface.

## Developing tools and process

Used programing language is C. Used developing environment was STM32CubeIDE. Reason why was chosen this developing environment is, because of feature of MXCube configuration interface, which generates basic code to configure NUCLEO devboard.

## Usage

For use of program is needed only upload them to NUCLEO F-103RB by microUSB interface. If all interfaces (CAN and UART to GPS module) are connected correctly, we can run some terminal application, for example Tera Term, and connect to port used by STMLink and set baudrate to 115200 baud/sec. After connection we can see output of program.
### Output example:
```text
----CAN-COMMUNICATION-START----
Used fuel: LPG
Vehicles VIN: NFAYP4FJ2BM1H397K
Distance traveled since last code deleting: 20480 km
Vehicles speed: 80 km/h
Coolant temperature: 30 C
Engine run time: 120 s
Throttle position: 0 %
Intake air temperature: 56 C
Mass air flow rate: 2 g/s
Intake manifold absolute pressure: 34 kPa
Fuel tank level: 13 %
Engine speed: 5000 rpm
-----CAN-COMMUNICATION-END-----

-----GPS-COMMUNICATION-START-----
GPS module connected, waiting for acquisition
-----GPS-COMMUNICATION-END-----
```

First part of program output shows loaded data from ECU. Second part of program output shows state of GPS module, when acquisition will be finished in this place will be printed loaded position and course.