Page 1 of 2

build a DAQ card by STM32F4 discovery

Posted: Mon Sep 15, 2014 9:47 pm
by iman
Hello

I wanto to know that may I read ADC with 6-7MS by chibiOS? I want to build a DAQ card by STM32F4 discovery board, is there any example that show me how I must implement it by using chibiOS? in my project first of all I want to read ADC as fast as possible and store it in external memory then transmit stored data by Xbee module .

Re: build a DAQ card by STM32F4 discovery

Posted: Tue Sep 16, 2014 8:17 am
by Giovanni
Hi,

The F4 ADC is not that fast.

You have to use the F3 with its ADC set in dual mode, that would give you 10MS.

Giovanni

Re: build a DAQ card by STM32F4 discovery

Posted: Tue Sep 16, 2014 7:45 pm
by iman
Hello Giovanni

I see an example from ST by keil that show it can read ADC about 6.2MS, here is that:
https://www.dropbox.com/sh/e5qi2z4qht85 ... -S1Ka?dl=0

but I want to read ADC as fast as possible and 10MS is very good for my application so do you have any example for STM103 by chibiOS? or any tutorial?

Thanks a lot...............Iman

Re: build a DAQ card by STM32F4 discovery

Posted: Tue Sep 16, 2014 7:51 pm
by Giovanni
Hi,

It is STM32F303, not F103. there is an example of dual ADC under ./testhal.

The F4 would be able to do 6.2MS in triple ADC mode however this mode is not supported by the current ChibiOS driver, you would have to use the ST code.

Giovanni

Re: build a DAQ card by STM32F4 discovery

Posted: Tue Sep 16, 2014 8:31 pm
by iman
I'm very new to chibiOS, I want to read ADC and send converted value to PC by UART. In testhal example, converted ADC value store in which variable?
how can I buffer data to prevent getting memory full?

Re: build a DAQ card by STM32F4 discovery

Posted: Tue Sep 16, 2014 8:58 pm
by Giovanni
The ADC driver is able of "continuous circular buffer" operations. An array is filled continuously in a circular mode, when the array is filled the conversion restarts from the beginning, callbacks are called at "half buffer" and "full buffer" in order to allow processing of data while the conversion is ongoing.

In the demo there is an example of this circular mode.

Giovanni

Re: build a DAQ card by STM32F4 discovery

Posted: Mon Nov 03, 2014 3:42 pm
by iman
Hello Giovanni

I have upgrade chibiOS source today, but STM32F3 discovery board stop working after uploading an example code on it, when press restart button! While it's working by previous version well.


Thanks a lot................Iman

Re: build a DAQ card by STM32F4 discovery

Posted: Mon Nov 03, 2014 4:22 pm
by Giovanni
Hi,

The ADC code has changed, now it is required to specify ADC_CFGR_CONT in the CFGR field of the configuration structure manually. See the demo under testhal/STM32F3xx/ADC.

The change was required in order to make the driver functional with discontinuous mode.

Giovanni

Re: build a DAQ card by STM32F4 discovery

Posted: Tue Nov 04, 2014 9:13 pm
by iman
Hi

I mean that, even demo code doesn't work on the board :!:

Re: build a DAQ card by STM32F4 discovery

Posted: Tue Nov 04, 2014 9:54 pm
by Giovanni
There is something strange, the LED stops flashing after few seconds. I will look into this ASAP.

Only 3.0, 2.6.x works fine.

Giovanni