CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Repetitive pattern on GLCD
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

Repetitive pattern on GLCD
PostPosted: Thu Feb 02, 2017 9:09 am     Reply with quote

Hello;

I am using a PIC 18LF2685 and the GLCD (EA DOGL128W-6 +). When I send a pixel to be displayed to the GLCD it displays it correctly but it repeats the sent figure several times along the display. Does anyone know what this might be caused?

thanks
jaume
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 9:48 am     Reply with quote

Are you sure you have the duty selection set correctly for the display?.
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 10:02 am     Reply with quote

Ttelmah wrote:
Are you sure you have the duty selection set correctly for the display?.


the duty is 1/65 with a bias 1/9 as the datasheet of the display specifies at pag 6 http://www.lcd-module.com/eng/pdf/grafik/dogl128-6e.pdf
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 10:13 am     Reply with quote

OK. That should be right for that display. Do you have a second display you can test?. Other common thing is a stuck address bit on the RAM.
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 10:18 am     Reply with quote

Ttelmah wrote:
OK. That should be right for that display. Do you have a second display you can test?. Other common thing is a stuck address bit on the RAM.


I am afraid i don't have another GLCD. It would be weird that an address but got stuck in the RAM because it behaves this way (copying the sent figure and displaying it several times) regardless of what I send. I mean that is not always showing the same pattern of figures, it depends 100% on what I send to it, meaning that it has to be something to do with some function of the display or something like that, no?

thanks

jaume
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 11:15 am     Reply with quote

Is it possible that this problem I am encountering is due to the 8 pages the display has for the internal buffer? Any thoughts on this?
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 11:28 am     Reply with quote

Have to ask.... can you properly display 'Hello GLCD' at any selected row/column of the display ?
If not, then I'd find out why before trying 'fancy graphics', especially if you've translated some other C into CCS C.

Jay
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 11:33 am     Reply with quote

temtronic wrote:
Have to ask.... can you properly display 'Hello GLCD' at any selected row/column of the display ?
If not, then I'd find out why before trying 'fancy graphics', especially if you've translated some other C into CCS C.

Jay


Well, right now I'm trying even more simple things such as displaying single pixels. When I do that, the pixels repeat several times. The hypothesis I have is that something to do with the pages of the display ( that is the way the display is divided) has some kind of mistake.
Regarding your question of displaying letters. Until now I have been able to display circles, squares rectangles and so one but letters do not appear readable.

jaume
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Thu Feb 02, 2017 11:44 am     Reply with quote

temtronic wrote:
Have to ask.... can you properly display 'Hello GLCD' at any selected row/column of the display ?
If not, then I'd find out why before trying 'fancy graphics', especially if you've translated some other C into CCS C.

Jay


Given it is a graphics LCD 'Hello', is a very complex thing to actually do. Single pixels are the way to go, then vertical lines and horizontal.

I must admit to being suspicious that there is a problem internally....

I'd start by just writing a single byte. If it repeats then it looks like hardware...
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Feb 03, 2017 6:37 am     Reply with quote

Curious, I downloaded the PDF and read it. Seems it comes in 2 pieces and you have to assemble it. I'm wondering if the erratic, random problem is actually a pin not properly inserted into it's socket? The datasheet doesn't say to solder the LCD to the PCB but my 'gut feeling' says this is required.

Having just a 'press fit' of pin in hole isn't a good idea. It took me just over 2 years to fit an unsoldered pin! Random operation when PCB got cold allowed pin to 'float' within the PCB hole, so it was unconnected.

Since the display 'mostly' works, can draw lines, circles, etc but erratic, it says that the PIC to GLCD is correct, power should be OK. It might take a good magnifying glass to see the modules pins though !

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Fri Feb 03, 2017 8:58 am     Reply with quote

and (of course), if it is soldered, have the unit unplugged, and then with an ohmmeter, check every pair of adjacent pins on the connector. A whisker short is very likely.
jeremiah



Joined: 20 Jul 2010
Posts: 1345

View user's profile Send private message

PostPosted: Fri Feb 03, 2017 10:14 am     Reply with quote

Can you post up your initialization? It honestly sounds like a hardware issue, but wanted to at least see your init code.

Something like:

1. Default pin states for Chip Select and Data/nCommand pin
2. Delay after power on before sending initial commands
3. Command sent to initialize the device, highlighting any differences from the datasheet
4. Any other commands you issue to the LCD after initialization but before general use, such as clearing the screen and setting the contrast.
Ttelmah



Joined: 11 Mar 2010
Posts: 19498

View user's profile Send private message

PostPosted: Fri Feb 03, 2017 11:06 am     Reply with quote

Have to agree. If (for instance) the duty cycle wasn't actually writing correctly, then the 'pitch' of the data in memory would not match the actual display. Result would be exactly what is described. I accepted that the duty was being set, but if there was an error in the initialisation, this might be the problem...
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Fri Feb 03, 2017 11:12 am     Reply with quote

temtronic wrote:
Curious, I downloaded the PDF and read it. Seems it comes in 2 pieces and you have to assemble it. I'm wondering if the erratic, random problem is actually a pin not properly inserted into it's socket? The datasheet doesn't say to solder the LCD to the PCB but my 'gut feeling' says this is required.

Having just a 'press fit' of pin in hole isn't a good idea. It took me just over 2 years to fit an unsoldered pin! Random operation when PCB got cold allowed pin to 'float' within the PCB hole, so it was unconnected.

Since the display 'mostly' works, can draw lines, circles, etc but erratic, it says that the PIC to GLCD is correct, power should be OK. It might take a good magnifying glass to see the modules pins though !

Jay


I dont really know what do you mean by the 2 pieces that you mention indeed. I am actuall using the assembly that you can find at pag4 of the GLCD's pdf as "low power" assemlby. With this, I connect it to the PIC 18LF2685. i dont believe that it is an error due to a "flotating pin" because when measuring the voltages they all make sense i think

This are the voltages at each pin:
pin 21: 9.65V
pin 22: 8.57V
pin 23: 7.49V
pin 24: 2.167V
pin 25: 1.1V
pin 26: 0V
pin 27: 1.67V
pin 28: 7.71V
pin 29: 4.7V
pin 30: 1.63V
pin 31: 10.5V
pin 32: 12.3V
pin 33: 0V
pin 34: 3.26V
pin 35: 3.26V
pin 36: SI
pin 37: CLK
pin 38: A0
pin 39: RST:
pin 40: CS

I have to admid that the pin 31 is misteriously high. I belibieve it should be around 4.8V and it's at 10.5V
jamalavedra



Joined: 25 Oct 2016
Posts: 62

View user's profile Send private message

PostPosted: Fri Feb 03, 2017 11:16 am     Reply with quote

My initialization code is the following:

Code:

void glcd_init()
{
// Select the chip
    output_low(GLCD_CS1);

    output_low(GLCD_RESET);

    // Datasheet says "wait for power to stabilise" but gives
    // no specific time!
    Delay_Ms(50);

    output_high(GLCD_RESET);
    output_low(GLCD_CS1);
    output_low(GLCD_A0);

    // Datasheet says max 1ms here
    //DelayMs(1);

    // Set LCD bias to 1/9th
    glcd_command(GLCD_CMD_BIAS_9);

    // Horizontal output direction (ADC segment driver selection)
    glcd_command(GLCD_CMD_HORIZONTAL_REVERSE);

    // Vertical output direction (common output mode selection)
    glcd_command(GLCD_CMD_VERTICAL_NORMAL);

    // The screen is the "normal" way up
    glcd_flipped = 1;

    // Set internal resistor.  A suitable middle value is used as
    // the default.
    glcd_command(GLCD_CMD_RESISTOR | 0x3);

    // Power control setting (datasheet step 7)
    // Note: Skipping straight to 0x7 works with my hardware.
      // glcd_command(GLCD_CMD_POWER_CONTROL | 0x4);
     //  Delay_Ms(50);
    //   glcd_command(GLCD_CMD_POWER_CONTROL | 0x6);
    //   Delay_Ms(50);
    glcd_command(GLCD_CMD_POWER_CONTROL | 0x7);
    //   Delay_Ms(10);

    // Volume set (brightness control).  A middle value is used here
    // also.
    glcd_command(GLCD_CMD_VOLUME_MODE);
    glcd_command(31);

    // Reset start position to the top
    glcd_command(GLCD_CMD_DISPLAY_START);

    // Turn the display on
    glcd_command(GLCD_CMD_DISPLAY_ON);

    // Unselect the chip
    output_high(GLCD_CS1);
}


the refresh code is the following
Code:

void glcd_refresh() {
   int8 y, x;
    for (y = 0; y < 8; y++) {

#ifdef ST7565_DIRTY_PAGES
        // Only copy this page if it is marked as "dirty"
        if (!(glcd_dirty_pages & (1 << y))) continue;
#endif

        glcd_command(GLCD_CMD_SET_PAGE | y);

        // Reset column to the left side.  The internal memory of the
        // screen is 132*64, we need to account for this if the display
        // is flipped.
        //
        // Some screens seem to map the internal memory to the screen
        // pixels differently, the ST7565_REVERSE define allows this to
        // be controlled if necessary.
#ifdef ST7565_REVERSE
        if (!glcd_flipped) {
#else
        if (glcd_flipped) {
#endif
            glcd_command(GLCD_CMD_COLUMN_LOWER | 4);
        } else {
            glcd_command(GLCD_CMD_COLUMN_LOWER);
        }
        glcd_command(GLCD_CMD_COLUMN_UPPER);

        for (x = 0; x < 128; x++) {
            glcd_data(glcd_buffer[y * 128 + x]);
        }
    }

#ifdef ST7565_DIRTY_PAGES
    // All pages have now been updated, reset the indicator.
    glcd_dirty_pages = 0;
#endif
}


thanks
jaume
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group