Hi,
I'm trying to configure GPIOB pins on the STM32 Value line Discovery board, for PUSHPULL mode, and am running into some strange results. I must be missing something critical.
/* THIS will actually put the pins in PUSHPULL mode */
palSetGroupMode(GPIOB,0xffff,0,PAL_MODE_OUTPUT_OPENDRAIN );
/* This puts in ins in Open Drain mode */
palSetGroupMode(GPIOB,0xffff,0,PAL_MODE_OUTPUT_PUSHPULL );
Also, when using PAL_MODE_OUTPUT_OPENDRAIN, all pads will go into PUSHPULL mode, except for pads PB7,PB5, and PB4 which remain in open drain mode.
I've disabled all periphials except for serial device 2, and have disabled JTAG:
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE;
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_DISABLE;
I hope somebody has a clue what I'm doing wrong.
Thanks
Barry
Trouble configuring STM32 IO for PUSHPULL mode
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: Trouble configuring STM32 IO for PUSHPULL mode
Strange, the driver apparently is correct, I can't explain the behavior you reported.
Did you disable GPIO and AFIO clocks too?
Anyway, can you check the content of the CRL and CRH registers for port GPIOB after calling palSetGroupMode()? Nibbles should contain 3 for PP and 7 for OD.
Giovanni
I've disabled all periphials except for serial device 2
Did you disable GPIO and AFIO clocks too?
Anyway, can you check the content of the CRL and CRH registers for port GPIOB after calling palSetGroupMode()? Nibbles should contain 3 for PP and 7 for OD.
Giovanni
Re: Trouble configuring STM32 IO for PUSHPULL mode
Oh I figured out what was wrong. It is my Logic Probe, which is an older cheap one and so doesn't support anything below 4.5v and so the readings were incorrect.
When I connected an LED directly to the output, it reflected the actual state perfectly.
Now I know to use a scope or get an new probe
When I connected an LED directly to the output, it reflected the actual state perfectly.
Now I know to use a scope or get an new probe