Search found 36 matches

by hyur
Mon Aug 15, 2022 11:27 pm
Forum: General discussion
Topic: Device initialization when serial port is connected
Replies: 10
Views: 2526

Device initialization when serial port is connected

I am using the stm32f103c8t6 board. I'm developing middleware right now, and I want to connect stm32. Here I found the problem, there are two in total. 1. Open the Arduino IDE serial monitor window and enable serial communication to send and receive messages when connecting middleware. (After upload...
by hyur
Thu Jul 07, 2022 12:13 am
Forum: General discussion
Topic: Problem using MPU-6050 on STM32F103C8T6
Replies: 0
Views: 1530

Problem using MPU-6050 on STM32F103C8T6

hello I am using a gyro sensor on my STM32. SDA and SLC lines are pulled up (4.7k) and connected to I2C2 and used. However, when accessing the address to wake up the MPU-6050 and sending endTransmission, intermittently returns 254. When 254 is returned, 0 is returned only after unplugging and reconn...
by hyur
Mon Jul 04, 2022 2:13 am
Forum: General discussion
Topic: How can I change the ADC Resolution?
Replies: 7
Views: 2847

Re: How can I change the ADC Resolution?

@hyur Oh... and I forgot the resolution issue. If you need analog output (PWM or DAC) you don't need to worry about resolution. It's easy to calculate. From 8b (0-255) to 10/12b (0-1023/4095): just multiply 8b value by 2 (to 10b) or 4 (12b), or shit value by 2 / 4 bits left ( value<<2, value <<4 ) ...
by hyur
Tue Jun 28, 2022 11:19 pm
Forum: General discussion
Topic: How can I change the ADC Resolution?
Replies: 7
Views: 2847

Re: How can I change the ADC Resolution?

1. ADC is Analog to Digital Converter. It reads analog data and converts it to digital - analogRead(); DAC is Digital to Analog, but F103C8 does not have DAC. Using analogWrite() on MCUs without DAC you setup PWM output. 2. If analogWriteResolution() does not work (compile), it means that you use R...
by hyur
Tue Jun 28, 2022 1:04 am
Forum: General discussion
Topic: How can I change the ADC Resolution?
Replies: 7
Views: 2847

Re: How can I change the ADC Resolution?

for lower resolution: 1. right shift; 2. pick the right alignment; 3. on some chips, you can set the resolution. not on this one. for higher resolution: 1. oversampling; 2. use an external adc. I'm sorry I didn't understand you well. According to for lower resolution: 3., does that mean that the re...
by hyur
Tue Jun 28, 2022 12:09 am
Forum: General discussion
Topic: How can I change the ADC Resolution?
Replies: 7
Views: 2847

How can I change the ADC Resolution?

I am using an STM32duino(STM32F103C8T6) now. I am trying to use analogWrite, but only 8 bits (0~255) can be used. I know that this resolution is changeable, but how can I change it? I want to use the analogwriteresolution() function, but I get the following error: 'analogWriteResolution' was not dec...
by hyur
Mon Jun 06, 2022 11:49 pm
Forum: General discussion
Topic: STM32F103C8T6 Reference Voltage READ
Replies: 15
Views: 5223

Re: STM32F103C8T6 Reference Voltage READ

As a result of measuring in millimeters, I was able to read a value similar to the internal reference voltage.

Thanks to you, I was able to solve my difficulties.

Thank you very much.
by hyur
Fri Jun 03, 2022 8:23 am
Forum: General discussion
Topic: STM32F103C8T6 Reference Voltage READ
Replies: 15
Views: 5223

Re: STM32F103C8T6 Reference Voltage READ

Following your advice, I was able to read the datasheet and read the ADC1_IN17(Vrefint) value. With Vrefint and the following formula, I was able to get a value of 3.27~3.28V. float VRef = (1.20 / vrefint) * 4096.0; I measured the voltage on the board and it came out 3.314V. Is this an acceptable er...
by hyur
Fri Jun 03, 2022 7:10 am
Forum: General discussion
Topic: STM32F103C8T6 Reference Voltage READ
Replies: 15
Views: 5223

Re: STM32F103C8T6 Reference Voltage READ

google search for RM0008 stm32f103 you should get this https://www.st.com/resource/en/reference_manual/cd00171190-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf look in the chapter for ADC, look under temperature sensor section ...
by hyur
Thu Jun 02, 2022 12:24 am
Forum: General discussion
Topic: STM32F103C8T6 Reference Voltage READ
Replies: 15
Views: 5223

Re: STM32F103C8T6 Reference Voltage READ

GonzoG wrote: Tue May 31, 2022 1:44 pm Than it means that you're using Roger's core. It works only on official STM32 core.
On Roger's core you'll probably need to setup ADC using registers.
Where can I get datasheets for ADC registers?

Go to advanced search