LPC43xx Interrupts with PINTSEL1 are not working

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC43xx Interrupts with PINTSEL1 are not working

1,908件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sadfsdf on Wed Oct 21 03:18:15 MST 2015
Hello guys,
i was working with with Proximity Sensor and I need to get interrupt from it.
the problem is that I already have 4 interrupts so PINTSEL0 is full. And i tried to do the same with PINTSEL1..but it s not working. And When i try to change it to PINTSEL0 it works. Do you have any ideas about that. Here is my code.
void proximityInt_init(const DRV_EXTERNAL_INTERRUPT_CALLBACK newProximityInt1Callback)
{
proximityInt1Callback = newProximityInt1Callback;
nvicDisableVector(PIN_INT7_IRQn);
/* Setup GPIO6 Pin 15 */
palSetPadMode(6, 12, PAL_MODE_INPUT);
/* Set up GPIO6 Pin 15 as interrupt */
//LPC_SCU->PINTSEL1 |= ((0x6 << 5) | 0xc) << 24;
LPC_SCU->PINTSEL1 |= (6 << 29) | (0xC << 24);
LPC_GPIO_PIN_INT->IST |= 0x80; // Clear interrupts
LPC_GPIO_PIN_INT->ISEL &= ~0x80; // Edge sensitive
LPC_GPIO_PIN_INT->SIENR |= 0x80; // Enable rising interrupts
LPC_GPIO_PIN_INT->SIENF |= 0x80; // Enable falling interrupts
/* Enable interrupts */
nvicEnableVector(PIN_INT7_IRQn, CORTEX_PRIORITY_MASK(2));
}

ラベル(1)
0 件の賞賛
返信
9 返答(返信)

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sadfsdf on Tue Oct 27 08:01:31 MST 2015
Thank you...didn`t know that..
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Tue Oct 27 01:49:18 MST 2015
The meaning of IST changes depending on ISEL, so ISEL should be written first.

Using |= for IST, SIENR and SIENF is wrong, use =.

Here is my code for comparison:
  LPC_GPIO_PIN_INT->ISEL &= ~(1U << 0);  /* Edge sensitive */
  LPC_GPIO_PIN_INT->IST   =  (1U << 0);  /* Clear edge interrupts */
  LPC_GPIO_PIN_INT->CIENR =  (1U << 0);  /* Disable rising edge interrupt */
  LPC_GPIO_PIN_INT->SIENF =  (1U << 0);  /* Enable falling edge interrupt */
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sadfsdf on Mon Oct 26 23:55:39 MST 2015
nvicDisableVector(PIN_INT1_IRQn);

/* Setup GPIO6 Pin 12*/
palSetPadMode(6, 12, PAL_MODE_INPUT);

/* Set up GPIO6 Pin12 as interrupt */
LPC_SCU->PINTSEL1       |= (6 << 29) | (0xC << 24);
//LPC_GPIO_PIN_INT->IST   |= 1 << 7; // Clear interrupts
LPC_GPIO_PIN_INT->ISEL  |= 0 << 7; // Edge sensitive
LPC_GPIO_PIN_INT->SIENR |= 1 << 7; // Enable rising
LPC_GPIO_PIN_INT->SIENF |= 1 << 7; // Enable falling

/* Enable interrupts */
nvicEnableVector(PIN_INT1_IRQn, CORTEX_PRIORITY_MASK(2));

That is my working code. The real issue was comment line with LPC_GPIO_PIN_INT->IST or put 0 there. Sorry for disinfo. Now it works. Thank you , you responds were very helpfull.
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Thu Oct 22 06:43:11 MST 2015
Strange.
The only difference is that 0x80 is an unsigned int and (1 << 7) evaluates to a signed int, but the value should be the same. (You could also test (1U << 7), which is unsigned.)
Can you post your working code to see what you did exactly?
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sadfsdf on Thu Oct 22 05:54:53 MST 2015
Thank you..
i changed 0x80 to (1 << 7)
and using only = it works now...but only with (1 << 7).
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sadfsdf on Wed Oct 21 07:49:55 MST 2015
Thank you...
already checked address of LPC_SCU->PINTSEL1 it is 0x40086E04//like it suppose to be..
and all things that are configured i passed on the top...or i missed something?
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Wed Oct 21 07:04:31 MST 2015
My code works for PIN_INT0 (the normal setting I use), PIN_INT4 and PIN_INT7.

You could check if all your definitions are correct (i.e. the address of LPC_SCU->PINTSEL1, interrupt numbers, the functions for enabling interrupts, ...).
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sadfsdf on Wed Oct 21 06:03:15 MST 2015
Yes, you are right I am using GPIO6[12]..wrong comments...will edit them.
The problem is that it is working with PIN_INT1 for example, but is not working with PIN_INT7.
For PIN_INT1 code looks like that :
void proximityInt_init(const DRV_EXTERNAL_INTERRUPT_CALLBACK newProximityInt1Callback)
{
proximityInt1Callback = newProximityInt1Callback;
nvicDisableVector(PIN_INT1_IRQn);
/* Setup GPIO6 Pin 12 */
palSetPadMode(6, 12, PAL_MODE_INPUT);
/* Set up GPIO6 Pin 12 as interrupt */
LPC_SCU->PINTSEL0 |= (6 << 13) | (0xC << 8);
LPC_GPIO_PIN_INT->ISEL &= ~0x02; // Edge sensitive
LPC_GPIO_PIN_INT->SIENR |= 0x02; // Enable rising
LPC_GPIO_PIN_INT->SIENF |= 0x02; // Enable falling
/* Enable interrupts */
nvicEnableVector(PIN_INT1_IRQn, CORTEX_PRIORITY_MASK(2));
}
0 件の賞賛
返信

1,802件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Wed Oct 21 05:03:32 MST 2015
To me that looks mostly correct for PIN_INT7 on GPIO6[12]
(you have the wrong pin number in comments, and you should better use = instead of |= for set/clear registers).

Did you check the external connection to the pin and that the correct function is selected in the SCU, for example by reading GPIO6[12] directly?
0 件の賞賛
返信