cancel
Showing results for 
Search instead for 
Did you mean: 

How can I drive 8 GP outputs and then float the outputs?

ENort.1
Associate III

Hi All,

I am using the STM32H723 device and have 8 GP outputs going out to a GreenPAK device to set the exact bit delay and muxing the outputs per the customer configuration. Due to the nature of the application, I cannot afford to integrate the logic in the interrupt event as I need as much speed as possible. Is there a way to set the GP outputs and then float the outputs immediately after so that the GreenPAK device can sense the positive edge and then drive the signal/s low? I basically want to take control of the pins after it leaves the STM32H723 device. How can I do this? Any help is greatly appreciated.

Thanks,

Eric Norton

5 REPLIES 5
Bob S
Principal

Configure the GPIO pins are open-drain outputs. Enable the interal pull-ups if you do not have external pull-up resistors on those lines. Write "0" to th epins to drive them low. Then write a "1" to the pins to "float" them high. The external device can then drive them low whenever it wants and won't conflict with the STM32 pin states. This works better if all 8 pins are on the port (GPIOA, for example). And depending on your board design, the STM32's internal pull-ups may not give you a fast enough rise time (I have no idea what your GreenPAK device is looking for).

AScha.3
Chief II

you can write direct to port set registers, this is fastest way to change outputs.

ports are on AHB4 , at 200MHz bus clk and higher cpu clk can expect 5ns action on port.

( highest speed setting, optimizer on , -O2 os -Ofast , prefetch and caches ON )


_legacyfs_online_stmicro_images_0693W00000bjzBhQAI.pngand just set outputs as you like and then set mode register to -> input. (tri state output)


_legacyfs_online_stmicro_images_0693W00000bjzBwQAI.png 

write access example :  GPIOB->MODER = 0x080E ; 

If you feel a post has answered your question, please click "Accept as Solution".

> at 200MHz bus clk and higher cpu clk can expect 5ns action on port.

In 'H7, writing from processor? Hardly so.

Btw. I have no idea what is the original request all about. Any timing diagram, block diagram, pseudo-schematics?

JW

Hi Bob,

Ahh ok, I will configure the outputs as open-drain and may need to use external pullups because I may need to tune the resistors due to the speed.

Funny you should mention GPIOA as I am using bits 0-7 for the first group and 8-15 for the second group. I am driving them like so:

uint16_t drive_port;

LL_GPIO_WriteOutputPort(GPIOA, drive_port);

Calling the low-level function works well for my purposes for push-pull output configuration and hope it will work well for open-drain as well.

I am using the SLG46533V device which has pullup or pulldown resources if I need them. Quite an interesting little chip for sure. I highly recommend it if you need a small PLD with I2C interface :)

Yes, I am aware of writing the pins this way. Thank you for this though.