cancel
Showing results for 
Search instead for 
Did you mean: 

Trialstand: External Accelerometer with STM32F411CEU

timbo2023
Associate III

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

#

 

11 REPLIES 11

@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" ?

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

 


@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 ...

PS:

TRIALSTAND - It is the mechanical basis of a small manufacturing machine with its table sizes 300 × 400 mm.

timbo2023
Associate III

OPINION CHECK WISHED...

LA1010 USB Logic Analyzer?!?

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:

AndrewNeil_3-1742814541358.png

See: https://electronics.stackexchange.com/a/473799 

timbo2023
Associate III

I do not understand...

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.

timbo2023
Associate III

 

The problem lies code-snippet side....