Skip to main content
robinsm
Associate III
June 22, 2009
Question

RIDE7 Simulator Setbits Problem

  • June 22, 2009
  • 2 replies
  • 534 views
Posted on June 22, 2009 at 06:06

RIDE7 Simulator Setbits Problem

    This topic has been closed for replies.

    2 replies

    domen2
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:15

    GPIOC clock not enabled?

    robinsm
    robinsmAuthor
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:15

    The following code is from an example, I modified it to try and use the setbits/resetbits functions. When using the simulator, nothing seems to happen to the output data register when I try these functions. Any ideas?

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9;

    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;

    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

    GPIO_Init(GPIOC, &GPIO_InitStructure);

    while(1)

    {

    /* Turn on leds connected to PC.06 pin */

    GPIO_SetBits(GPIOC, GPIO_Pin_6);

    /* Insert delay */

    // Delay(0x7FFFF);

    /* Turn on leds connected to PC.07 pin */

    GPIO_Write(GPIOC, GPIO_Pin_7);

    /* Insert delay */

    // Delay(0x7FFFF);

    /* Turn on leds connected to PC.08 pin */

    GPIO_ResetBits(GPIOC, GPIO_Pin_7);

    GPIOC->ODR = 0x01;

    /* Insert delay */

    // Delay(0x7FFFF);

    /* Turn on leds connected to PC.08 pin */

    GPIO_Write(GPIOC, GPIO_Pin_9);

    /* Insert delay */

    // Delay(0x7FFFF);

    }