My name is david and i 'm french.
I am starting pic dev with Mikroc.
I am on a project of reuse a lcd board with a pic 16f872.
This part is a part of a Intermec PF4i printer.
I have the service manual with schematics of this board : I took the lcd example of mikroc site and customized it to :
Code: Select all
// Lcd module connections
sbit LCD_RS at RA5_bit;
sbit LCD_EN at RA4_bit;
sbit LCD_D4 at RA0_bit;
sbit LCD_D5 at RA1_bit;
sbit LCD_D6 at RA2_bit;
sbit LCD_D7 at RA3_bit;
sbit RW at RC6_bit;
sbit LCD_RS_Direction at TRISA5_bit;
sbit LCD_EN_Direction at TRISA4_bit;
sbit LCD_D4_Direction at TRISA0_bit;
sbit LCD_D5_Direction at TRISA1_bit;
sbit LCD_D6_Direction at TRISA2_bit;
sbit LCD_D7_Direction at TRISA3_bit;
// End Lcd module connections
char txt1[] = "mikroElektronika";
char txt2[] = "EasyPIC7";
char txt3[] = "Lcd4bit";
char txt4[] = "example";
char i; // Loop variable
void Move_Delay() { // Function used for text moving
Delay_ms(500); // You can change the moving speed here
}
void main(){
PORTA = 0;
TRISA = 0;
PORTB = 0;
TRISB = 1;
PORTC = 0;
TRISC = 0;
//RC6_bit = 0;
PORTC.F6 = 0; //RW LCD à zéro
//ANSELA = 0; // Configure PORTB pins as digital
Lcd_Init(); // Initialize Lcd
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,6,txt3); // Write text in first row
Lcd_Out(2,6,txt4); // Write text in second row
Delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Out(1,1,txt1); // Write text in first row
Lcd_Out(2,5,txt2); // Write text in second row
Delay_ms(2000);
// Moving text
for(i=0; i<4; i++) { // Move text to the right 4 times
Lcd_Cmd(_LCD_SHIFT_RIGHT);
Move_Delay();
}
while(1) { // Endless loop
for(i=0; i<8; i++) { // Move text to the left 7 times
Lcd_Cmd(_LCD_SHIFT_LEFT);
Move_Delay();
}
for(i=0; i<8; i++) { // Move text to the right 7 times
Lcd_Cmd(_LCD_SHIFT_RIGHT);
Move_Delay();
}
}
}
But nothing arrive on lcd.
I noticed RW pin is connected to RC6.
The burning/flash/erase of the pic is OK and verifyed.
I am actually trying to find frequency of the rc configuration on the board.
Some photos of the board : If someone see something wrong...
Config bits in other post (max3 attachments)...