build a DAQ card by STM32F4 discovery

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
iman
Posts: 9
Joined: Mon Sep 15, 2014 9:16 pm

build a DAQ card by STM32F4 discovery

Postby iman » Mon Sep 15, 2014 9:47 pm

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 .

User avatar
Giovanni
Site Admin
Posts: 13008
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 742 times
Been thanked: 620 times
Contact:

Re: build a DAQ card by STM32F4 discovery

Postby Giovanni » Tue Sep 16, 2014 8:17 am

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

iman
Posts: 9
Joined: Mon Sep 15, 2014 9:16 pm

Re: build a DAQ card by STM32F4 discovery

Postby iman » Tue Sep 16, 2014 7:45 pm

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

User avatar
Giovanni
Site Admin
Posts: 13008
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 742 times
Been thanked: 620 times
Contact:

Re: build a DAQ card by STM32F4 discovery

Postby Giovanni » Tue Sep 16, 2014 7:51 pm

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

iman
Posts: 9
Joined: Mon Sep 15, 2014 9:16 pm

Re: build a DAQ card by STM32F4 discovery

Postby iman » Tue Sep 16, 2014 8:31 pm

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?

User avatar
Giovanni
Site Admin
Posts: 13008
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 742 times
Been thanked: 620 times
Contact:

Re: build a DAQ card by STM32F4 discovery

Postby Giovanni » Tue Sep 16, 2014 8:58 pm

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

iman
Posts: 9
Joined: Mon Sep 15, 2014 9:16 pm

Re: build a DAQ card by STM32F4 discovery

Postby iman » Mon Nov 03, 2014 3:42 pm

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

User avatar
Giovanni
Site Admin
Posts: 13008
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 742 times
Been thanked: 620 times
Contact:

Re: build a DAQ card by STM32F4 discovery

Postby Giovanni » Mon Nov 03, 2014 4:22 pm

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

iman
Posts: 9
Joined: Mon Sep 15, 2014 9:16 pm

Re: build a DAQ card by STM32F4 discovery

Postby iman » Tue Nov 04, 2014 9:13 pm

Hi

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

User avatar
Giovanni
Site Admin
Posts: 13008
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 742 times
Been thanked: 620 times
Contact:

Re: build a DAQ card by STM32F4 discovery

Postby Giovanni » Tue Nov 04, 2014 9:54 pm

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


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 2 guests