GPIO_Alternate_Function_Enable and jtag pins

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
kentar
Posts: 78
Joined: 29 Oct 2010 07:54

GPIO_Alternate_Function_Enable and jtag pins

#1 Post by kentar » 23 Feb 2018 11:47

If i want to use pb3 , pb4 pins i can use a command similar to
GPIO_Alternate_Function_Enable(&_GPIO_MODULE_SWJ_JTAGDISABLE);
of mikroc .

Is there this declaration in Mikropascal ?
Attachments
swd.JPG
swd.JPG (48.29 KiB) Viewed 2063 times

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

Re: GPIO_Alternate_Function_Enable and jtag pins

#2 Post by filip » 01 Mar 2018 16:14

Hi,

Which MCU are you using ?

Regards,
Filip.

drbam52
Posts: 2
Joined: 26 Sep 2021 15:15

Re: GPIO_Alternate_Function_Enable and jtag pins

#3 Post by drbam52 » 27 Sep 2021 16:37

I have the same problem - must to use PB3 and PB4 as digital outputs, PB5..PB9 as digital inputs, MCU is STM32F100RB, compiler mikroPascal PRO for ARM.
I try also to find definition for AFIO-MAPR with idee to set bits 26..24/ SWJ_CFG := 0x4; without result...

Please advise with example code.

drbam52
Posts: 2
Joined: 26 Sep 2021 15:15

Re: GPIO_Alternate_Function_Enable and jtag pins

#4 Post by drbam52 » 02 Oct 2021 15:07

For free both РВ3 and РВ4 as standard I/O pins simple:

AFIOEN_bit := 1;
SWJ_CFG0_bit := 0;
SWJ_CFG1_bit := 0;
SWJ_CFG2_bit := 1;

See RM page.116 / Table 29. Debug port mapping

Post Reply

Return to “mikroPascal PRO for ARM General”