Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: pio interrupt (user key) as win ce driver
PostPosted: Fri Oct 16, 2009 1:40 pm 
Offline

Joined: Fri Oct 16, 2009 1:25 pm
Posts: 1
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:
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:
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:
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 ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: