Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

c language for z8encore!

Status
Not open for further replies.

kekek

New Member
i'm working on a project using z8 encore! mc. i'm using c-compiler, so i have a question on c programming. the 'EI' command enables all interrupts, but how it works? is it enables the interrupts one by one based on the interrupt priority or it just wait for an interrupt to occur and responds to the particular interrupt? eg.;

void with_intr_start_dmaadc(void)
{
SET_VECTOR(DMA,isr_DMA_ADC); // Pass the vector number and the
// ISR address to be placed into the
// interrupt table
EI(); // Enables all interrupts
DACTL |= ENABLE_DMAADC_INT; // Enable the DMA_ADC and set
// enable the interrupt. This will
// generate an interrupt, after the
// DMA completes the data transfer
// to the buffer location.
}
so, any idea? :(
 

krzysiek

New Member
Hi
The EI() command sets the master interrupt enable bit.


Master Interrupt Enable
The master interrupt enable bit (IRQE) in the Interrupt Control register globally enables
and disables interrupts.
Interrupts are globally enabled by any of the following actions:
Execution of an EI (Enable Interrupt) instruction
• Execution of an IRET (Return from Interrupt) instruction
• Writing a 1 to the IRQE bit in the Interrupt Control register

Interrupts are globally disabled by any of the following actions:
• Execution of a DI (Disable Interrupt) instruction
• eZ8 CPU acknowledgement of an interrupt service request from the interrupt
controller
• Writing a 0 to the IRQE bit in the Interrupt Control register
• Reset
• Execution of a Trap instruction
• Illegal instruction trap


beside that all interrupts has its own enable/priority bits.
I also suggest you enabling all interrupts after you set up all interrupts vectors and prioritis which you are going to use.
 

kekek

New Member
thanks a lot for responding. krzysiek, i think your explaination is included in the zilog website of z8encore microcontrollers product specification. i just realized that the manual explains the operation of the master interrupt. hmm... that mean i have to study the manual again... anyway, thanks again... :oops:
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top