søndag den 6. november 2011

The Touch

As I have previously alluded to, the MCB1700 (mine at least) is in fact equipped with a touch screen. It is plainly visible when you inspect the kit, but there is absolutely no mention of the fact in Keil specifications for the kit. On closer inspection (you will need a screwdriver) you find that there is a controller chip mounted on the LCD board. I suspected that Keil might have different evaluation boards using the exact same LCD board, why else mount a controller chip.

And sure enough, if you start on their Cortex-M Evaluation Board Comparison, you will note that they have two boards equipped with "LCD-TFT", MCB1750 and MCB1760, or generically MCB1700. As you can see, no mention of a touch controller. Curiously Keil also have four (actually only three) boards equipped with "QVGA" (the LCD-TFT on the MCB1700 is also QVGA). The specifications for two of these boards mention the touch controller (the link from Keil is dead, ST probably killed it...), but I'll be surprised to find that the LCD board is not exactly the same on all of these evaluation boards, including MCB1700:


All it takes hardware wise to get the touch controller connected on the MCB1700 board is two wires for the I2C signals SCL and SDA. I connected them to P0.19 and P0.20 which were conveniently available. Here is a shot with the wires.


Get the Keil tools, if not for the tools, then for the example code alone. It is a large download but it contains lots of useful examples not just for the touch controller on the MCBSTM32. The touch controller code from MCBSTM32 examples is easily modified for the MCB1700, and you can build from there. This is what I am currently doing.

2 kommentarer:

  1. Dear can you share this code example for me ,please ? thank you very much
    i want used touch ,but P0.20 no clk out
    my code
    void I2C1Init( void )
    {
    LPC_SC->PCONP |= (1 << 19);
    LPC_SC->PCLKSEL1 |= ((0x0<<6)|(0x1<<7));
    LPC_PINCON->PINSEL1 &= ~((0x3<<6)|(0x3<<8));
    LPC_PINCON->PINSEL1 |= ((0x3<<6)|(0x3<<8));
    LPC_PINCON->PINMODE1 &= ~((0x3<<6)|(0x3<<8));
    LPC_PINCON->PINMODE1 |= ((0x2<<6)|(0x2<<8));
    LPC_PINCON->PINMODE_OD0 |= ((0x1<<19)|(0x1<<20));
    LPC_I2C1->I2CONCLR = I2CONCLR_AAC | I2CONCLR_SIC | I2CONCLR_STAC | I2CONCLR_I2ENC;
    LPC_I2C1->I2SCLL = I2SCLL_SCLL;
    LPC_I2C1->I2SCLH = I2SCLH_SCLH;
    NVIC_EnableIRQ(I2C1_IRQn);

    LPC_I2C1->I2CONSET = I2CONSET_I2EN;
    }

    SvarSlet
  2. Hi I am sorry that I did not reply right away, I have my head wrapped around something else at the moment. I seem to recall something about enabling pull-ups for the pads that I use for the touch, but I am not at all sure of that. I will compare my config to yours and get back to you later.

    SvarSlet