Issue displaying images on SSD1289 TFT

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am posting to the AVR Freaks because I believe my issue relates to general programming rather then the platform I am running my project on (SAMD21).

 

I've been porting my TFT library over from Arduino and the library now supports SSD1963, ILI9325 & the SSD1289. All is working well expect for displaying images on the SSD1289. For some reason, the images don't fully load.

 

tft

With most of these TFTs the only thing that changes is the commands. So displaying an image should be the same. Here is my code:

 

sam_load_raw_image_mem(1,1,72,72, mushroom, sizeof mushroom);

void sam_load_raw_image_mem(int x1, int y1, int imgX, int imgY, const uint16_t *img, int size)  {

    sam_clearCs();

    sam_setXY(x1, y1,(imgX + x1) -1, (imgY + y1)-1);

    for (long y = 0; y < size; y++) {

        sam_writeData((img[y] >> 8), img[y]);
    }

    sam_setCs();
    sam_clrXY();

}

void sam_setXY(int x1, int y1, int x2, int y2)
{
    if (tft_conf.orient == LANDSCAPE)
    {
        swap(int, x1, y1);
        swap(int, x2, y2)
        y1 = tft_conf.height - y1;
        y2 = tft_conf.height - y2;
        swap(int, y1, y2)
    }

    if(tft_conf.tft_model == ILI9325D_8 || tft_conf.tft_model == ILI9325D_16 ){

        sam_writeComData(0x20, x1);
        sam_writeComData(0x21, y1);
        sam_writeComData(0x50, x1);
        sam_writeComData(0x52, y1);
        sam_writeComData(0x51, x2);
        sam_writeComData(0x53, y2);
        sam_writeCom(0x22);

    } else if(tft_conf.tft_model == SSD1963_480){

        swap(int, x1, y1);
        swap(int, x2, y2);
        sam_writeCom(0x2a);
        sam_writeByteData(x1>>8);
        sam_writeByteData(x1);
        sam_writeByteData(x2>>8);
        sam_writeByteData(x2);
        sam_writeCom(0x2b);
        sam_writeByteData(y1>>8);
        sam_writeByteData(y1);
        sam_writeByteData(y2>>8);
        sam_writeByteData(y2);
        sam_writeCom(0x2c);
    }	else if( tft_conf.tft_model == SSD1289){

        sam_writeComData(0x44,(x2<<8)+x1);
        sam_writeComData(0x45,y1);
        sam_writeComData(0x46,y2);
        sam_writeComData(0x4e,x1);
        sam_writeComData(0x4f,y1);
        sam_writeCom(0x22);

    }	

}

void sam_writeData(uint8_t vh, uint8_t vl) {

    sam_setRs();
    switch(tft_conf.tft_model){

        case ILI9325D_8:
        sam_writeBus(vh, vl);
        break;
        case ILI9325D_16:
        case SSD1963_480:
        case SSD1289:
        sam_write16ToTFT(vh,vl);
        sam_pulseBitLow();
        break;
        default:
        printf("Device not recognized\n\r");
        break;
    }
}
void sam_write16ToTFT(uint8_t vh, uint8_t vl){

	REG_PORT_OUTCLR1 = PORTBMASK_16;
	REG_PORT_OUTSET1 = ( ((vl | (vh) << 8)) & 0xFFFF);
}

 

The function

sam_load_raw_image_mem

works for the SSD1963 and ILI9325, but cuts off the image on the SSD1289. Any help is much appreciated.

 

This topic has a solution.

"When all else fails, read the directions"

Last Edited: Fri. Dec 29, 2017 - 01:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am posting to the AVR Freaks because I believe my issue relates to general programming

But there is also a "general programming " forum for ARM where this has now moved to. wink

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

js wrote:
ut there is also a "general programming " forum for ARM where this has now moved to.

25 post and 79 replies? 

"When all else fails, read the directions"

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Finally went back to this issue. The SSD1989 only likes 3.3v, unlike the SSD1963. So vcc, RD and LED_A all need to b 3.3v

 

 

"When all else fails, read the directions"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The SSD1963 is a 3.3V device.  Just like every other TFT controller.

The maximum voltage is +4.6V according to the datasheet.

The recommended operating conditions are typical 3.3V.   (Min 1.65V max 3.6V)

I am amazed by how many Silicon chips survive the "Arduino mentality" and for how long.

Having said that,   I happily confess to overclocking Xmega @ 3.3V.   And running ATmega328P @ 3.3V and 16MHz.    Not wise for a commercial product but 100% successful for a hobbyist.

I see nothing wrong in faster clocking at room temperature and permitted voltage.    Exceeding the voltage seems unwise even for a hobbyist.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
The SSD1963 is a 3.3V device.  Just like every other TFT controller.

You are correct sir and I should know better. 

"When all else fails, read the directions"