2015-10-20 02:29 AM
gpioc pin 0 and gpio a pin 0 &1 work fine
but gpio c pin 1 and furhter show 0.5v at output instead of 3 volts. here is the code i implemented &sharpinclude ''main.h'' static __IO uint32_t TimingDelay; //------------------------------------------------------------------------------ // Function Name : Init _GPIO pins // Description : pins ,port clock & mode initialization. //------------------------------------------------------------------------------ void Init_GPIO(void) { /* GPIO config */ GPIO_InitTypeDef GPIO_InitDef; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE); GPIO_InitDef.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitDef.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitDef.GPIO_OType = GPIO_OType_PP; GPIO_InitDef.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitDef.GPIO_Speed = GPIO_Speed_50MHz; //Initialize pins GPIO_Init(GPIOC, &GPIO_InitDef); RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE); GPIO_InitDef.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitDef.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitDef.GPIO_OType = GPIO_OType_PP; GPIO_InitDef.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitDef.GPIO_Speed = GPIO_Speed_50MHz; //Initialize pins GPIO_Init(GPIOA, &GPIO_InitDef); //volatile int i;} } void Delay(__IO uint32_t nTime) { TimingDelay = nTime; while(TimingDelay != 0); } /** * @brief Decrements the TimingDelay variable. * @param None * @retval None */ void TimingDelay_Decrement(void) { if (TimingDelay != 0x00) { TimingDelay--; } } /******************************************************************************* * Function Name : main * Description : Main program. *******************************************************************************/ int main(void) { Init_GPIO(); //calling a function while(1)//infinite loop { /*ODR bits can be individually set and reset */ //for displaying 0 GPIO_SetBits(GPIOC, GPIO_Pin_0); GPIO_SetBits(GPIOA, GPIO_Pin_0); GPIO_SetBits(GPIOC, GPIO_Pin_2); GPIO_SetBits(GPIOA, GPIO_Pin_1); } } #no-crystal-ball2015-10-20 04:10 AM
Hi kazi.adeem,
I suggest you check the hardware connections to the pins where you see 0.5V instead of 3 V (may be there is an external connection to the ground).Then, in your main, I don't see the code to set GPIO_Pin_1 for port C.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-10-20 10:14 PM
2015-10-20 11:26 PM
and these are the pins connected to sb27 to sb 32 these are the jumpers i guess
2015-10-21 12:42 AM
What hardware are you talking about?
2015-10-21 12:44 AM
stm32f072b
2015-10-21 12:55 AM
I can see no ''sb27 to sb 32'' in the STM32F072 datasheet.
So what hardware are you talking about? JW2015-10-21 12:59 AM
2015-10-21 01:01 AM
here look at the attachment.the pin config is there
________________ Attachments : Untitled.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0nB&d=%2Fa%2F0X0000000bin%2FKrUVbPrPQt3mDdpO5eDBzWEHcX5XPqTuILxjuYPKssc&asPdf=false2015-10-21 01:12 AM
This still does not tell us what hardware are you talking about, nor what is connected to the pins you showed.
Also, you complained about PC1, there is no PC1 shown on that picture. JW