What's the best way to interface the MC9S08DZ60 to Hall sensors (to commutate a brushless DC motor) ?
I need to detect the change in the Hall sensor output in both directions, so I need to detect (and interrupt on) both rising and falling edges.
As I read the data sheet, GPIO pins can be configured to detect either rising or falling, but not both.
Is it OK to tie 2 GPIO pins together, and configure one for rising and the other for falling? That would generate 2 separate interrupts for each Hall sensor, but that's OK - I could just set a flag to indicate which interrupt is being serviced and call a common routine.
Is there a better way to do this that I am missing?
I thought about using a TPM channel as input capture (since that can be configured to interrupt on both edges) but all the TPM channels are being used.