Re: MPC566 interrupt help!!!
"brucel1505" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Hi Rajesh, I use a 555 and don't use codewarrior, but all the registers you speak about sound familiar. When the PIT generates an interrupt, an external exception occurs, which causes the program counter to jump to an address offset of 0x500. If you only have one external exception then you could have a branch to a PIT exception handler as the instruction placed at address offset 0x500(your printing output function), and that would be pretty much it. If you have muiltiple potentional external exceptions set up then the "branch to" instruction would branch to a more generic handler, which would check the state of the SIPEND and SIVEC registers and ascertain what the source (in your case the PIT) of the exception was and then call your printing output function from the generic handler. You will also have to consider that the context is saved and restored correctly, perhaps this interrupt.c file offers some of that "for free"?. In addition, it is good practice to minimise the content of the ISR, by perhaps simply setting a software flag that is checked for later - it all depends on the application. Hope that helps a little. --- In [email protected], "Rajesh" <rajesh86us@...> wrote: > > > Dear Grp members, > I am working on MPC566 EVB with Codewarior compiler. > At present I am trying to print an output at a particular interval. For > that, I am initiallizing the timer registers PISCR, PITC, PITR, in > which PITC is configured. I have written an ISR function(to print an > output), but since the exception handler will call my ISR function (on > interrupt request), where exactly I have to define this ISR in the > handler? While creating a project in codewarior, an 'interrupt.c' file > is automatically generated. What is the use of this file? > Hope I am able to define my problem. Any kind of help is appreciated. > > -regards > Rajesh > ----------------------------------------------------------- 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/