2014-07-31 03:54 AM
Hi ,
I am not able to see any voltage changes on GPIO pins of stm8l discovery.I have written the code, its compiling properly and i also could see the ODR register changing its value .I am using STVD and cosmic compiler/* MAIN.C file * * Copyright (c) 2002-2005 STMicroelectronics */#include ''stm8l15x.h''void delay_s(void);main(){ CLK_HSICmd(ENABLE); GPIO_DeInit(GPIOD); GPIO_Init(GPIOD,GPIO_Pin_4,GPIO_Mode_Out_OD_Low_Fast); while(1) { GPIO_WriteBit(GPIOD,GPIO_Pin_4,SET); delay_s(); GPIO_WriteBit(GPIOD,GPIO_Pin_4,RESET);} }void delay_s(){ uint8_t i,j; for(j=0;j<150;j++); } Thanks ,Sachin.2014-08-28 09:08 PM
Hello ,
Please initilaize the pin in Push Pull Mode,Not Output drain mode. or In your configuration ,Please add pull up resistor on that pin. It will work in either case. Thanks & Regards, Balmukund Prasad