Question
Pin PA8 configured as OUTPUT
Posted on January 29, 2016 at 16:30
Hello,
I'm trying
for several
days
to set up the
pin
PA8
(
STM32F4
) asoutput
but
I do not see
anything with
an oscilloscope.
Here is the
code I use
to configure the
pin
:
#define PORT_IO_A_8 ((Uint32)0)
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
Uint32 port_a_mask =
(PORT_IO_A_0 << 0 ) |
(PORT_IO_A_1 << 1 ) |
(PORT_IO_A_2 << 2 ) |
(PORT_IO_A_3 << 3 ) |
(PORT_IO_A_4 << 4 ) |
(PORT_IO_A_5 << 5 ) |
(PORT_IO_A_6 << 6 ) |
(PORT_IO_A_7 << 7 ) |
(PORT_IO_A_8 << 8 ) |
(PORT_IO_A_9 << 9 ) |
(PORT_IO_A_10 << 10) |
(PORT_IO_A_11 << 11) |
(PORT_IO_A_12 << 12) |
(PORT_IO_A_13 << 13) |
(PORT_IO_A_14 << 14) |
(PORT_IO_A_15 << 15);
GPIO_InitStructure.GPIO_Pin = ((uint32_t)port_a_mask) & 0xFFFF9FFF;
//JTMS-SWDIO, JTCK-SWCLK
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = (~((uint32_t)port_a_mask)) & 0xFFFF9FFF;
//JTMS-SWDIO, JTCK-SWCLK
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_Init(GPIOA, &GPIO_InitStructure);
I use
the following function
to switch between
high or low level
.
1.
GPIO_WriteBit(GPIOA,GPIO_Pin_8, Bit_RESET);
2.
//GPIO_WriteBit(GPIOA,GPIO_Pin_8, Bit_SET);
The pin is
always
at the low level
.I tested
with
another pin
as
PA0
or
PA1
and
it works
well
.
I hope you can help me.
Cordially
Guillaume #gpio #!stm32f4discovery-!fsmc