Trialstand: External Accelerometer with STM32F411CEU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-23 5:42 PM - edited 2025-03-23 5:46 PM
F. U. I.:
I would like to read sensor data from my accelerometer (MPU 6050) with the I²C-protocol.
My aim is to present the sensor data on my laptop via /dev/ttyUSB0, but no data reached my USB TO TTL-Adapter.
Attached you will find the code snippet and a photo.
(1)
I get no sensor data via I²C to my STM32F411.
What is wrong there?
The init-functions seems to be right, but the I2C_byteRead() gives no data back.
(2)
I would like to send my sensor data to PA2 (USART2, TX).
How can I realize this per code?
Thank's a lot.
Greetings
TIMBO
#
- Labels:
-
I2C
-
STM32F4 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 2:51 AM - edited 2025-03-24 2:56 AM
@timbo2023 wrote:(1) I get no sensor data via I²C to my STM32F411.
What is wrong there?
What debugging have you done to find what's wrong?
Have you looked at the I2C lines with an oscilloscope and/or logic analyser to see what's happening?
How to write your question to maximize your chances to find a solution
PS:
what is "Trialstand" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 3:16 AM
Hi there,
(1) OpenOCD
(2) No possibility - I only check if the data is empty with the glim of my onboard LED (PC13).
Could you check the I2C Code?
Do I forgot the right memory addresses?
How I reach the data @ (PA2) USB to TTL?
Greetings
TIMBO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 3:21 AM
@timbo2023 wrote:(1) OpenOCD
That's just a tool - what have you actually done with it?
This is not a pure software problem - the hardware is an essential part of the system!
That's why you need to be able to see what's happening in the hardware.
And you also need to show your schematic.
Cheap logic analysers are available on the likes ebay, amazon, et al ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 3:22 AM
PS:
TRIALSTAND - It is the mechanical basis of a small manufacturing machine with its table sizes 300 × 400 mm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 3:26 AM
OPINION CHECK WISHED...
LA1010 USB Logic Analyzer?!?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 4:09 AM
You'll also want something that can show you what's happening in the analogue domain.
In particular, that will show if your pullups are correct:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 4:27 AM
I do not understand...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 5:49 AM
A logic analyser will only show you 0/1 logic levels - so it assumes that your signal is clean & correct in the analogue domain.
If you've got "analogue" problems (such as missing/incorrect pullups on I2C), a logic analyser isn't going to help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-24 9:02 AM
The problem lies code-snippet side....
