ANALISIS TRADE-OFFS PERFORMA ANTARA HARDWARE DAN SOFTWARE I²C PADA DRIVER MPU6050
Abstract
Perbedaan implementasi I²C hardware (HW) dan software (SW) pada sistem tertanam sering menyebabkan tantangan kompatibilitas dalam pengembangan driver sensor, yang berujung pada duplikasi kode dan peningkatan beban CPU. Penelitian ini mengusulkan solusi berbasis Adapter Design Pattern untuk menyatukan antarmuka HW dan SW I²C, menggunakan sensor MPU6050 sebagai studi kasus. Kedua adapter (HardI2C dan SoftI2C) mengimplementasikan antarmuka I2CInterface yang sama, memungkinkan driver MPU6050 beroperasi secara identik pada kedua jenis I²C. Hasil eksperimen menunjukkan bahwa pada kecepatan clock 300kHz, implementasi HW I²C menghasilkan beban CPU <10%, sementara SW I²C mengonsumsi >28% CPU akibat overhead bit-banging. Temuan ini membuktikan bahwa solusi berbasis adapter tidak hanya meningkatkan kompatibilitas, tetapi juga memungkinkan pengembang memilih implementasi I²C secara dinamis berdasarkan pertimbangan kinerja atau ketersediaan periferal, tanpa modifikasi signifikan pada kode driver.
Downloads
References
Patel, Sagarkumar & Talati, Prachi & Gandhi, Saniya. (2019). Design of I2C Protocol.
“ESP32 Wi-Fi & Bluetooth SOC,” Espressif Systems. https://www.espressif.com/en/products/socs/esp32
N. D. Imtinan, “Two-Wheel Self-Balancing Robot with PID-Fuzzy and Wall-Following,” JITET, vol. 13, no. 3, Jul. 2025, doi: 10.23960/jitet.v13i3.6940.
Halder, R. Dasgupta, J. Chepada, and N. Dash, 2011, Implementation of MCU Invariant I2C Slave Driver Using Bit Banging, https://www.thinkmind.org/articles/icons_2011_1_10_20003.pdf, diakses tgl 3 Agustus 2025.
E. Gamma, R. Helm, R. Johnson, and J. Vlissides, . 1994, Design patterns: elements of reusable Object-Oriented software, https://www.grch.com.ar/docs/unlu.poo/Gamma-DesignPatternsIntro.pdf, diakses tgl 3 Agustus 2025.
C. K. Mummadi, F. P. P. Leo, K. D. Verma, S. Kasireddy, P. M. Scholl, and K. Van Laerhoven, Sep. 2017, Real-time Embedded Recognition of Sign Language Alphabet Fingerspelling in an IMU-Based Glove, ACM Digital Library, No.11, 1–6, https://doi.org/10.1145/3134230.3134236.
G. S. S. Varma, B. Naveen, P. R. Reddy, and N. Priyanka, “Design and Performance Evaluation of I2C and AMBA AXI Protocols for Embedded System Integration,” 2025 8th International Conference on Computing Methodologies and Communication (ICCMC). IEEE, pp. 286–290, Jul. 23, 2025. doi: 10.1109/iccmc65190.2025.11140841.
Zibayiwa, Morelife,. 2021. A Review on The Inter-Processor Communication: I2C, UART, and SPI interfacing techniques.
P. Visconti, G. Giannotta, R. Brama, P. Primiceri, A. Malvasi, and A. Centuori, “FEATURES, OPERATION PRINCIPLE AND LIMITS OF SPI AND I2C COMMUNICATION PROTOCOLS FOR SMART OBJECTS: A NOVEL SPI-BASED HYBRID PROTOCOL ESPECIALLY SUITABLE FOR IoT APPLICATIONS,” International Journal on Smart Sensing and Intelligent Systems, vol. 10, no. 2, pp. 1–34, Jan. 2017, doi: 10.21307/ijssis-2017-211.
TDK InvenSense, “MPU-6000 and MPU-6050 Product Specification,” Rev. 3.4, PS-MPU-6000A-00, 2015. [Online]. Available: https://invensense.tdk.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf
FreeRTOS, “The FreeRTOSTM Reference Manual,” Amazon.com, version 10.0.0 issue 1., 2017. Accessed: Apr. 26, 2026. [Online]. Available: https://www.freertos.org/media/2018/FreeRTOS_Reference_Manual_V10.0.0.pdf
J. L. Hennessy and D. A. Patterson, Computer Architecture: a Quantitative approach. 2019. [Online]. Available: http://www.loc.gov/catdir/toc/els031/2001099789.html
S. McConnell, Code complete, second edition. 2004. [Online]. Available: http://portal.acm.org/citation.cfm?id=1096143
J. Rowberg, “MPU6050 library for ESP32 (ESP-IDF),” i2cdevlib, 2022. Accessed: Apr. 26, 2026. [Online]. Available: https://github.com/jrowberg/i2cdevlib/tree/master/ESP32_ESP-IDF/components/MPU6050.
Berigoo, “GitHub - Berigoo/mpu60x0: driver for mpu6000/6050 using ESP-IDF framework,” GitHub. https://github.com/Berigoo/mpu60x0

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.



