How to clean all the pins with GPIO_PortClear?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to clean all the pins with GPIO_PortClear?

735 Views
javierhernande1
Contributor IV

Hello,

It's not possible to use GPIO_PortClear so?

GPIO_PortClear((void*)base[i], 0u << pin[i]);

I want to turn off all the leds but that not works, only with 1u but turn on all the leds. I have changed the logic in pin_mux but not works to me.

The 7 segment led display that I'm using is common anode.

BR

Labels (1)
2 Replies

661 Views
mjbcswitzerland
Specialist V

Hi

PIO_PortClear((void*)base[i], 0u << pin[i]);

does nothing because writing a 0 to that register has no effect.

You need

GPIO_PortSet((void*)base[i], 1u << pin[i]);

Regards

Mark

Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.html

660 Views
javierhernande1
Contributor IV

Thank you!

Works fine.

BR

0 Kudos
Reply