pio interrupt (user key) as win ce driver

This forum is for users of Atmel's SAM Series and who are interested in using WinCE OS.

Moderator: nferre

mfuser@gmx.at
Posts: 1
Joined: Fri Oct 16, 2009 1:25 pm

pio interrupt (user key) as win ce driver

Fri Oct 16, 2009 1:40 pm

i try to make an user key driver with AT91RM9200 and win ce 5.0
a button is connected on PC14

the initialisation of the pio as interrupt input is:

Code: Select all

AT91F_PMC_EnablePeriphClock(v_pPMC, 1 << AT91C_ID_PIOC);
AT91F_PIO_CfgInput(v_pPioC, AT91_SW_MASK_MV);
AT91F_AIC_ConfigureIt(v_pAIC, AT91C_ID_PIOC, AT91C_AIC_PRIOR_LOWEST,AT91C_AIC_SRCTYPE_INT_LEVEL_SENSITIVE, NULL);   
AT91F_AIC_EnableIt(v_pAIC, AT91C_ID_PIOC);
the mapping of irq<->sysintr:

Code: Select all

UINT32 logIntr = 142; //PC14 + 128 = 142
KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &logIntr, sizeof(UINT32), &sysIntr, sizeof(UINT32), NULL)
InterruptInitialize(sysIntr, btnEvent, NULL, 0)
a thread checks the btnEvent:

Code: Select all

while(1) {
   WaitForSingleObject(btnEvent, INFINITE);
   //do debug out some text ... 'XXX'
   Sleep(30);
   InterruptDone(sysIntr);
}
first pressing of the button:

4294785597 PID:61fb8c22 TID:a1f1df22 +pioGetLogintr() = 128 (!=4)
4294785597 PID:61fb8c22 TID:a1f1df22 +SOCDisablePioIrq(128) bank 2 pin 0
4294785597 PID:61fb8c22 TID:a1f1df22 +SOCEnablePioIrq(128) bank 2 pin 0
4294785767 PID:61fb8c22 TID:61f0efba +pioGetLogintr() = 129 (!=4)
4294785767 PID:61fb8c22 TID:61f0efba +SOCDisablePioIrq(129) bank 2 pin 1
4294785767 PID:61fb8c22 TID:61f0efba +SOCEnablePioIrq(129) bank 2 pin 1

second pressing of the button:

4294805234 PID:61fb8c22 TID:1ec1b1a +pioGetLogintr() = 133 (!=4)
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCDisablePioIrq(133) bank 2 pin 5
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCEnablePioIrq(133) bank 2 pin 5
4294805234 PID:61fb8c22 TID:1ec1b1a +pioGetLogintr() = 135 (!=4)
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCDisablePioIrq(135) bank 2 pin 7
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCEnablePioIrq(135) bank 2 pin 7
4294805234 PID:61fb8c22 TID:1ec1b1a +pioGetLogintr() = 137 (!=4)
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCDisablePioIrq(137) bank 2 pin 9
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCEnablePioIrq(137) bank 2 pin 9
4294805234 PID:61fb8c22 TID:1ec1b1a +pioGetLogintr() = 141 (!=4)
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCDisablePioIrq(141) bank 2 pin 13
4294805234 PID:61fb8c22 TID:1ec1b1a +SOCEnablePioIrq(141) bank 2 pin 13

third pressing of the button (DEBUG OUTPUT MESSAGE IS PRINTED):

4294805436 PID:61fb8c22 TID:1ec1b1a +pioGetLogintr() = 142 (!=4)
4294805436 PID:61fb8c22 TID:1ec1b1a +SOCDisablePioIrq(142) bank 2 pin 14
4294805477 PID:61fb8c22 TID:a1f2ebea XXX
4294805509 PID:61fb8c22 TID:a1f2ebea 0x81f17a80: +SOCEnablePioIrq(142) bank 2 pin 14


but after the next press the systems hangs:

4294826474 PID:c1fe5cc6 TID:81fb8736 +pioGetLogintr() = 144 (!=4)
4294826474 PID:c1fe5cc6 TID:81fb8736 +SOCDisablePioIrq(144) bank 2 pin 16
4294826474 PID:c1fe5cc6 TID:81fb8736 +SOCEnablePioIrq(144) bank 2 pin 16


may i do something wrong ?

Return to “WinCE”

Who is online

Users browsing this forum: No registered users and 2 guests