2022-02-11 05:31 AM
I the UM211 User Manual of STM32H747I-DISCO board the CN9.1 (A0) is declared to ADC3_IN5 (Channel 5 of ADC3). I tried to configure ADC3_IN5 with STM32CubeMX but it configures ADC3_IN5 to PF3 (not PF7) pin. PF3 pin is not accessible in CN9 connector.
I addition, if I look at the schematics CN9.1 (A0) pin is dedicated to ADC12_IN4, which is PA4 pin.
Note: I guess ADC12 means either ADC1 or ADC2. There is no ADC12 in the chip.
Three documents, three different pinout, and even none of them works.
Anyway, I created a test project based on Using Timers to Trigger ADC conversions periodically article. I used TIMER_1 and ADC3_IN3. The ADC converts, the code is jumping around 0x0400 (noise). If I connect the 0 to +2.5V 100Hz sine to CN9.1 (0) pin then nothing changes. I just get back (probably) the same noise.
Value of the VREF is also not clear. One thing sure. the CPU does not have internal VREF. From the schematic it is probably +3.3 V. But who knows that? It is not in the user manual of the discovery board (Except schematic).
I need a demo which simultaneously starts two 16-bit A/D converters. This part is solved. I just need to know:
I also need to know whether I can use any of the voltage comparators with the STM32H747I-DISCO board? I could find any pin in the discovery board which would be available for COMP1 or COMP2 on any connector of the board. Probably not, which is pity.
Many thanks for any help.
Louis
2022-02-11 06:25 AM
STM32H7 MCUs have a voltage reference module, but on your board, Vref+ pin is connected to VDDA with R158 and VDDA is 3.3V.
You can assign the feature you want by clicking the pin in CubeMX. Since some features can be assigned to more than one pin, you need to set the feature you want on the pin you want, instead of the ADC settings, from the pinout view.
Which ADC pin you use is up to you. my advice is to apply your signal to the adc input with an RC filter tuned to the bandwidth of the signal and set the adc sampling frequency to ten times your bandwidth. I also recommend you to review AN2834.
https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
2022-02-11 07:23 AM
I'd generally go with the Schematic, making sure it's the one for the Revision of Board being used. I would also double check solder bridge or zero ohm resistor placement, as pins tend to be at a premium on high functionality EVAL and DISCO boards, and there is often a choice of priorities to be made.
Testing them as toggling/sequencing IO's would be another way to confirm chip-to-pin connectivity.
ADC12_CH4 would be connected to CH4 on both ADC1 and ADC2
That none of them work would seem a bit difficult to believe.
Perhaps write some code that isn't dependent on CubeMX filling in the dots, there are frequently a number of examples in the CubeH7 trees for the specific boards, check the README files for specific requirements, or board level expectations.
2022-02-11 07:59 AM
Thanks guys for the suggestions. I thought that I believe better to the schematics than anything else. (DeLorean: yes the revision number is very important)
If you follow the schematic then the connector CN9 pin1 (label "A0") is connected to PA4 pin of the CPU. I checked it in CubeMX. I typed in 'PA4' and checked which ADC can be assigned to PA4. I had two choices:
I picked ADC1_INP18 (P stands for Positive input) so I removed ADC3, and enabled ADC1 and channel 18. I kept TIMER_1 as trigger. And voila a got my input sine wave.
Therefore the User's manual of STM32HH747I-DISCO is faulty. On page 21, in CN9 analog, the pin1 (A0) should show PA4 port and ADC1_INP18 instead of the faulty PF7 and ADC3_15.
I am adding my second channel to CN9 pin 2. I wonder whther the PF10 ADC12_IN0 is correct?
Thanks for input.
2022-02-13 08:47 AM
This is the original but faulty pinout:
This is the right one:
And here is a picture made with my phone. It shows how the input signals look like on the LCD screen of the discovery board. The ADC1 and ADC3 are connected to an AFG which generates two sine wave signal with 1000Hz, 60mvRMS, 100 us phase difference between the signals:
As you can see my table works right...
The little scope runs on STMicro's BSP example app. Why the BSP example? Easy answer: it can handle the display. I asked many times (I also started a tech support ticket) how to add BSP based LCD support to an STM32CubeIDE project? Nobody could answer this very complicated question. Therefore I changed my mind: if you could not add BSP LCD support to your project then why don't you add your project to the cleaned up BSP example. ( cleaned up = every feature removed except initialization)
Please correct these bugs in STM32H7747I-DISCO documentation (Users' Manual)
Louis