PWM - Driving an RC Servo, 20ms period, 1.5ms initial pulse-width
#Nucleo f103rb code
This will protect your code from being removed should you make changes using the STM32CubeMX again.ġ6 At this point the board should now contain your code. HAL_GPIO_TogglePin(LD2_GPIO_Port,LD2_Pin) īe sure to always place your code between the USER CODE BEGIN and USER CODE END comments You can use the short-cut icon, available in the tool-bar, to Build(F7)ġ3 Within the project view, open the project, and then the Application/User/Core folder and then double click main.cġ4 The LED GPIO should already have initialization code within MX_GPIO_Init().įind the infinite loop inside the main() function, and add the following two highlighted lines of code: Don't click anything!)ġ2 Within Keil IDE, before we make any changes / additions to the code, let's make sure it builds. (Keil may need to run it's package installer if it doesn't have support for the board. (You may get a dialog box indicating you are missing some dependencies. This instructs the Keil uVision application to be used.ġ0 Select GENERATE CODE button in upper right corner. Something like "Blinky" will work well.ĩ Within this same tab, select MDK-ARM for "Toolchain/IDE". This can be adjusted to 72MHz if desired.Ĩ Using the Project Manager tab, give the project a name.
Select the board.ĥ Click on Start Project in upper right corner of windowĦ A dialog will be displayed, asking "Initialize all peripherals with their default Mode ?"ħ Using the Clock Configuration tab, a 64MHz SYSCLK is configured by default.
#Nucleo f103rb install
Within this part series, this is considered a "Medium-density device",Īnd as such, has the following peripherals:Ģ SPIs, 2 I2Cs, USB, CAN, 1 PWM Timer, 2 ADCs Single-cycle multiplication and hardware division 4 PWM - Driving an RC Servo, 20ms period, 1.5ms initial pulse-width.