Why do the USDHC examples use a GPIO interrupt to detect card insertion/removal and not the USDHC controllers insert/removal interrupt?

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

Why do the USDHC examples use a GPIO interrupt to detect card insertion/removal and not the USDHC controllers insert/removal interrupt?

572 Views
mjbcswitzerland
Specialist V

Hi All

Is there a reason why the USDHC examples don't use the USDHC controller's own insertion/removal interrupt but instead use a general purpose port interrupt?

I note that when I try to use the USDHC's own it reflects the (non-debounced) insertion state but it doesn't update the insertion/removal flags. Is there such a problem that caused the example developer to abandon the method and fall back on a GPIO (nothing found in the erratas though)?

Regards

Mark

[uTasker project developer for Kinetis and i.MX RT]

Labels (2)
0 Kudos
2 Replies

487 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Mark:

Which soc you are using?  From my test result, on RT1050, the usdhc doesn't support level detect, but support edge detect only.

Regards

Daniel

0 Kudos

487 Views
mjbcswitzerland
Specialist V

Hi Daniel

I checked i.MX RT 1020 and i.MX RT 1060 and in both cases the example code used GPIO inputs to detect the SD card (but I expect all examples will be the same).
In the meantime I implemented the USDHC internal card detection/removal successfully: https://www.utasker.com/iMX/RT1020.html which has worked very reliably (initially I had a clocking issue that was stopping it working, even if the present state flag was following it correctly).

A potential benefit of the GPIO interrupt method is that the USDHC controller can be gated off to save some power but I haven't measured whether it actually is better or not.

Regards

Mark

[uTasker project developer for Kinetis and i.MX RT]