GPIO_WriteBit function problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2009-08-11 9:37 AM
Posted on August 11, 2009 at 18:37
GPIO_WriteBit function problem
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:20 AM
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...Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:20 AM
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 4:20 AM
Posted on May 17, 2011 at 13:20
Hello,
I think, it is a GPIOD Problem. Thanks...