I take the 18F4520 exemple, just change the processor, and add a ECCP1CON:=0 in the program ant set the config words.
The problem is that not all pixels are drawned on the screen
I test with a line from 0,0 to 0,63 : 4 pixels are drawn , 4 are not , 4 are drawn, ....
Code: Select all
// *
// *
// * Project name:
// Glcd_Test
// * Copyright:
// (c) mikroElektronika, 2008
// * Revision History:
// 20080225:
// - initial release.
// * Description:
// This is a simple demonstration of the GLCD library routines:
// - Init and Clear (pattern fill)
// - Image display
// - Lines, circles, text etc.
// * Test configuration:
// MCU: PIC18F4520 --> test with 18F4685
// Dev.Board: EasyPIC5
// Oscillator: HS, 8.000 MHz
// Ext. Modules: None
// SW: mikroPascal v8.1
// * NOTES:
// - to turn ON Glcd backlight switch 'GLCD' on SW9 (board specific)
// *
program Glcd_Test;
uses __Lib_images;
var
ii : byte;
jj : word;
someText : string[25];
procedure delay2S;
begin
delay_ms(2000); // 2 second delay procedure
end;
begin
INTCON := 0; // disable all interrupts
ADCON1 := 0x0F; // configure PORTB pins as digital
ECCP1CON:=0;
Glcd_Init(PORTB, 0, 1, 2, 3, 5, 4, PORTD); // Glcd_Init_EP5, see Autocomplete
Glcd_Fill(0xAA);
delay2S;
while TRUE do
begin
Glcd_Fill(0x00); // clear screen
Glcd_Image(truck_bmp); // display image from library
delay2S; // call to 2 second delay procedure
Glcd_Fill(0x00); // clear screen
Glcd_Line(0, 0, 0,63, 1); // write line with given cordinates
delay2S;
for jj := 1 to 50 do // writing a line using for loop
Glcd_Dot(jj, jj, 1);
delay2S;
Glcd_Line(120, 1, 5,60, 1); // write line with given cordinates
delay2S;
Glcd_Line(12, 42, 5,60, 1);
delay2S;
Glcd_Rectangle(12, 20, 93,57, 1); // write rectangle on screen
delay2S;
Glcd_H_Line(5, 15, 6, 1); // write horizontal line with given cordinates
Glcd_Line(0, 12, 120, 60, 1);
Glcd_V_Line(7, 63, 127, 1); // write vertical line with given cordinates
delay2S;
for ii := 1 to 10 do // write concentric circles using for loop
Glcd_Circle(63, 32, 3*ii, 1);
delay2S;
Glcd_Box(12, 20, 70, 57, 2); // write box on screen with given cordinates
delay2S;
Glcd_Fill(0x00); // clear screen
Glcd_Set_Font(@FontSystem5x8, 5, 8, 32); // initialize Font 5x8
someText := 'Fonts Demo: 5x8';
Glcd_Write_Text(someText, 5, 3, 1); // write test
delay2S;
Glcd_Set_Font(@System3x6, 3, 6, 32); // initialize Font 3x6
someText := 'SMALL FONT: 3X6';
Glcd_Write_Text(someText, 20, 5, 1); // write test
delay2S; // call to 2 second delay procedure
end;
end.
Thank you for your help