Basic line and shape functions come out distorted
Posted: 30 Jun 2017 14:33
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.
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);
}
}