Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 3 months ago.
Multiple analogIn not working
I have the following program, when both of the analogIn are declared, no light shows up, however, when only one of the two analogIn statements are in the program it works, why is this... is it a bug? - my mbed library is up to date as of 3rd Feb 2016
#include "mbed.h" DigitalOut frontTX(PB_3); AnalogIn LF(PA_6); AnalogIn RF(PA_1); int main() { while(1) { frontTX = 1; } }
I want to be able to have 6 analog inputs, but this is currently prohibitive
Question relating to:
3 Answers
8 years, 3 months ago.
Hi, I am having the same problem, with my 303RE project
if any Analog in 8-13 are initialised, the processor wont come out of reset.
my solution does not use a crystal, so running at 64MHz not 72MHz.
AD6 = PA_6 works on this board, but not AD8-AD13, yet AD14 and AD15 work ok ....
this all worked on the Nucleo 072.. frustrating...
In the fine print on page 313 of 1137 of RM0316 it says some A/Ds are not available on some packages. there is a post for this problem I think, https://developer.mbed.org/teams/Delta/code/mbed-src/rev/d80869345ae6, since it specifically notes the STM32F303
posted by 06 Feb 2016ADC3 is not initialised in PeripheralPins.c this is why PB0 and PB1 dont work. With the new mbed library installed from above, PC_0,1,2,3 now all work, but PB_0,1 still stops the processor coming up.
posted by 06 Feb 2016pls see post on this subject https://developer.mbed.org/forum/bugs-suggestions/topic/25926/
posted by 06 Feb 2016Would it be possible for your to share a basic/template program with this modification, I do not know how to implement these changes myself. I tried importing mbed-src and editing that file, but it wouldn't compile. In the short term, I have ordered a F042K6 board which documentation says has only 1 ADC, I am hoping that this may overcome the problem. Although it is not ideal
posted by 06 Feb 20167 years, 2 months ago.
Hi There,
I'm sorry to resurrect this old thread, but I still have the issue mentioned above.
I was hoping that the issue was fixed in the main mbed repo, but it seams not to be the case, so I went ahead and tried the repo that Philipe S. posted, but that one trows a lot of errors related to the CAN. Even if I know that it shouldn't been done, I deleted all of the references to the CAN files, but then it stars complaining about I2C....
On a side note, why those fixes hadn't been pushed to the main mbed repo?
I don't have any deep knowledge about mbed or the arm ecosystem either, but I'm definitely here to learn, so tell me and I will do my best to follow.
Thanks, Carlo
8 years, 2 months ago.
You can find an explanation and fix of the problem here: https://developer.mbed.org/questions/67997/NUCLEO-F303K8ADC/
This fork of mbed-dev fixes both the adc and the dac problems: https://developer.mbed.org/users/neurofun/code/mbed-dev/
Hello Philippe would you min sharing the exact diff or patch that solved the issue ? We can then push the changes into mbed main repo as suggested by Carlo thanks in advance Laurent
posted by 16 Feb 2017@Laurent Meunier I will look into the code made by @philippe s. and get you a diff
posted by 11 Mar 2017Think this is the diff you are looking for: https://developer.mbed.org/users/neurofun/code/mbed-dev/rev/b3a5af880266
posted by 12 Mar 2017Thank you Philippe - I have proposed a fix to handle multiple instances in parallel that will be reviewed and later integrated in MBED master branch. Here is the proposal: https://github.com/ARMmbed/mbed-os/pull/4623 Any feedback or tests results are welcome. Sorry for the delay.
posted by 23 Jun 2017
oops, posted in the wrong place.
posted by philippe s. 23 Feb 2016