cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO_WriteBit function problem

ugkmen
Associate II
Posted on August 11, 2009 at 18:37

GPIO_WriteBit function problem

3 REPLIES 3
ugkmen
Associate II
Posted on May 17, 2011 at 13:20

Hi all,

I use GPIO_WriteBit in my code like that

GPIO_WriteBit(GPIOD, GPIO_Pin_0, Bit_SET);

GPIO_WriteBit(GPIOD, GPIO_Pin_1, Bit_SET);

GPIO_WriteBit(GPIOD, GPIO_Pin_2, Bit_SET);

GPIO_WriteBit(GPIOD, GPIO_Pin_3, Bit_SET);

And i am debugging the code by ULINK Cortex Debugger. But, surprisingly if i debug with F10 (step over), the GPIO_WriteBit function resets the other pins. For example, when i set the Pin_1 to high ; then Pin_0, Pin_2 and Pin_3 are reset to low.

if i debug with F11 (step) there is no problem.

What may be the problem?

Thanks in advance...

design5
Associate II
Posted on May 17, 2011 at 13:20

Hi:

I suggest you try Bit Banding to access the port bits and see if you have the same issue. In general, Bit Banding is better for single bit operations because they are atomic.

Garry.

ugkmen
Associate II
Posted on May 17, 2011 at 13:20

Hello,

I think, it is a GPIOD Problem.

Thanks...