RE: PIT interrupts
"Dobbin Allan-r11834" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <4147ED8B92A864498825C07E53594E4A3229B7@az33exm20.fsl.freescale.net> |
What do you mean by "I am able to generate the interrupts."? DO you mean the PIT interrupt status flag is getting set, or are you taking some other exception? Did you follow the last mail I sent and did it solve anything? Is the PIT now decrementing? Have you set MSR[EE] to allow interrupts? Have you set PIT interrupt priority high enough to get past present interrupt mask level? Regards, Allan -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of sripathy23 Sent: Wednesday, September 07, 2005 1:44 PM To: [email protected] Subject: [MPC500] PIT interrupts Dear Members Thanks for helping me about PIT interrupts. I am able to generate the interrupts. But I think I am unable to got to the address at 0x0500 which is the address for external interrupts. I am using the pragma for the interrupts. i tried to use the example for the sci interrupt in pdf AN2109. Instead of SCI i am using a PIT interrupt. I have given the code below to generate the interrupt and the handler. In the code below PIT_Int() is the interrupt handler.I have used a pragma interrupt on to go to external interrupts. Th ecode in the pragma section which is commented is the code which is given in sci interrupt example at AN2109. i tried to run this code but it gave me an error saying illegal pragma. i think that they have used the example in the diab compiler whereas i am using a code warrior compiler. is my code for the interrupt is write. I would really appreciate if anyone can have a look at this. void PIT_Int() { cout<<"Interrupt handler"<<endl; if(USIU.PISCR.B.PS == 1) { pitctra1++; // Increment PIT interrupt counter if(pitctra1==100) { countera1 = countera1+100; MIOS1.MPWMSM2PULR.R = 100; /* Set Duty Cycle to 25%*/ MIOS1.MPWMSM2SCR.B.EN = 1; /* Enable output on PWM2 */ USIU.PISCR.B.PS = 1; // Negate interrupt request flag1=1; pitctra1 = 0; } else { } } else { } } #pragma interrupt on #pragma section code_type "IrqSect" ".abs.00000500" //#pragma interrupt Ext_Isr //#pragma section IrqSect RX address=0x500 //#pragma use_section "IrqSect" Ext_Isr //__declspec(section"IrqSect") void Ext_Isr() { #define LEVEL0 0x40000000 asm (" mtspr EID, r0 "); // Set MSR.RI - now recoverable if (USIU.SIPEND.R&LEVEL0) // Check if IRQ is level 0 { PIT_Int(); // Call PIT C interrupt handler } else { // Just return } asm (" mtspr NRI, r0 "); // Clear MSR.RI - now irrecoverable }; #pragma interrupt off ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/dN_tlB/TM --------------------------------------------------------------------~-> ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MPC500/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/