cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable 3v output and configure timers from ext. trigger?

ttadas0
Associate
Posted on January 23, 2016 at 13:20

Hi,

so me and a few friends are trying to make a capaticance meter from 100pF to 1mF with an error of 0.1%.    We've decided to measure the time it takes the unknown capacitor to reach a given voltage, then through a couple equations we can solve for capacitance. 

We already have an external circuit for measurment  and we have a working lcd hooked up.

The problem is that we don't know how to exactly measure and read the time and how to start pushing the voltage for charging the cap though a pin. 

For starting the voltage maby we should configure a pin as output through GPIO?

 GPIO_InitTypeDef gpioStructure;

    gpioStructure.GPIO_Pin = GPIO_Pin_12;

    gpioStructure.GPIO_Mode = GPIO_Mode_OUT;

    GPIO_Init(GPIOD, &gpioStructure);

Tho, GPIO needs a definition of speed aswell so i'm having my doubts about this method.

for the timer we are trying to use external trigger from a comparator. When the voltage exceeds the value that we are using as a baseline ( for example we're feeding the capacitor with 3.3V and waiting for it to reach 1.6V) , the comp would reach a high level and that would act as our trigger to stop the measurment. and this is one of the main things that are troubling us.  How to configure a timer to do that and afterwards from where should we pull the timer's value that was counted up until that time?

The board we are using is STM32F302R8

any ideas are greatly appreciated.

0 REPLIES 0