-----Original Message-----
From: John Dobbins [mailto:[email protected]]
Sent: Thursday, March 22, 2007 11:54 AM
To: EPICS Tech-Talk
Subject: vxWorks, IP-OCTAL-232, interrupt, and reboot
Dear All,
I am trying to create device support for doing data
acquisition that is
synchronous with the AC line. I happen to have an
IP-OCTAL-232 which has
some general purpose inputs which can be used to generate
interrupts so
I am using a pulser synchronized to the AC to trigger the IP-OCTAL.
I have installed the IP-OCTAL on an MVME-162 running VxWorks 5.4 and
EPICS 3-13-10. Everything appears to work in that the
interrupt handler
gets called (right now the interrupt handler simply clears the
interrupt source and increments a counter). However if I then type
"reboot" at the VxWorks console it hangs. If I first disconnect the
interrupt source (pulser) before typing "reboot" then it does
not hang.
Any ideas on what would prevent reboot from occurring?
Regards and thanks,
John Dobbins
Lab for Elementary Particle Physics
Cornell University
I am not currently using drvIpac though I copied from drvIpMv162.c :
This code sets up the interrupt:
int acClkSetup( ) {
int slot;
/* Initialise the IPIC chip */
for (slot = 0; slot < IPIC_SLOTS; slot++) {
ipic->intCtrl[slot][0] = IPIC_INT_ICLR;
ipic->intCtrl[slot][1] = IPIC_INT_ICLR;
ipic->genCtrl[slot] = IPIC_GEN_WIDTH_8;
}
/* using ipac interrupt request line 0 */
ipic->intCtrl[IP_OCTAL_IPIC_SLOT][0] = (AC_CLK_ILVL &
IPIC_INT_LEVEL)
| (ipic->intCtrl[IP_OCTAL_IPIC_SLOT][0] & ~IPIC_INT_LEVEL);
/* setup memory space for the ipac, interrupt vector goes into
memory space on MVME-162 */
ipic->memBase[IP_OCTAL_IPIC_SLOT] = 0x8000;
ipic->memSize[IP_OCTAL_IPIC_SLOT] = 0;
ipic->genCtrl[IP_OCTAL_IPIC_SLOT] |= IPIC_GEN_MEN;
/* install the interrupt handler */
if (intConnect(INUM_TO_IVEC(AC_CLK_IVEC), acClkMain, 0)
== ERROR) {
perror(" Unable to install AC clock interrupt handler\n");
return -1;
}
/* setup SCC2698 interrupt mask register */
*((char *)IP_OCTAL_IMRA_REG) = (char)IP_OCTAL_IMRA_VALUE;
/* ivec goes to first byte of ipac mem space */
*((char *)0x80000000) = (char) AC_CLK_IVEC;
/* setup Aux. Control Register */
*((char *)IP_OCTAL_ACRA_REG) = (char)IP_OCTAL_ACRA_VALUE;
/* enable interrupts on ipic */
ipic->intCtrl[IP_OCTAL_IPIC_SLOT][0] |= IPIC_INT_ICLR;
ipic->intCtrl[IP_OCTAL_IPIC_SLOT][0] |= IPIC_INT_IEN;
sysIntEnable(AC_CLK_ILVL);
printf(" Setup AC Clk Interrupt\n");
return 0;
}
the interrupt handler
unsigned int cnt = 0;
volatile char temp;
void acClkMain()
{
/* clear interrupt */
temp = *((char *)IP_OCTAL_ACRA_REG);
cnt++;
return;
}