2015-05-14 11:02 PM
Hello everyone,
i would like to ask for your knowledge. I am new in Cortex programming (my only experience is on Adruino platform) and i have managed to blink the LEDs on my Cortex device (it's an STM32 conStick from HiTex using the STM32F107VC micro controller) but there is something i cannot quite understand. My question is why since we just want to blink a LED we need to setup the clock on the GPIO port ? I can understand that the LED is just one of the pins that belong to the same GPIO port but since i am using only the LED why the chip does not allow me to just enable it through RCC and forget about the clock ? I know that my question might be dump but please bear with me...i am trying to learn here. My background is software engineering so i am completely new (except the Arduino) in the micro controller programming. Best regards and thank you in advance, Panos.2015-05-15 12:12 AM
Panos,
The reason is that on all architectures ARM Cortex-M, every peripherals are clocked by a specific bus (see datasheet RCC domain) For this reason, to use a pin or more of a GPIO port (or any other peripherals as Timer, ADC or USART...) it's imperative that the peripheral concerned is clocked.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-05-15 04:51 AM
Hi @rrom and thank you so much for your quick reply,
in your message you mean because all the GPIO ports (including other pieces) are connected to the APB2 and because of that the system must know how to send receive data from/to all various pieces (regardless if it's a blinking LED or a timer) that's why we must clock the whole port ? Again excuse me if my questions are dumb. Best regards, Panos.