I’m using a STM32F407 in 144 pin package. The system will be a 23 analog input board.
when I create a AnalogInput object I must specify the analog channel (pin), so, if I specify analog channel 0, the pin PA0 become an analog input converted by ADC1? or ADC2? or ADC3?
The problem comes when I want to use (for example) the channel 15. I suppose that the analog input is PC5 that can be caputer from ADC1 or ADC2, but also PF5 is the channel 15 of the ADC3.
How can I map a pin on his relative ADC? So i can use more than 16 ADC channels?
The channel system works how the firmware is set up. Oberon’s STM32F4 port requires you to set up the channels in the platform_selector.h file so the AnalogIn drivers can convert the pins to channels.
This is how the Channels are set up in the Cerb-Family:
where A6 is AnalogIn.channel 0 and B1 is AnalogIn.channel 10. As you can see from this layout, the STM channels do not match the NETMF channels. You can have the STM channels in any order you wish as compared to NETMF. You will however need to compile your own custom code if you wish to utilize channels not found in our port or in any of Oberon’s ports as mentioned by Brett.
This is one of the things that could be greatly improved in the STM32 firmware. The hardware is capable of mapping these ADC inputs to multiple pins, and chaining them together for higher precision, etc. There is a LOT of functionality there that isn’t being exposed!