• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Other Analog & Touch » Touch » Touch Forum » Can't get readings and PENIRQ getting down with ADS7843
Share
Touch
  • Forum
  • E2E Wiki
Options
  • Subscribe via RSS
Check out
Analog Wire blog
  • $core_v2_blog.Current.Name

    This amplifier doesn't exist...now what!?

    Posted 1 day ago
    by Xavier Ramus
    Sometimes it’s impossible to find an amplifier with the...
  • $core_v2_blog.Current.Name

    Cable equalization 101 – Automating your design

    Posted 3 days ago
    by Hooman Hashemi
    Judging by the number of views on a post related to numerical...
  • $core_v2_blog.Current.Name

    RS-485 - Who says you can't teach an old dog new tricks?

    Posted 7 days ago
    by Neel Seshan
    Would you agree that RS-485 has turned out to be one of the most...

Forums

Can't get readings and PENIRQ getting down with ADS7843

This question is answered
COULON Laurent
Posted by COULON Laurent
on Jan 25 2012 15:43 PM
Prodigy80 points
logic screen captures.zip

Hello,


May i ask assistance, i'm getting trouble to get a ADS7843 working with a Pic 18F97J60

I can't read X and Y positions, and PENIRQ won't get down.

Here is the schematic i use :

With no software running and No Touch i get the following voltages :

X+ = 2.28V    X- = 2.30V     Y+=0V     Y- = 0V

With no software running + Touch i get the following voltages : ( maybe an issue there ? )

X+ = 0V    X- = 0V     Y+=0V     Y- = 0V

The measured resistance between pins are :

X+ and X - = 415 ohms

Y+ and Y- = 555 ohms.

--------------------------------------------------------------------------------

First, i try to init the ADS7843 with the following function :

I need to use PENIRQ pin, so at the end of the init function i send (0xD0) in order to set the power down mode and get PENIRQ enabled. ( i'm not sure its the proper way to proceed )

#define ADS7843_SPICON1_CFG  (0x21)        /* (0x2x) is used for SPI mode 0,0  */
// 0x21 => Fosc/16 -> SCK frequency : 40/16 = 2.50 Mhz

...

void Init_ADS7843(void)
{
// Configure PENIRQ pin
    Touch_PenIRQ_TRIS = 1;                        // Touch_PenIRQ is input

    // Set up the SPI module on the PIC for communications with the ADS7843 :
    ADS7843_CS_IO = 1;                            // Disable ADS7843 CS pin
    ADS7843_CS_TRIS = 0;                         // Pic CS pin is output
                    
    ADS7843_SCK_TRIS = 0;                          // Set SCK pin as an output
    ADS7843_SDI_TRIS = 1;                          // Make sure SDI pin is an input
    ADS7843_SDO_TRIS = 0;                        // Set SDO pin as an output

    ADS7843_SPI_IF = 0;                            // Clear SPI Flag

    ADS7843_SPISTATbits.CKE = 0;                 // Transmit data on transition from Idle to Active clock state
    ADS7843_SPISTATbits.SMP = 0;                 // Input sampled at middle of data output time

    Delay10us(1);
    
    ADS7843_read(0xD0);                            // Send a read sequence in order to activate PENIRQ (PD1 and PD0 = 0)
}

Here is my reading function :

unsigned short int ADS7843_read(unsigned char address)
{
    volatile BYTE Dummy;    
    unsigned char msb, lsb;
          
    ADS7843_CS_IO = 0;                                // Enable CS
    ADS7843_SPI_IF = 0;                               // Clear SPI Flag

    _asm        NOP        _endasm                    // Add delay after CS goes low (0.1 µs = 100 ns)

    ADS7843_SSPBUF = address;                        // Transmit Start bit ( SSP1BUF )
    while(!ADS7843_SPI_IF);ADS7843_SPI_IF = 0;      // Wait until data is shifted out
    Dummy = ADS7843_SSPBUF;                            // Reading SSPBUF clears SPI Buffer
       

    ADS7843_SSPBUF = 0x00;                            // Send dummy value (0x00) in order to get the FIRST 8 bit byte
    while(!ADS7843_SPI_IF);ADS7843_SPI_IF = 0;      // Wait until data is shifted out
    msb = ADS7843_SSPBUF;                              // Get the FIRST 8 bit byte ( 8 clock edges )
       
    ADS7843_SSPBUF = 0x00;                            // Send dummy value (0x00) in order to get the SECOND 8 bit byte
    while(!ADS7843_SPI_IF);ADS7843_SPI_IF = 0;      // Wait until data is shifted out
    lsb = ADS7843_SSPBUF;                              // Get the SECOND 8 bit byte ( 8 clock edges )
       
    ADS7843_CS_IO = 1;                                // Disable CS
   return ((msb << 8) | lsb) >> 3;                 // Put the result in 16 bits : msb goes right and add the lsb
}

From the main loop of the program i check if PENIRQ goes low, then i read X and Y positions afterwards.

   while(1)
    {

     if (Touch_PenIRQ_IO == 0)        
        {
        PEN_X_pos = ADS7843_read(0x90);
        PEN_Y_pos = ADS7843_read(0xD0);
        }

Here are attached 2 logic SPI screen captures :

- One is without Touch :

During Init_ADS7843 and later during ADS7843_read for X and Y positions :

MISO is not getting any response back  to 0xD0 sent previously.

- Second one is when a Touch happens :

During Init_ADS7843 and later during ADS7843_read for X and Y positions :

MISO is not getting any response back to 0x90 and 0xD0 sent previously and PENIRQ stays high and won't get low !

Any help will be much appreciated,

Best regards,

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Wendy Fang
    Posted by Wendy Fang
    on Jan 26 2012 10:51 AM
    Genius9725 points

    Hi COULON,

    From the schematic, I could not see how the ADS7843 is powered, that is: how the ADS7843 pins 1, 10 and 6 are connected. I  concern about it  because: at normal condition, when No SW running and no touch, the 4 analog pins should be: X+ = X- = Vcc;  Y+ = Y- = GND, but you stated that you measured X+ ~= X- < Vcc.

    The second concern is at the SPI DCLK polarity (CPOL) and phase (CPHA), please also refer to Table VI and Figure 7at page 10 of the ADS7843 data-sheet. At ADS7843 CPOL=CPHA=0, where data lines (DIN and DOUT) change/write at the falling edge of the DCLK; and a bit at DIN or DOUT is latched/read (and thus must be kept stable) at the rising edge of the DCLK. From the SPI waveform you provided, it seems that you had CPOL=0 and CPHA=1. Please check to match ADS7843 SPI requirement.

    Thanks,
    Wendy F.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • COULON Laurent
    Posted by COULON Laurent
    on Jan 26 2012 17:05 PM
    Prodigy80 points

    Thanks, Wendy.

    I confirm the chip is powered with pin 1 & 10 = 3.3V and pin 6 is grounded.

    When you say X+ = X- = Vcc and Y+ = Y- = Gnd, do you mean the touch panel has to be connected to the ADS7843 chip or these measurements should be done directly on the chip without the touch panel connected to it ?

    With no touch panel connected to the chip and no software running, just the 100K pull up resistor connected to PENIRQ and Vref pin connected to Vcc,

    i confirm that i still having X+ ~= X- ~= 2.3V

    Is this voltage not enough, should it be exactly 3.3V ?

    Are there some further tests i should do to confirm the chip is not defect ?

    Many thanks for your help,

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wendy Fang
    Posted by Wendy Fang
    on Jan 26 2012 17:12 PM
    Genius9725 points

    Hi COULON,

    Thanks for the info!

    It seems some problem with the panel and ADS7843 connection. What I mean is the touch panel and ADS7843 are connected. The connection should be as simple, as short, as secure as possible, to reduce noise and malfunction of the whole touch system.

    Regards,
    Wendy F.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • COULON Laurent
    Posted by COULON Laurent
    on Jan 27 2012 00:18 AM
    Prodigy80 points

    What voltages should i found on X+ X- Y- Y+ when the touch panel is not connected to the ADS7843 ?

    At the moment, with no touch panel connected andno software running, i get :

    X+ (pin 2 ) = 2.28V  ; Y+ (pin3) = 0V ; X- (pin4) = 0V ; Y- (pin5) = 0V

     

    If i keep the touch panel disconnected and i remove R22 ( PENIRQ pull up resistor ), then i get all voltages = 0V

    X+ (pin 2 ) = 0V  ; Y+ (pin3) = 0V ; X- (pin4) = 0V ; Y- (pin5) = 0V

     

    I need to confirm the chip is working fine with no touch panel connected, would you please tell me if these measurments are correct ?

    If they are not, maybe ADS7843 chip has been damaged and needs to be replaced ?

    Many thanks,

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wendy Fang
    Posted by Wendy Fang
    on Jan 27 2012 07:38 AM
    Genius9725 points

    Hi COULON,

    A 4-wire resistive touch panel, if not connected to the controller, can be measured with an ohmmeter --

    Without touch:

    X+ to X- (or Y+ to Y-): 200ohms ~ 1000ohms

    X+ (or X-) to Y+ or Y-): infinite or hundreds Mohms

    With touch:

    X+ to X- (or Y+ to Y-): 200ohms ~ 1000ohms (exact the same as that without touch)

    X+ (or X-) to Y+ or Y-): some 100s ohms to some 1000s ohm, decided by pressure on the panel, stronger pressure results in lower ohms.

     

    After connecting touch panel to the controller, you may then use a voltsmeter to measure the analog interface to make sure the connection is good:

    Without touch and without SW running:

    X+ = X- = Vcc (the /PENIRQ is enabled)

    Y+ = Y- = GND.

    With touch and without SW running:

    X+ = X- = Y+ = Y- = GND.

    Hope the above info help with your debugging!

    Regards,
    Wendy F.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • COULON Laurent
    Posted by COULON Laurent
    on Jan 27 2012 17:25 PM
    Prodigy80 points

    I do confirm i've measured the values you stated in your last post, this means my touch panel is working properly.

     

    For now, it looks i have an issue with the ADS7843 init function :

    Here is the logic capture for my init sequence : i send 0xD0 in order to enable PENIRQ , ADS7843 responds 0x10 ( i don't know why i get this value back because there was no touch on screen yet )

    Afterwards, reading X and Y pos always return 0xFF for MSB and LSB whatever there was a touch on the screen or not.

     

    - Do you confirm it is mandatory to enable PENIRQ during an init sequence, i've found that at the power-up of the ADS7843 PENIRQ is already staying high when there is no touch on the screen and goes low when a touch occurs.

     

    - Once the software init function has been ran, then PENIRQ no longer responds ( always stays high ) even a touch has been done on the screen.

    I've tried to change R penirq value : 10K, 47K, 100K ohms but the problem remains ! 

     

     Is there something to be done to fix PENIRQ problem ?

     I've read your article :  http://www.ti.com/lit/ml/slyt292/slyt292.pdf but i did not find the solution yet.

     

    - My SPI settings are CPOL  = 0 and CPHA = 0, SCK speed is 650 khz

     Can you tell me SMP setting should be ?

     

    Many thanks for your help,

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • COULON Laurent
    Posted by COULON Laurent
    on Jan 30 2012 14:29 PM
    Prodigy80 points

    I got the readings working but results exceed 12 bit resolution (4096)

     

    This is calculation i use in order to get MSB and LSB :

    I send 0x90 or 0xD0 and send twice 0x00 in order to get MSB and LSB

    then i shift the msb 8 rows left and add lsb, shift this calculation 3 rows right:

    return ((pen_msb << 8) + pen_lsb) >> 3;

    Do you confirm it is correct way to proceed ?

     

    Many thanks for your help,

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wendy Fang
    Posted by Wendy Fang
    on Jan 31 2012 15:34 PM
    Genius9725 points

    I checked our EVM firmware, where it is:  return (((pen_msb & 0x7F) << 8) + pen_lsb) >> 3;

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Wendy Fang
    Posted by Wendy Fang
    on Feb 22 2012 09:38 AM
    Verified Answer
    Verified by Wendy Fang
    Genius9725 points

    COULON,

    Had the issure been resolved? Anything may we help further?

    Regards,
    Wendy F.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use