Master Interrupt Priority Flag (MIP)

cobra2326

#1 ◈ 2024-10-03

Im in the process of rewriting the stock ECU code to work with my wideband, and in the process, Im hacking through a lot of the main fuel control code.

Can anyone tell me what happens when you set one of the Master Interrupt Priority Flags? Does this call an interrupt of some sort? The docs state that bit 8 is master interrupt priority, and bits 4,5,9 are user MIP flags. I see the statement

SB PSWL.4

a lot in code, and Im wondering what this actually does. Obviously it sets some interrupt state or actually calls an interrupt?

Thanks in advance.

Ltdannear

#2 ◈ 2024-10-03

I don't fully understand but maybe this helps:

I think if you set MIP=1 then it enables the higher interrupts to take priority over lower interrupts, whereas with it disabled, all interrupts are treated with the same priority.

A hypothetical example: if you're handing something like an interrupt for the injector pulse, you might want that to have priority over an interrupt for the serial routines, so you would enable (Set MIP)=1. when you're done with your injector pulse routines, you can pass control back to the other interrupts by disabling( Reset MIP)=0, allowing the other events to hook.

a1k0n

#3 ◈ 2024-10-03

PSWL.4 and .5 are indeed user flags, and the code uses them basically to pass around boolean parameters - the microcontroller doesn't do anything with those flags, so they act like extra one-bit RAM locations. They're not "MIP" flags of any sort, though, but I remember seeing some ridiculous wording like that in the 66k docs.

however, I'm way too out of touch with that stuff to give you any constructive advice about the interrupt priority stuff. Generally the code messes with the IE register to enable/disable interrupts, typically at the beginning and end of each interrupt service routine, and along with that I can see the code also does a RB PSWH.0 and SB PSWH.0 (which would be bit 8 of the PSW). I've never really noticed that before.

Anyway I'd leave it alone. :)

highvelcty

#4 ◈ 2024-10-03

Re: Master Interrupt Priority Flag (MIP)

cobra2326 wrote:
Im in the process of rewriting the stock ECU code to work with my wideband, and in the process, Im hacking through a lot of the main fuel control code.

Can anyone tell me what happens when you set one of the Master Interrupt Priority Flags? Does this call an interrupt of some sort? The docs state that bit 8 is master interrupt priority, and bits 4,5,9 are user MIP flags. I see the statement

SB PSWL.4

a lot in code, and Im wondering what this actually does. Obviously it sets some interrupt state or actually calls an interrupt?

Thanks in advance.


by the name of it, i would say this interrupt has priority over all other processes. the question is, is what causes the interrupt? is it a timer, an external input such as a high or low voltage, other?

also, you will need to know what to name your function so when the interrupt occurs, it has something to do even if it is nothing.

does anyone have the datasheet to the ucontroller?

Ltdannear

#5 ◈ 2024-10-03

..