Page 1 of 1

Basic line and shape functions come out distorted

Posted: 30 Jun 2017 14:33
by ISpitFireXI
When I use the MikroC GLCD functions to make lines, shapes, or dots it comes out with this weird distorted pattern. But if I use fill, or if I use a bitmap image it looks fine.

Here's the source to a test program that just makes a line blink on the screen, and a picture of what it looks like. I have no idea what could be causing this.

Code: Select all


// Glcd module connections
char GLCD_DataPort at PORTD;

sbit GLCD_CS1 at LATB0_bit;
sbit GLCD_CS2 at LATB1_bit;
sbit GLCD_RS  at LATB2_bit;
sbit GLCD_RW  at LATB3_bit;
sbit GLCD_EN  at LATB4_bit;
sbit GLCD_RST at LATB5_bit;

sbit GLCD_CS1_Direction at TRISB0_bit;
sbit GLCD_CS2_Direction at TRISB1_bit;
sbit GLCD_RS_Direction  at TRISB2_bit;
sbit GLCD_RW_Direction  at TRISB3_bit;
sbit GLCD_EN_Direction  at TRISB4_bit;
sbit GLCD_RST_Direction at TRISB5_bit;
// End Glcd module connections

void main() {


  TRISD = 0x00;

  ANSELB = 0;                        // Configure PORTB pins as digital I/O
  ANSELD = 0;                        // Configure PORTD pins as digital I/O

  Glcd_Init();                                   // Initialize GLCD
  Glcd_Fill(0x00);                               // Clear GLCD

  while(1) {
    
    Glcd_Line(0,0,127,63,1);
    Delay_ms(1000);
    Glcd_Fill(0x00);
    Delay_ms(1000);
    
  }

}
Snapshot.jpg
Snapshot.jpg (41.58 KiB) Viewed 3155 times

Re: Basic line and shape functions come out distorted

Posted: 03 Jul 2017 17:32
by darko.ilijevski
Hello,

Can you please provide us with a bit more info - what MCU are you using and on which development system ?
Also I have cropped your image as it was way too big...

Best regards

Re: Basic line and shape functions come out distorted

Posted: 06 Jul 2017 13:12
by ISpitFireXI
darko.ilijevski wrote:Hello,

Can you please provide us with a bit more info - what MCU are you using and on which development system ?
Also I have cropped your image as it was way too big...

Best regards

Sorry about the picture size. I'm using a PIC16F18877 on a EasyPICv7 with MikroC.

Re: Basic line and shape functions come out distorted

Posted: 07 Jul 2017 12:50
by darko.ilijevski
Hello,

It seems that it's a bug with that particular MCU, I will report this to our developers.
Thanks for the notice.

Best regards