This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ili9325 drive 8 bit interface with nrf51822

I have this 2,4" TFT Display with a IL9325 driver! I need to implement a 8bit 8080 Parallel interface.

image description

This is my 8 bit write function:

// Write 8-bit value data lines

void write8(uint8_t data) { 
nrf_gpio_pin_write(pinDataHold.TFT_D7, ((data & 10000000) >> 7)); 
nrf_gpio_pin_write(pinDataHold.TFT_D6, ((data & 01000000) >> 6)); 
nrf_gpio_pin_write(pinDataHold.TFT_D5, ((data & 00100000) >> 5));
nrf_gpio_pin_write(pinDataHold.TFT_D4, ((data & 00010000) >> 4)); 
nrf_gpio_pin_write(pinDataHold.TFT_D3, ((data & 00001000) >> 3)); 
nrf_gpio_pin_write(pinDataHold.TFT_D2, ((data & 00000100) >> 2)); 
nrf_gpio_pin_write(pinDataHold.TFT_D1, ((data & 00000010) >> 1)); 
nrf_gpio_pin_write(pinDataHold.TFT_D0, data & 00000001); 
WR_STROBE();
nrf_delay_ms(1); 
}

========================================

Is there any problem with this function? What I do is write the values to the pins and then make the LCD read the pins.

Parents
  • This post is old but for the next user...   The above approach is technically correct .  You have to put the CS and  WR bytes low before sending the data to the TFT  and high, after.   Using NRF_GPIO  OUTCLR  and OUTSET is a better approch.   They set selected pins of GPIO register in one command.

    uint8_t data = (c >> 2) | ((c & 0b00000011) << 6);  //  If needed, teorganise your  bytes order corresponding to the TFT pin out if need. Here is for pin D0.. D7 => Pin 19, 20, 13, 14, 15,16, 17,18  

    NRF_GPIO->OUTCLR = (0xFF << 13); //Erase the region, OUTCLEAR Write: writing a '1' sets the pin low; writing a '0' has no effect
    NRF_GPIO->OUTSET = (data << 13);  //Send data on selected pin, OUTSET Write: writing a '1' sets the pin high; writing a '0' has no effect
Reply
  • This post is old but for the next user...   The above approach is technically correct .  You have to put the CS and  WR bytes low before sending the data to the TFT  and high, after.   Using NRF_GPIO  OUTCLR  and OUTSET is a better approch.   They set selected pins of GPIO register in one command.

    uint8_t data = (c >> 2) | ((c & 0b00000011) << 6);  //  If needed, teorganise your  bytes order corresponding to the TFT pin out if need. Here is for pin D0.. D7 => Pin 19, 20, 13, 14, 15,16, 17,18  

    NRF_GPIO->OUTCLR = (0xFF << 13); //Erase the region, OUTCLEAR Write: writing a '1' sets the pin low; writing a '0' has no effect
    NRF_GPIO->OUTSET = (data << 13);  //Send data on selected pin, OUTSET Write: writing a '1' sets the pin high; writing a '0' has no effect
Children
No Data
Related