240X128dot lcd having controller T6963C

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

I am working with 240x128dot LCD having controller T6963C interfaced with Atmega128A. I have attached the project below. It works ok with file LCD315ARO.c and LCD315ARO.h but does not display  anything while I use library T6963C or T6963CG. I have checked port and pins go high and low for particular task. but not able to find solution.

 

please guide me regarding this. It would be great help for me.

Attachment(s): 

Last Edited: Wed. Sep 15, 2021 - 05:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please use a zip file rather than a rar file to post.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

ok.

 

Here I am attaching Zip file

Attachment(s): 

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

Thanks, some people don't like opening .rar files. Also if you can a diagram of how you have things wired and maybe a photo.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thank you js for prompt reply.

but sorry,  I don't have picture of hardware with me right now.

But I am sure that there is some mistake at programing side only because it works ok with file LCD315AR0

 

 

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

Thank you for the support.

Issue of the string is solved. Anyone have idea about displaying graphics and image then please guide me.

 

thanks in advance

 

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

jhankhana wrote:
Issue of the string is solved.

For the benefit of others who may come along looking for answers to the same/similar issue, please describe what was the problem, and how you fixed it.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jhankhana wrote:
I use library T6963C or T6963CG

Please give details of those libraries; eg, links.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

YES agree.

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

There was a problem of inappropriate delay. Also, logic to make pins high and low for a particular task is being written in a less complicated manner.

 

Also, I forget to activate and deactivate 'data port'  in functions

 

the library is attached below.

 

Attachment(s): 

Last Edited: Fri. Sep 17, 2021 - 05:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Anyone has idea about displaying images or graphics then please guide me.

 

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

No,  I have not studied your particular libraries.

 

I just assume that they have functions for plotting pixels,  drawing lines, rectangles, circles, ...

You just have to search for the functions that you need.

 

GLCDs are monochrome.   Any bitmaps are fairly simple.   e.g. 8 pixels stored horizontally or 8 pixels vertically.

 

Adafruit-style bitmaps are stored msb -> lsb from left to right.

XBM bitmaps are stored lsb -> msb from left to right.

 

KS0108-style bitmaps will be stored vertically.

 

Most of these bitmap images are "raw" i.e. no width and height information.   Some have a small header.

 

Attach a typical image or bitmap that you want to display.    And say which library you want to use.

If you want extensive fonts, text, graphics, images, ... I suggest that you use U8g2lib library.    It is straight C code.   But can be used with a C++ class wrapper.

 

David.

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

Thank you david.prentice

Yes, function for plotting pixels, drawing lines, etc. but I am not able to understand why nothing is happing by calling those functions.

 

Before this, I worked with KS108b 128x64 GLCD. I converted the image in a monochrome bitmap using paint and then converted it into hax code with the help of LCD Assistant sequentially. 

But,  I don't know from where to start for displaying on this LCD

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

Just look at existing library functions.  e.g. from Adafruit_GFX.cpp

 

void Adafruit_GFX::drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
                              int16_t w, int16_t h, uint16_t color) {

  int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
  uint8_t byte = 0;

  startWrite();
  for (int16_t j = 0; j < h; j++, y++) {
    for (int16_t i = 0; i < w; i++) {
      if (i & 7)
        byte <<= 1;
      else
        byte = pgm_read_byte(&bitmap[j * byteWidth + i / 8]);
      if (byte & 0x80)
        writePixel(x + i, y, color);
    }
  }
  endWrite();
}

 

I would simply convert to your T6963C calls e.g.

void GLCD_DrawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h) {

  int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
  uint8_t byte = 0;

  for (int16_t j = 0; j < h; j++, y++) {
    for (int16_t i = 0; i < w; i++) {
      if (i & 7)
        byte <<= 1;
      else
        byte = pgm_read_byte(&bitmap[j * byteWidth + i / 8]);
      GLCD_SetPixel((x + i, y, byte & 0x80);
    }
  }
}

 

Untested.

 

David.

Last Edited: Wed. Sep 15, 2021 - 11:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much David,

I have one more silly question about pgm_read_byte(....)

I am using IAR embedded workbench IDE and it does not support avr/pgmspace.h. it shows an error as shown in the image attached.

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

Thank you so much David,

I have one more silly question about pgm_read_byte(....)

I am using IAR embedded workbench IDE and it does not support avr/pgmspace.h. it shows an error as shown in the image attached.

Attachment(s): 

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

Surely IAR just has __flash variables.   You don't need pgmspace.h

 

void GLCD_DrawBitmap(int16_t x, int16_t y, const __flash uint8_t bitmap[], int16_t w, int16_t h) {

  int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
  uint8_t byte = 0;

  for (int16_t j = 0; j < h; j++, y++) {
    for (int16_t i = 0; i < w; i++) {
      if (i & 7)
        byte <<= 1;
      else
        byte = (bitmap[j * byteWidth + i / 8]);
      GLCD_SetPixel((x + i, y, byte & 0x80);
    }
  }
}

 

Sorry,  just guesswork.   I can't be bothered to look up the IAR syntax.

 

Edit.   Why are you using IAR ?   It seems like a waste of $5000.   You will get very little support and need to port all the public domain GCC projects.

Last Edited: Wed. Sep 15, 2021 - 11:36 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much David 

unfortunately, it's not working but thank you for the effort and kind help

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

I am using 240x128dot LCD having controller T6963C  interfaced with AtMega128A and using IAR embedded workbench IDE. Anyone has an idea about displaying graphics and images then please guide me. 

 

thanks in advance

 

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

Well,  I only have a 128x64 display.  And do not have a $5000 IAR licence.

 

I can show bitmaps on my screen with the http://en.radzio.dxp.pl/t6963/  library if I modify the T6963C delay() function.  e.g.

void delay(void)
{
    _delay_us(8);
/*
    volatile unsigned char i;
    for(i = 0; i < (F_CPU/1000000); i++)
    {
        asm("nop");
    }
*/
}

 

The original function might work on IAR but it certainly does not work on a 16MHz ATmega128.

Yes,  the code in #18 has unmatched parentheses.

      GLCD_SetPixel((x + i, y, byte & 0x80);
 

If you have a compile problem,  you should paste the relevant error message.   It is not much good just saying it's not working

 

Why are you using IAR ?

 

David.

 

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

Using IAR is not my choice buddy.

 

I apologize if I have said something not inappropriate.  

I am not export in using IAR and even I except that I am not able to solve it by myself. That's why I am asking for help.  

 

It does not show any error so that I can search. There is no error and the display shows exclamatory marks at some random places. 

Please guide me on how I can solve it.

 

 

 

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

I didn't understand about code in #18....

please explain me 

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

jhankhana wrote:

Using IAR is not my choice buddy.

 

I apologize if I have said something not inappropriate.  

I am not export in using IAR and even I except that I am not able to solve it by myself. That's why I am asking for help.  

 

It does not show any error so that I can search. There is no error and the display shows exclamatory marks at some random places. 

Please guide me on how I can solve it.

 

If your employer or school insists that you you use IAR,  just say so.  Not many people on this Forum possess a $5000 IAR licence.

And this might be the reason why they insist on IAR.   i.e. to discourage assistance from any Forum.

 

Displaying a bitmap image is incredibly simple.   What do you not understand about

 

void GLCD_DrawBitmap(int16_t x, int16_t y, const __flash uint8_t bitmap[], int16_t w, int16_t h) {

  int16_t byteWidth = (w + 7) / 8; // Bitmap scanline pad = whole byte
  uint8_t byte = 0;

  for (int16_t j = 0; j < h; j++, y++) {
    for (int16_t i = 0; i < w; i++) {
      if (i & 7)
        byte <<= 1;
      else
        byte = (bitmap[j * byteWidth + i / 8]);
      GLCD_SetPixel(x + i, y, byte & 0x80);  //removed the extra left parenthesis
    }
  }
}

 

In fact the function is so small that it should be possible to build with the free Evaluation IAR.

 

So if you explain the "must use IAR" situation,  I might install an Evaluation IAR and step you through the whole procedure.

The first job is to choose library T6963C or T6963CG.   You can't mix both libraries.

 

Having chosen one library,  you should write simple programs to draw a circle, print some text etc.

Post your successful circle or text program.   i.e. show that you have learned how to use your chosen library.

 

David.

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

jhankhana wrote:
I am not export in using IAR and even I except that I am not able to solve it by myself. That's why I am asking for help.  

One of the key things you spend the $$$ on IAR is for support from IAR - so you should be going to IAR for help with their product.

 

https://www.iar.com/support/

 

If it's your employer or school that mandates IAR, why not ask your colleagues/boss/teachers for help?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you so much, buddy

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

Ok. Thank you