Interrupt Information- MC68HC908JK1CP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt Information- MC68HC908JK1CP

2,103 Views
tihomirtiankov
Contributor I
Hi everybody
I would like to ask you something.
I'm working with MC68HC908JK1CP. I'm writing in C language.
When I use an interrupt I would like to be shure that all other interrupts are
disabled. How I can do it?
I have the following vector table:
Lowest vector priority  IF15 ADC conversion complete vector (high/low);
                                    IF14 Keyboard vector (high/low);
                                    IF5 TIM overflow vector (high/low);
                                    IF4 TIM channel 1 vector (high/low);
                                    IF3 TIM channel 0 vector (high/low);
                                    IF1 IRQ vector (high/low);
                                    - SWI vector (high/low);
Highest vector priority - Reset vector (high/low);
 
I couldn't understand how to write an appropriate function that will
check every time the status of the other interrupt flags and to
hold them enabled.
Thank you in advance.
 
Added p/n to subject.


Message Edited by NLFSJ on 2008-02-24 09:33 PM
Labels (1)
0 Kudos
Reply
4 Replies

614 Views
erooll
Contributor II
Hello.

I Attach a project that use interruption by IRQ, and device initialization.

to declarate a interrupt service you could use

#pragma TRAP PROC   
or
__interrupt

 function don't have parameters, and not return nothing example:

__interrupt void myISR(void)

the advantage of use the list of vectors that generate is that you have a ordenate list to put your interrupt routines.

Some question please let me know

Regards

0 Kudos
Reply

614 Views
bigmac
Specialist III
Hello,
 
Whenever an interrupt is processed, the I-bit within the CCR register is automatically set, so as to disable any further interrupts, after the normal stacking operation associated with an interrupt has occurred.  This will hold pending any further interrupts that occur during ISR processing of the first interrupt, and prevent nested interrupts from occurring.
 
During exit from the ISR, the previous value will be returned to the CCR register, so that further interrupts may then occur.  At this point, if more than one interrupt is pending, the higher priority one will then be processed.
 
So, for the usual non-nested interrupt operation, you don't need to do anything except clear the flag associated with the interrupt being processed.  Incidentally, the JK1 is quite unsuited to nested interrupt operation because of very small RAM size.  In fact, it would be debatable whether it is suited to being programmed in C because of stack size limitation, as well as the small flash size.
 
Regards,
Mac
 
 
 
0 Kudos
Reply

614 Views
tihomirtiankov
Contributor I
Thank for your reply
I examined the ProcessorExpert code related with Interrupt table that looks as follows:
void (* const _vect[])() @0xFFDE = {   // Interrupt table
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_Interrupt,
           Cpu_SWIInterrupt,
           _EntryPoint
   };
 
I would like to make the same but without using ProcessorExpert and writing on C language.
Is it possible to create this code in C environment and do you help me to create it.
Thank you in advance
0 Kudos
Reply

614 Views
bigmac
Specialist III
Hello,
 
I assume that you used PE for the MCU initialisation, and that the vector table is within the file MCUInit.c, along with the MCUInit() function code.  If you don't intend using other facilities of PE, you can still make use of the code within the MCUInit.c file, which can be manually modified if your setup requirements change.
 
With respect to the vector table data, just modify the table to suit the peripherals you are actually using within the project.  Each of the vectors within the table, with the exception of the reset vector, will need to reference its corresponding ISR function, provided the interrupt is actually being used.  Any interrupts that are not used by the project would be given an UNASSIGNED_INTERRUPT vector value.  You will be able to identify the purpose of each interrupt within the table, from the data sheet for the device.
 
Perhaps you could reveal which interrupts will be used by your project.
 
Regards,
Mac
 
 
 


Message Edited by bigmac on 2008-02-25 05:41 AM
0 Kudos
Reply