External interrupts (e.g. ft5x_ts)

Started by aauer1, February 20, 2013, 09:12:01 PM

Previous topic - Next topic

aauer1

Hi,

I want to share some knowledge with you about external interrupts.
What I wanted to do is to connect a capacitive touchscreen controller to the A13 processor. The TS controller issues an interrupt by pulling down one of its signal wires. Afterwards, the cpu should detect this interrupt and should get the data from the touch controller.

The interrupt pin can be specified in the script.fex file BUT the driver of the touch controller (ft5x_ts.c) isn't working correctly with that information. The driver uses the port_num value to set up the interrupt register. The value of port_num equals the number of the port (e.g. PE00 => port_num == 0; PE01 => port_num == 1, ...). But to enable the external interrupt correctly, you have to specify the number of the external interrupt. In my case PE00 is external interrupt number 14 (EINT14). So, port_num should have the value 14 instead of 0.

IMPORTANT: To enable an external interrupt you have to specifiy the external interrupt number instead of the port number!!!!

My quick fix is, to ignore the script.bin value of the interrupt port and use the number of the interrupt hardcoded. I know, this is a very bad and ugly fix, but it works for now.

I wanted to make this public because I think it will save some time for others looking for anything about external interrupts. And maybe someone can use this information to implement some core functions to map port numbers to external interrupt numbers and to set up external interrupts correctly.

Cheers,
Andreas

maggocnx

Hello Andreas,

could you or anybody else give me an example C code snippet for using the interrupt on the A13 Board. It's my first embedded linux project ever. I want to use PB10 (EINT24) to trigger reading data from SPI 2.


Thanks

Marco