STM32L152 PWM Channel not available!?!

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
corado
Posts: 399
Joined: 28 Mar 2009 11:03

STM32L152 PWM Channel not available!?!

#1 Post by corado » 29 Sep 2021 10:36

If I write...then I got
"26 303 Identifier "_GPIO_MODULE_TIM9_CH2_PB14" was not declared STM32L_Discovery.mpas"

[code}program STM32L_Discovery;

{ Declarations section }
// LCD module connections
VAR LCD_RS : sbit at GPIOB_ODR.B13;
VAR LCD_EN : sbit at GPIOB_ODR.B11;
VAR LCD_D4 : sbit at GPIOB_ODR.B10;
VAR LCD_D5 : sbit at GPIOB_ODR.B2;
VAR LCD_D6 : sbit at GPIOA_ODR.B5;
VAR LCD_D7 : sbit at GPIOA_ODR.B4;
// End LCD module connections
// rw PB12
// 0 PB14 Contrast
//Backlight PA2 & PA3

begin
{ Main program }
PWM_TIM9_Init(2500);
GPIO_Digital_Output(@GPIOA_BASE, _GPIO_PINMASK_ALL);
GPIO_Digital_Output(@GPIOB_BASE, _GPIO_PINMASK_ALL);
GPIOB_ODR.12 :=0; //LCD_RW = GND
GPIOB_ODR.14 :=0; //LCD_Contrast
GPIOA_ODR.3 :=1; //LCD_Backlight VCC
GPIOA_ODR.4 :=0; //LCD_BAcklight GND


PWM_TIM9_Set_Duty(25531,_PWM_NON_INVERTED,_PWM_CHANNEL2);
PWM_TIM9_Start(_PWM_CHANNEL2, @_GPIO_MODULE_TIM9_CH2_PB14);


end.[/code]
Attachments
stm32L152RBT6.jpg
stm32L152RBT6.jpg (67.1 KiB) Viewed 969 times

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: STM32L152 PWM Channel not available!?!

#2 Post by filip » 01 Oct 2021 08:47

Hi,

You can open the GPIO definition file for this MCU (press Ctrl + Alt + M and search for the __Lib_GPIO_XYZ file and the go to Uses folder and find it), and add the definition that is missing.

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for ARM General”