All Forums
 Microsoft Windows CE
 CE Sample Applications and Utilities
 eVC - ADSInterrupt
 Forum Locked  Topic Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 01 May 2003 :  16:20:24  Show Profile  Email Poster
ADSInterrupt Class and Sample


Notice of Deprecation
ADS has deprecated this code in favor of a driver-based approach. Please use the DIO driver for all new designs.


This class enables easy hooking of ADS system supplied external interrupts. The general method of use is to call Connect with the interrupt of interest (defined in ADSInterrupt.h), followed by Initialize with the handle of an event that you want the interrupt to set.

When handling the event, ensure you call Done as the interrupt will be *disabled* until Done is called().

Since ADSinterrupt is very hardware dependent, no compiled binary is included with the download.

Source Download
Rev 4 - May 20, 2003 (7k zip).

Key APIs Used

InterruptConnect
InterruptDisconnect
InterruptInitialize
InterruptDisable
InterruptDone
CreateEvent

Lines of Code: 342



Modified by ctacke 14-May-2003 Updated to Rev 3
Modified by ctacke 20-May-2003: Updated to Rev 4
Modified by akidder 14-Dec-2006: Add notification of deprecation.

ctacke

877 Posts

Posted - 14 May 2003 :  12:17:51  Show Profile  Email Poster
Feature Update

We've added the ability to use available SA1110 processor GPIOs as interrupt lines. Check your product's user manual to see what StrongARM GPIOs are available on the signal headers.
Go to Top of Page

ctacke

877 Posts

Posted - 17 Nov 2003 :  11:27:36  Show Profile  Email Poster
#AGX_IRQ

AGX Update

For this using the AGX, add the following declares to ADSInterrupt.h:



/////// INTERRUPT SIGNAL EDGE LEVEL LOGIC PIN
/////// ------------------ ---- ----- --------- -----
// AGX Rev 2

#define AGX_CARDAIRQ 77 // Y N NEGATIVE
#define AGX_CARDBIRQ 76 // Y N NEGATIVE
#define AGX_EXT_IRQ 67 // Y N BOTH J8.24

Note that the VGX EXT_IRQ line also uses IRQ 67.


Modified by akidder 17-Jan-2007: Add note about VGX EXT_IRQ.
Go to Top of Page

mfh

10 Posts

Posted - 10 Feb 2004 :  11:51:40  Show Profile
Are interrupts on the GPIOs suported on the AGX? Or is it only suported for the SA1110?

/Martin
Go to Top of Page

Moose

6 Posts

Posted - 20 Feb 2004 :  17:57:07  Show Profile  Email Poster
Has anybody used the EXT_IRQ3 on the BitsyX product yet?

I downloaded the code above.

Changed:
ADSInt.Connect(BITSY_PLUS_EXT_IRQ1, INTR_MODE_EDGE | INTR_MODE_NEGATIVE_LOGIC);

To:
ADSInt.Connect(BITSY_X_EXT_IRQ3, INTR_MODE_EDGE | INTR_MODE_NEGATIVE_LOGIC);

But, I never get an interupt when I toggle the line.

I have a Rev B. BitsyX board running "BitsyX Windows CE Ver.(4.10.28)"

Go to Top of Page

akidder

1519 Posts

Posted - 23 Feb 2004 :  14:04:20  Show Profile  Email Poster
BitsyX IRQ3 Not Available

The I/Os for EXT_IRQ3 are probably being used on your system to help prevent the SA-1111 interrupt issue (see this post for details).

You can spot the rework as a couple of wires on the underside of the board between the ball grid pads of the CPU, SA-1111 and the nearby CPLD.
Go to Top of Page

akidder

1519 Posts

Posted - 23 Feb 2004 :  14:19:16  Show Profile  Email Poster
Using PXA255 GPIOs for Interrupts

As with the StrongARM CPU, you can configure PXA255 GPIO lines for use as interrupt inputs. The first 32 PXA255 GPIOs are available for this purpose.

On the BitsyX, the ten "EIOn" lines are your best choice for CPU interrupts. On the AGX and VGX products, the choice of PXA255 inputs is more limited. If Serial 2 is configured for logic-level operation, you might be able to use its I/O lines. Where possible, use the CPLD's EXT_IRQ interrupt input.

With all interrupts coming into the PXA255, make sure that successive interrupts are spaced apart according to the PXA255 manual specifications.
Go to Top of Page

t0671dl

27 Posts

Posted - 10 Mar 2004 :  15:18:04  Show Profile  Email Poster
EXT3_IRQ3 on BitsyX

I noticed in BitX User Manual the following forum post:

>> Specification Change (Reworked Rev A Systems): Do not Connect to EXT_IRQ3
>>
>>"Do not connect any signals to BitsyX input EXT_IRQ3 (J10, pin 35) on Rev. A systems >>that have been reworked for the interrupt issue (above). The rework uses the CPLD port >>to which EXT_IRQ3 is connected. See above for details.
>>
>>Please contact ADS if this specification change affects your application."

Question: I have a BitsyX Rev 170115-000A. It does not appear to have the IRQ3 related rework done on the board. Does this board need the rework?

Secondly, if I cannot use EXT_IRQ3 what would you recommend for a device with a very slow ( 1 interrupt/250 msec ) interrupt rate? Not having an SMC Ethernet controller on my board, EXT_IRQ1 is available but it is a high priority IRQ and I would like to have minimal impact on the system.

Are there any special issues related to using the GPIO lines? I see a reference to "EIOn" lines. Can you tell me more?

Edited by - t0671dl on 10 Mar 2004 15:24:35
Go to Top of Page

ctacke

877 Posts

Posted - 21 Jan 2005 :  09:20:49  Show Profile  Email Poster
#Moving_to_DIO

Note

Moving forward, external interrupt support will be handled through the new DIO driver. This should provide a simpler, more intuitive mechanism to implement your own ISTs.
Go to Top of Page

ctacke

877 Posts

Posted - 14 Dec 2006 :  12:02:34  Show Profile  Email Poster
If you are using the ADSInterrupt code instead of the DIO driver, it is often useful to be able to mask or unmask the interrupt at runtime. The following updates add this capability:

Update the ADSInterrupt.h file to include the following:


class ADSInterrupt
{
...
private:
typedef VOID (*INTERRUPTMASK) (DWORD idInt, BOOL fDisable);
INTERRUPTMASK InterruptMask;
...
public:
void Mask();
void Unmask();
};


Then update the .cpp file as follows. You must add a block the ctor to load the InterruptMask function, then add the Mask and Unmask implementations.


ADSInterrupt::ADSInterrupt()
{
...

/////////////// InterruptMask ////////////////
DEBUGMSG(TRUE, (_T("InterruptMask =")));
InterruptMask = (INTERRUPTMASK)GetProcAddress(m_hBceddkDll,(L"InterruptMask"));
if(InterruptMask == NULL)
{
DEBUGMSG(TRUE, (_T("FAILED\\\r\\\n")));
return;
}
DEBUGMSG(TRUE, (_T("0x%08x\\\r\\\n"), InterruptMask));
}

///////////////////////////////////////////////////
// Mask
// Masks (temporarily disables) the interrupt
// [I] none
// [O] none
///////////////////////////////////////////////////
void ADSInterrupt::Mask()
{
if(!m_bConnected)
{
DEBUGMSG(TRUE, (_T("Mask failed - no interrupt is connected\\\r\\\n")));
return;
}

InterruptMask(m_hInterrupt, TRUE);
}

///////////////////////////////////////////////////
// Unmask
// Unmasks (enables) the interrupt after masking
// [I] none
// [O] none
///////////////////////////////////////////////////
void ADSInterrupt::Unmask()
{
if(!m_bConnected)
{
DEBUGMSG(TRUE, (_T("Unmask failed - no interrupt is connected\\\r\\\n")));
return;
}

InterruptMask(m_hInterrupt, FALSE);
}


Chris Tacke
OpenNETCF Consulting
Go to Top of Page

akidder

1519 Posts

Posted - 14 Dec 2006 :  12:32:54  Show Profile  Email Poster
#Notice_of_deprecation

Thanks, Chris. Please note that we will not be supporting this application or method of accessing interrupts moving forward. CE is moving away from user applications being able to access kernel functionality and hardware.

Please contact us if the DIO or other drivers do not meet your application requirements.

I have closed this topic for further discussion, but please contact us if you have further questions.
Go to Top of Page
  Topic  
 Forum Locked  Topic Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.05 seconds. Snitz Forums 2000