ADC/IN1 issue from CubeMX configuration

Hi!!!
I really need your help as much as possible possible on this issue. Your suggestion can help me to move forward in my training.

My target is to diplay (i2C protocol) on the LCD the variation from 0 to 5v from a rotary sensor the analog value of the pin A1 from the STM32F407VG by using an ADC chanel 1 (IN1) from cubeMX that generates me a code on KEIL IDE.

My i2c library works well, I can display string characters but when it comes to displaying analog value, I get the following image everytime:

From CubeMX configuration I get the following conflicts from TIM5 : Inkedp1_LI|690x335

I also get the following message from the ETH:

Here is my code (I called functions from i2c libraries):

In your opinion where the problem can come from?

Thanks in advance.

Best regards

1 Like

It’s not a good practice to call the Init function inside a loop. Call the lcd_init function above the while loop and see whats happens.

Thanks for your respond on my issue. I have done it and now there is nothing displayed on the LCD screen.

Is this lcd library written by you? Can you post the definition of lcd_post_data function? You are passing integer data to the function, which is very odd.

No, it is not. As a matter of fact, I found it from a tutorial and the hardware matches with what I have that’s why I took it.
Reference : LCD 16x02 / encoder = PCF8574T

here is the definition of the lcd_send data:

Please find below All the fonction containing in the .h file

Just in case, find the rest of the definition of the library bellow:





Copy paste the below statement inside the while loop and see if it’s display the string test. Keep the lcd init function above the while loop.

lcd_send_string("test");

Hi! I got nothing on the screen but when I make lcd_init function inside the while loop.

Hi, can you check your i2c address? If you can try different address.

2 Likes

As @mhdundar mentioned wrong address may also be a cause of the issue. Refer the lcd datasheet for i2c address.

1 Like

Yes, I did. The adress is good.

Dear administrator, Yes I did it.

I have changed i2c libraries for the same purpose of my experience and everything is alright now. @mhdundar and @Administrator you both be right that something could get wrong somewhere as far as the previous library is concerned.

2 Likes