2009-06-21 09:06 PM
RIDE7 Simulator Setbits Problem
2011-05-17 04:15 AM
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); }2011-05-17 04:15 AM
GPIOC clock not enabled?