Serial timing for touch screen controller

Discussion in 'Embedded Systems and Microcontrollers' started by Razor Concepts, Jun 30, 2010.

  1. Razor Concepts

    Thread Starter Active Member

    Oct 7, 2008
    212
    1
    I am going to use a touch screen controller, an ADS7843, with a microcontroller. Here is the serial timing diagram:
    http://i49.tinypic.com/io3vi1.png
    [​IMG]

    Could somebody check my pseudocode and see if I have the right idea?

    Code ( (Unknown Language)):
    1.  
    2.  
    3. low CS                  //begin communication
    4. while busy is high, wait        //wait for chip to start up
    5.  
    6. for(int i = 0; i < 7; i++)      //send command byte
    7. {
    8. send data through DIN
    9. high DCLK
    10. low DCLK
    11. }
    12.  
    13.  
    14. high DCLK               //dummy cycle
    15. low DCLK
    16. while busy is high, wait        //wait for chip to finish conversion
    17.  
    18.  
    19. for(int i = 0; i < 11; i++)     //read x or y data over 12 cycles
    20. {
    21. high CLK
    22. read data from DOUT
    23. low CLK
    24. }
    25.  
    26. for(int i = 0; i < 3; i++)      //finish up last three cycles, optional
    27. {
    28. high CLK
    29. low CLK
    30. }
    31.  
    32. high CS                 //end communication
    33.  
     
Loading...