Peripheral Interfaces and Serial Communication Protocols Questions
Wiring firmware to hardware through digital and serial buses such as GPIO, I2C, SPI, UART, CAN, and USB. Covers protocol framing, addressing, clocking, bus arbitration, and driver-level integration with peripheral registers. Includes debugging bus-level communication failures and choosing the right interface for a device.
You have a microcontroller with a 48 MHz system clock and a UART that uses 16× oversampling. The UART baud formula is: baud = Fclk / (16 × BRR). Calculate the nearest BRR value to achieve a desired baud of 115200, compute the actual baud produced and the error percentage. Show the formula and C expressions you would use to compute BRR and error in firmware.
Define bit-banging for embedded interfaces: what it is, when it's used instead of hardware peripherals, typical limitations (timing, CPU overhead), and give two practical examples where bit-banging is acceptable in a product.
Explain the basics of CAN bus operation in automotive and industrial systems: message-based arbitration, message priority via identifier, error detection and fault confinement, and why CAN is chosen over simpler serial links for certain applications.
You are tasked with migrating mature bare-metal drivers to an RTOS-driven model with minimal rework and risk. Outline a migration strategy: extract hardware access into a small HAL/core module, implement thin RTOS-specific wrappers (ISR-to-thread handoff), preserve timing and latency constraints, add unit and integration tests, perform staged rollouts (non-critical drivers first), and keep a rollback plan. Include coordination strategies for multiple teams and ways to measure success.
Design an OTA firmware update protocol for devices using LoRaWAN where payloads are limited and downlinks are rare. Describe fragmentation/reassembly, integrity and authenticity checks, update resume after power loss, and how to minimize energy use on end devices.
Unlock Full Question Bank
Get access to all Peripheral Interfaces and Serial Communication Protocols interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.