DevHeads IoT Integration Server

DII

DevHeads IoT Integration Server

The DevHeads IoT Integration Server accelerates technology engineering by helping pro devs learn, share and collaborate.

Join

seeking-collabs

firmware-and-baremetal

middleware-and-os

edge-networking

pcb-and-analog

jobs

iot-cloud

code-review

devheads-feed

general-dev-chat

Issues with I2C Communication to VL53L0X Sensor Using STM32F103C8 Without ST Library

I am using the VL53L0X sensor with an STM32F103C8 microcontroller and want to communicate with the sensor directly over I2C without using ST's library. My goal is to minimize project size and better understand the low-level protocol. I’ve initialized the I2C interface using CMSIS and am sending commands like setting the control register and reading measurement data, but I’m getting inconsistent responses. See how I initialized the i2c: ...

Issue with Command Handling in AVR128DA48 UART Communication

I am using AVR128DA48 microcontroller to control an LED in serial communication. The way I set it up is not complex; I’m sending ‘ON’ and ‘OFF’ commands from a python script over UART to toggle the LED on the microcontroller. Funny how I am encountering an issue where the first command is ignored, but the second one triggers a response. Here’s what happens: - I send ‘ON’ – the microcontroller does not respond....
attachment 0

Optimizing Speed and Acceleration for Nema34 Motor Control with DM680E Driver

Hi 👋🏻 My friend and I wrote this code to control a Nema34 motor with a DM680E driver for a drilling cycle. We want to dynamically adjust the speed between fast movement (for chip removal and advancing) and slow movement (for drilling into the material), while maintaining smooth acceleration transitions between these speeds. We’ve mentioned needing two speed parameters—fast and slow—but we’re unsure about the exact values that would be optimal for this application. If anyone has advice on how to calculate or determine the best speed and acceleration values for this setup, it would be greatly appreciated. ...

Understanding UART Overrun Error When Sending AT Commands from STM32 to ESP8266

I’m interfacing an ESP8266 with an NUCLEO-L073RZ using UART1 PA9, PA10 for communication with the ESP and UART2 for communication with a PC for debugging. I also used a CP2102 USB to TTL converter to tap the Tx signal from UART1 and monitor AT commands sent from the STM32 The STM32 sends the first AT command correctly, but when I send the second command AT+RST, only part of it is received by the ESP8266. After debugging, I found that HAL_UART_Transmit returns HAL_ERROR, and the cause seems to be an overrun error. See how I set things up: ...
attachment 0

No Pulse Detected Error in ESP32 Heart Rate Monitor with MAX30102

I am designing a heart rate monitor system using an ESP32 microcontroller, tested on a breadboard setup, to simulate the functioning of a pacemaker. The system continuously monitors heart rate using a pulse sensor (MAX30102 module) and triggers an alert if the heart rate falls below or rises above specific thresholds (e.g., < 50 bpm or > 120 bpm). However, I keep getting the error: "No pulse detected. Check sensor placement." What could be causing this issue? Here’s my code: ```cpp #include <Wire.h>...

Optimizing 8-bit Parallel RGB Interface on Nucleo-F411RE: Timer Interrupts or DMA?

I'm working on a project to control a display using an 8-bit parallel RGB interface with the Nucleo-F411RE, requiring a 1 MHz PCLK. Since the STM32F411RE lacks LTDC peripherals, I implemented the interface using a 1 MHz timer interrupt and GPIO for data transmission. However, the system fails at 1 MHz, and the UART stops working entirely—no data is transmitted or received. At lower frequencies, such as 10 KHz, the UART and other peripherals function normally. I'm using TIMX with a system clock of 100 MHz, and GPIO handling is done via [direct register manipulation/HAL functions]. Is it possible to implement this interface on the STM32F411RE without LTDC peripherals? If so, how can I optimize it, potentially using DMA? Or should I switch to a model with LTDC support?...

Decoding a 4x16 Switch Matrix on Arduino for Conditional Logic

I'm looking to decode an existing switch matrix (4 Rows and 16 Columns, basically copy the states of the Rows and Columns).
The goal is to ultimately have a [data] where I will have:
ROW 1 == LOW && COL 1 == LOW, which will result in DATA == LOW.
In my case, only INPUTs are needed, the Arduino should not generate the matrix but only read it (so no OUTPUTs).
After obtaining this variable [DATA], I need to add a condition Supp [DATA] && x == 1 to store it in another variable in order to pass it into a SWITCH CASE. ...
Solution:
Use a nested loop instead of the switch.

Has anyone worked with the kalman filter from the DSP library for ESPs?

Has anyone worked with the kalman filter from the DSP library for ESPs?

STM32WB15CC Custom BLE Project Not Discoverable - Missing Configuration?

I am new to STM32WB15CC and am using the STM32WB15CC NUCLEO board. I successfully ran the BLE example p2pserver on my board, where the device is discoverable, and I can control the LED via the STM BLE application. However, when I created my own project and enabled STM32WPAN BLE, the device is not discoverable. In my custom project, I used the STM32CubeMX tool, which generated various BLE-related files, including app_ble.c. In that file, the following code for discovery was generated: ```c...

Why Does Disabling OCIE1A Cause Immediate ISR Re-trigger on Mega 2560?

Hii guys 😌😌 I’m creating lighting variations on PORTA with a MEGA 2560 board.
I am using a zero-cross detection that triggers an interrupt, which calls the "void passage_a_0" function.
A command (continuous action on a button) modifies a lighting level setting from 1 to 25. This setting adjusts the phase delays corresponding to the lighting level.
I have an issue with the ISR interrupt. Below is the simplified code of the two related interrupts: ...

VR ATmega328P with R305 Fingerprint Sensor: System Hangs on finger.begin() - No Response from Sensor

hey guys, I am working with an AVR ATmega328P microcontroller and an R305 fingerprint sensor. I have connected the sensor’s TX and RX pins to the AVR’s UART pins (D0 and D1) and am utilizing SoftwareSerial for communication. However, after calling finger.begin(), I am not receiving any confirmation from the sensor, and the system seems to hang at that point. Despite verifying the wiring connections to be correct, and replacing the fingerprint sensor, the system continues to hang at finger.begin(57600). I would appreciate any guidance on what might be causing this issue. this is my code: ``` SoftwareSerial mySerial(2, 3); // RX, TX...
Solution:
You are using SoftwareSerial on pins 2 and 3, but you're trying to communicate with the sensor using hardware UART pins (D0, D1). Either update mySerial to use pins 0 and 1 for hardware UART, or stick with SoftwareSerial and connect the fingerprint sensor to pins 2 and 3.

Error: 'PWM' Object Has No Attribute 'duty' in Motor Control Code Using MicroPython

Am working on a smart car automation system using MicroPython, the system include various functionalities such as obstacle detection, line following, speed control, and environmental monitoring. Am currently trying to implement basic motor control using PWM signals and adjust motor speed using a potentiometer or set values, am working with the motor driver module L298N But am getting the error prompt PWM object has no attribute 'duty' here's my code ```python...

Establishing Communication Between ESP32 and R307 Fingerprint Sensor: Initialization Issues

How do I set up and establish communication between the ESP32 and the R307 fingerprint sensor, ensuring that the sensor can be recognized and initialized by the ESP32? My aim is to connect the ESP32 to the R307 fingerprint sensor and establish communication using serial interfaces. I am encountering the error Fingerprint sensor not found ```cpp #include <Adafruit_Fingerprint.h> #include <HardwareSerial.h>...

Trouble Generating PWM Signal on STM32 NUCLEO-F207ZG Using Low-Level Register Programming

I'm programming an STM32 NUCLEO-F207ZG board and trying to output a PWM signal on pin PE_9 (D6) to drive an LED. I'm using low-level register programming (no HAL/LL drivers). However, the LED is not responding, and I don't see a PWM signal on the pin. Here's the code I'm using: ```c...

Compilation Errors on AMD RYZEN 5 Using GCC and NASM for Assembly Code

Why does this code in the app.asm file fail to compile on an AMD RYZEN 5 processor , using windows 10 64bit operating system, with GCC and NASM as my assemblers, but it works perfectly on an online compiler https://www.onlinegdb.com/online_gcc_assembler which the code complied successful and gave the expected output of 17 ? ...
Solution:
Yes sure , I found out that the default output format for NASM is a 16 bit flat binary. And I can't use NASM to assemble it. So I would have to rewrite most of the instructions anyway to port it to Windows. Probably starting again from C compiler output for Windows instead of for GNU/Linux Thanks...
attachment 0

Improving Stability of Pitch and Roll Measurements in MPU6050 Flight Controller

Hello guys, I'm working on a flight controller using an mpu6050 and I'm wondering if the pitch and roll fluctuate too much. These values represent the output of a complementary filter where I used a 0.98 weight for the gyro estimate and 0.02 weight for acc measurement. I didn't calibrate the acc yet so I know there will be an offset, but what bothers me is the fluctuation. After a little research I stumbled upon some ideas of filtering the accelerations using moving average filter. Isn't this a bit overkill? Or is it necessary? Then I was simply thinking to implement a Kalman F instead. I'm not sure if I should follow the Kalman or stick with the current implementation. What do you think? Thanks in advance....
attachment 0

Issues with Viewing PRINTF Output on STM32 Nucleo L476RG with X-Nucleo IDB05A1

I'm working with the STM32 Nucleo L476RG board and the X-Nucleo IDB05A1 expansion board to develop Bluetooth Low Energy applications. My development environment is Keil uVision5, and I’ve successfully built and flashed the SensorDemo example from the STM32CubeExpansion package. The code runs fine, and I can debug it, but I’m having trouble viewing the output from the PRINTF statements in the example. The board is connected to my computer through UART using the virtual COM port on the onboard ST-LINK. I'm configuring the project using STM32CubeMX with HAL libraries. I’ve tried redirecting the printf output via UART and even enabled semihosting to capture the output in the debug console, but neither method has worked for me. Does anyone have suggestions for an easier way to view the PRINTF output, or could you recommend a better approach or development environment for working with STM32 Bluetooth LE boards? Any advice would be greatly appreciated....

Understanding cmp Instruction in Assembly and Debugging with GDB

I’ve come across a specific instruction sequence that I need help understanding, particularly the comparison (cmp) operation and how to break at this point in GDB on an Intel Core i7-11700K Rocket Lake processor . It's low level assembly debugging in C and assembly mix
0x0000000000001410 <+241>: mov eax,DWORD PTR [rbp-0x74]
0x0000000000001413 <+244>: cmp DWORD PTR [rbp-0x70],eax
0x0000000000001416 <+247>: jne 0x149d <main+382>
0x000000000000141c <+253>: lea rsi,[rip+0xbf7] # 0x201a
0x0000000000001410 <+241>: mov eax,DWORD PTR [rbp-0x74]
0x0000000000001413 <+244>: cmp DWORD PTR [rbp-0x70],eax
0x0000000000001416 <+247>: jne 0x149d <main+382>
0x000000000000141c <+253>: lea rsi,[rip+0xbf7] # 0x201a
...

Issue with ISR Behavior in Zero-Cross Detection on Mega 2560 Board

Hii guys I’m creating lighting variations on PORTA with a MEGA 2560 board.
I am using a zero-cross detection that triggers an interrupt, which calls the "void passage_a_0" function.
A command (continuous action on a button) modifies a lighting level setting from 1 to 25. This setting adjusts the phase delays corresponding to the lighting level.
I have an issue with the ISR interrupt. Below is the simplified code of the two related interrupts: ...

Troubleshooting Relay Activation for Water Pump Control Based on PIR Sensor Detection on ESP32

Still based on my project on home automation system that controls water pumps and taps based on motion detection using the Zephyr RTOS on an ESP32. How can i properly control a water pump based on motion detection from the PIR sensor? Am hving an issue where my relay is not activating, i have tried checking the relay wiring, tested the relay with a simple on/off code and verified power supply to the relay module. But still have same issues here's my code ```c...
Next