Touch screen PENIRQ problems with AD7843

Greetings fellow embedded systems colleagues -

I have a new Atmel ARM9 based design, connected to an AD7843 touch screen controller. The problem is the !PENIRQ line *NEVER* changes state when the panel is pressed. Looking at it on an analog scope, it never even tries to budge. If it were a pullup/pulldown issue, I would fully expect it to come down at least a little from the 3.3 volt rail, but it just stays steady the whole time.

I'd like to talk to someone who has some experience with the AD7843 and see what I'm missing. To date, we have done the following:

  • Ensured the !PENIRQ is connected to the CPU and to the AD7843 (we can wiggle it when set to an output, and can see that it gets driven low when we manually ground it)

  • Used small (50kohm) and large (100kohm) pullup resistors on the !PENIRQ line

  • Tried setting PD to 00 and 10, which SHOULD enable !PENIRQ's operation

  • Verified that we can read both the X and Y axis on the touch screen (this works perfectly!) - we get all 12 bits of precision on both axes.

  • Serial/differential mode makes no difference

  • Running SPI bus at 4Mhz, 2Mhz, and 1Mhz (even bit banging it at a Neil

Reply to
Neil Bradley
Loading thread data ...

d.

Since you can't seem to determine if it's a software or hardware issue, you should try a simple test:

  1. Remove any code that would cause the AD7843 chip-select to be asserted.
  2. Ensure the microcontroller pin connected PENIRQ is configured as input.
  3. Monitor the PENIRQ line with a 'scope while touching the touch screen.

If the PENIRQ line still remains high, it is most likely a hardware issue. If it goes low (my guess), it is most likely a software issue.

Reply to
Dingo

Thanks for the reply, Dingo.

The AD7843 needs to be programmed up to drive the PENIRQ, and I mentioned before that I had tried both possible settings for it. Not allowing !CS would surely make PENIRQ not work. Plus, the code doesn't poll the 7843 unless PENIRQ gets asserted anyway.

Yeah, already did that:

We know the line works.

Did that, too (that's how we'd know if the signal dipped or not), including triggers. We could manually cause the scope to trigger if we grounded the pin.

The real problem is the AD7843 is just flatly not pulling the pin low. We've also disconnected the 7843 from the CPU just in case there was some oddball backpowering going on, and it had no effect, either.

-->Neil

Reply to
Neil Bradley

=46rom the datasheet: "On power-up, PD0 defaults to 0, while PD1 defaults to 1."

And: "This configuration results in keeping the AD7843 permanently powered up with PENIRQ enabled."

So PENIRQ is automatically enabled at power-up.

I think it would be quite valuable to test the behavior of PENIRQ before software configures the AD7843.

Reply to
Dingo

You know, I'm from the school of always initializing everything so it starts to a known state. In all my testing, I never thought to try this, but that makes a LOT of sense.

Dingo, you are the man. Thanks for the friendly nudge. It's possible that the initial SPI traffic is screwed up, like CPOL or whatever is half a phase off, and the command I'm sending to the chip isn't really what I think it is.

Will let you know... thanks again!

-->Neil

Reply to
Neil Bradley

I just perused the AD7843 datasheet; according to the 2nd paragraph on page 19, PENIRQ is enabled by default on power-up, so it is almost certain that your first write to the device is clobbering PD0/1, likely due to an SPI phase mismatch.

I just had this happen to me with an Analog Devices ADC; reading of the SPI timing diagrams implied a particular phase/polarity; the device only worked when I reversed them.

--Gene

Reply to
Gene S. Berkowitz

....

Datasheets don't you just love them.

My current favourite is a NXP/Philips data sheets that goes on about two types of input to the device being straight digital and schmitt input with different characteristics. NOWHERE in the data sheet does it specify WHICH inputs are which type! Search for schmitt in the datasheet only gives the input definition (electrically).

NXP support gives glib answers and still has no answer months later!

-- Paul Carpenter | snipped-for-privacy@pcserviceselectronics.co.uk PC Services Timing Diagram Font GNU H8 - compiler & Renesas H8/H8S/H8 Tiny For those web sites you hate

Reply to
Paul Carpenter

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.