Loosing my mind or just stupid ?
Posted: Mon Sep 15, 2008 6:54 pm
I am going crazy here. I got an external IC that give me a interrupt every 20ms.
this IRQ is active low, and that is how I have my IRQ setup.
what I don't understand is when I comment out "LINE A" I can see on the scope that I am issuing a read signal, though its taking 16ms after the IRQ fires to do that, but that is another issue I don't get too.
I figured I would speed things up by not having the function call to OKI_Read and just put that line of code directly in the IRQ itself, yet when I add in "LINE A" and comment out "LINE B" I dont get any read requests anymore on the bus.
Would someone please enlighten me as to why this is & if you also have an idea why its taking 16ms to start this read would be helpful as well.
FYI, this is on the MOD5234, when I ran this on the MOD5270 it was smoking fast the read was virtually instant. The ONLY difference between these 2 boards is that the MOD5270 is talking to the chip using GPIO and the MOD5234 is using the address and data bus. I figured the address and data but method would smoke the GPIO way, but this is not the case.
//*************************************************************
//********************** GET DATA FROM OKI ***********************
//*************************************************************
BYTE OKI_Read(BYTE address)
{
return *( (unsigned char *)(CS3_ADDRESS + address));
}
//***************************************************************
//**************** OKI IRQ THAT DATA IS READY TO READ ****************
//***************************************************************
INTERRUPT(irq3_isr, 0x2300) // request to Read encoded audio
{
sim.eport.epfr |=0x08; // Clear This IRQ
BYTE x,y;
for(x=0;x<160;x++)
{
LINE A: y = *( (unsigned char *)(0x80000080));
LINE B: y = OKI_Read(0x80);
encoded_data[0] = y;
}
}
this IRQ is active low, and that is how I have my IRQ setup.
what I don't understand is when I comment out "LINE A" I can see on the scope that I am issuing a read signal, though its taking 16ms after the IRQ fires to do that, but that is another issue I don't get too.
I figured I would speed things up by not having the function call to OKI_Read and just put that line of code directly in the IRQ itself, yet when I add in "LINE A" and comment out "LINE B" I dont get any read requests anymore on the bus.
Would someone please enlighten me as to why this is & if you also have an idea why its taking 16ms to start this read would be helpful as well.
FYI, this is on the MOD5234, when I ran this on the MOD5270 it was smoking fast the read was virtually instant. The ONLY difference between these 2 boards is that the MOD5270 is talking to the chip using GPIO and the MOD5234 is using the address and data bus. I figured the address and data but method would smoke the GPIO way, but this is not the case.
//*************************************************************
//********************** GET DATA FROM OKI ***********************
//*************************************************************
BYTE OKI_Read(BYTE address)
{
return *( (unsigned char *)(CS3_ADDRESS + address));
}
//***************************************************************
//**************** OKI IRQ THAT DATA IS READY TO READ ****************
//***************************************************************
INTERRUPT(irq3_isr, 0x2300) // request to Read encoded audio
{
sim.eport.epfr |=0x08; // Clear This IRQ
BYTE x,y;
for(x=0;x<160;x++)
{
LINE A: y = *( (unsigned char *)(0x80000080));
LINE B: y = OKI_Read(0x80);
encoded_data[0] = y;
}
}