cancel
Showing results for 
Search instead for 
Did you mean: 

One Pulse Mode with STM32F429DiscoveryBoard

patrick_seeboerger
Associate II
Posted on March 13, 2014 at 11:45

Hallo together,

I want to use Timer 1 to capture a logic high input at Pin A9 and to create an output signal at Pin A10.

I have written the following code which is derived from an STM32F10x example.

I do not get any output signal at PA10.

Would be nice if someone could tell me what is wrong with my code!

Thanks in advance.

Code can be seen attached in Tim_13_3.txt

Additional questions:

In the end I want to produce 2 pulses where the duration of the first one is dependent on a changing value and the second pulse is fixed. The delay between the first and second pulse is also fixed. 

Do you know any possibility except the delay function how this double pulse could be built up with high precision (+/- 0.5 microseconds)?

Thank you,

Best regards, 

Patrick

#f4-!=-f1
4 REPLIES 4
Posted on March 13, 2014 at 14:30

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;

Pick ONE, preferably the one that doesn't turn off the schmitt trigger for the digital input path.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
patrick_seeboerger
Associate II
Posted on March 13, 2014 at 17:20

Hi,

I have changed it to:

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;

GPIO_Init(GPIOA, &GPIO_InitStructure);

but it still does not work!

Posted on March 13, 2014 at 17:32

GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* Connect TIM1 pins to AF */
GPIO_PinAFConfig(GPIOA, GPIO_PinSource9, GPIO_AF_TIM1); // TIM1_CH2
GPIO_PinAFConfig(GPIOA, GPIO_PinSource10, GPIO_AF_TIM1); // TIM1_CH3

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
patrick_seeboerger
Associate II
Posted on March 14, 2014 at 13:47

Hi,

I also had to change

TIM_OC1Init(TIM1, &TIM_OCInitStructure);

to

TIM_OC3Init(TIM1, &TIM_OCInitStructure);

and now it works.

I have added the finished file and try to go on with the next pulse!

Thank you Clive!!!

________________

Attachments :

One_Pulse_14_03_14.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzrb&d=%2Fa%2F0X0000000bRL%2F9MbbSaeSQQGDFTAx8X9r8X1P730BKnzZrTqp9JfSikY&asPdf=false