Author |
Topic |
|
nghia
36 Posts |
Posted - 19 Sep 2003 : 15:14:47
|
Hi,
In Bitsy Plus connector board /EXT-IRQ1 is used for Ethernet SMC 911 controller. I use /EXT-IRQ2 (disable USB interface) to capture fast data line and we lost some data because IRQ1 (higher priority) is occurred during the IRQ2 ISR.
How do I change the priority of the external Interrupts (IRQ1..IRQ3) ? or are there some interrupt which is higher priority than /EXT-IRQ1 ?
Thanks. Nghia |
|
whuh
23 Posts |
Posted - 22 Sep 2003 : 12:39:01
|
Nghia,
Could you give us more detail for better supports? How do you handle interrupt? (Could you show some part of source code?) How high is your thread priority to process your captured data? Does Ethernet have heavy traffic when experienced data loss?
More detail will be helpful.
WH |
|
|
nghia
36 Posts |
Posted - 22 Sep 2003 : 15:42:41
|
I use a interrupt class object CBitsyInterrrupt from ADS, following code shows how do I create interrupt thread:
BOOL CBitsyInterrupt::mCeHookInterrupt( void ) { DWORD dwThreadID = 0; m_bStopThread = false; bool bOk;
// connect the Bitsy EXT_IRQ2, Level Connect(BITSY_PLUS_EXT_IRQ2, INTR_MODE_LEVEL | INTR_MODE_NEGATIVE_LOGIC);
// initialize it to fire my event if(Initialize() != 0) { #if PRINT_DBG RETAILMSG (TRUE, (L" FAILED: Cannot initialize interrupt 0x% 08x\r\n",m_hIntEvent )); #endif mReleaseResource(); return false; }
// start a thread to handle the interrupt events (IST) bOk = m_pInterruptThread->Create(); if ( !bOk ) { mReleaseResource(); return false; } m_pInterruptThread->SetPriority(THREAD_PRIORITY_TIME_CRITICAL);
return TRUE; } void CBitsyInterrupt::CIsrThread::Run() { LOOP_FOREVER { // signalled when interrupt occurs WaitForSingleObject(m_pOwner->m_hIntEvent, INFINITE);
// clear interrupt state for next time m_pOwner->Done(); // exit loop if not running any more if (m_pOwner->m_bStopThread) break;
if (CeInf.m_CeStOrUIsr == ISDN_U_ISR) P2000ISDNUIsr(NULL); else if( CeInf.m_CeStOrUIsr == ISDN_ST_ISR ) P2000ISDNSTIsr(NULL); } }
the interrupt ISR is working fine, but sometime we lose a capture data (with data rate 500us/byte). And we trigger the /EXT-IRQ1, /EXT-IRQ2 and /RD-WR signals on the oscilloscope then we saw : when the IRQ1 occurs the same time or during the ISR2 then it delayed (~ 1 - 2 ms :maybe to serve a ISR1) to read a data.
Now we want to set a IRQ2 so that it has higher priority than IRQ1, Can we do that ? or do you have any solution ?
Thanks, Nghia
|
|
|
whuh
23 Posts |
Posted - 22 Sep 2003 : 16:05:52
|
Nghia,
Try with m_pInterruptThread->SetPriority(110);
At first, SetPriority should call CeSetThreadPriority() instead of SetThreadPriority(). CeSetThreadPriority() can set full range of CE priority (0~255). Network driver has higher priority than your current setting, THREAD_PRIORITY_TIME_CRITICAL.
I hope this helps. WH
|
|
|
nghia
36 Posts |
Posted - 02 Oct 2003 : 11:02:09
|
Whuh,
I try and It is working now.
Thank for your support. Nghia |
|
|
|
Topic |
|
|
|