Do anyone have an idea why they do not run ?
void LCD_Write_Data(char mot)
CPrint1(" Test avec init LCD en ASM , SANS LA Lib MikroC\r\n");
// Init_LCD_in_ASM() ;
_asm{
BCF LCD_EN_Direction, BitPos(LCD_EN_Direction+0)
BCF LCD_RS_Direction, BitPos(LCD_RS_Direction+0)
BCF LCD_D4_Direction, BitPos(LCD_D4_Direction+0)
BCF LCD_D5_Direction, BitPos(LCD_D5_Direction+0)
BCF LCD_D6_Direction, BitPos(LCD_D6_Direction+0)
BCF LCD_D7_Direction, BitPos(LCD_D7_Direction+0)
BCF LCD_EN, BitPos(LCD_EN+0)
BCF LCD_RS, BitPos(LCD_RS+0)
BCF LCD_D7, BitPos(LCD_D7+0)
BCF LCD_D6, BitPos(LCD_D6+0)
BCF LCD_D5, BitPos(LCD_D5+0)
BCF LCD_D4, BitPos(LCD_D4+0)
RCALL _Delay_5500us
RCALL _Delay_5500us
RCALL _Delay_5500us
BSF LCD_D5, BitPos(LCD_D5+0)
BSF LCD_D4, BitPos(LCD_D4+0) // 0x30
BSF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
BSF LCD_EN, BitPos(LCD_EN+0) // 0x30
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
BSF LCD_EN, BitPos(LCD_EN+0) // 0x30
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
BCF LCD_D4, BitPos(LCD_D4+0) // 0x20
BSF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
BSF LCD_EN, BitPos(LCD_EN+0) // 0x20
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
BCF LCD_D5, BitPos(LCD_D5+0) // 0x00
BSF LCD_D7, BitPos(LCD_D7+0) // 0x80
BSF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
BCF LCD_D7, BitPos(LCD_D7+0) //0x00
BSF LCD_D4, BitPos(LCD_D4+0) //0x10
BSF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
BCF LCD_D4, BitPos(LCD_D4+0)
BSF LCD_EN, BitPos(LCD_EN+0) // 0x00
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
BSF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
BSF LCD_D4, BitPos(LCD_D4+0) // 0x10
BSF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
BCF LCD_D4, BitPos(LCD_D4+0)
BSF LCD_EN, BitPos(LCD_EN+0) //0x00
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
BSF LCD_D7, BitPos(LCD_D7+0)
BSF LCD_D6, BitPos(LCD_D6+0)
BSF LCD_D5, BitPos(LCD_D5+0)
BSF LCD_D4, BitPos(LCD_D4+0)
BSF LCD_EN, BitPos(LCD_EN+0) //0xF0
RCALL _Delay_1us
BCF LCD_EN, BitPos(LCD_EN+0)
RCALL _Delay_5500us
MOVLB 0
BSF 0x7D,1; //__Lib_Lcd_cmd_status, BitPos(__Lib_Lcd_cmd_status+0), 1
RETURN 0
Delay_5500us:
MOVLW 115
MOVWF R12, 0
MOVLW 71
MOVWF R13, 0
L_Delay_5500:
DECFSZ R13, 1, 0
BRA L_Delay_5500
DECFSZ R12, 1, 0
BRA L_Delay_5500
NOP
NOP
RETURN 0
Delay_1us:
MOVLW 5
MOVWF R13, 0
L_Delay_1us:
DECFSZ R13, 1, 0
BRA L_Delay_1us
RETURN 0
}
At thé begining of my code there is « // LCD module connections : ». Have à look.no idea.
however, it will help if you include:
the part number of the display,
the connections you make between the processor and the display?
power and ground connections
void LCD_Write_Cmd(unsigned char mot) // Version 3 : OK.
{
LCD_RS = 0;
Delay_us(5);
LCD_D4 = ((mot & 0x10) == 0x10)?1:0; // Send upper nibble.
LCD_D5 = ((mot & 0x20) == 0x20)?1:0;
LCD_D6 = ((mot & 0x40) == 0x40)?1:0;
LCD_D7 = ((mot & 0x80) == 0x80)?1:0;
//PORTB = mot >> 4;
LCD_E_Pulse();
LCD_D4 = ((mot & 0x01) == 0x01)?1:0; // Send upper nibble.
LCD_D5 = ((mot & 0x02) == 0x02)?1:0;
LCD_D6 = ((mot & 0x04) == 0x04)?1:0;
LCD_D7 = ((mot & 0x08) == 0x08)?1:0;
//PORTB = mot & 0x0F; // Send lower nibble.
LCD_E_Pulse();
}
If you want us to help you we need something to validate with.At thé begining of my code there is « // LCD module connections : ». Have à look.
Thanks Paul !Hello Eric,
remark :l'usage de mot pour un byte n'est pas heureuse, ni recommandéeCode:void LCD_Write_Data(char mot)
use instead "mot" -> octet
did you test before with only one charactere to display ?
i think , LCD init is wrong .. because Init must strat in 8 bit configuration before to change to 4 bits ...
0X30 commande are missing !
Code:CPrint1(" Test avec init LCD en ASM , SANS LA Lib MikroC\r\n"); // Init_LCD_in_ASM() ; _asm{ BCF LCD_EN_Direction, BitPos(LCD_EN_Direction+0) BCF LCD_RS_Direction, BitPos(LCD_RS_Direction+0) BCF LCD_D4_Direction, BitPos(LCD_D4_Direction+0) BCF LCD_D5_Direction, BitPos(LCD_D5_Direction+0) BCF LCD_D6_Direction, BitPos(LCD_D6_Direction+0) BCF LCD_D7_Direction, BitPos(LCD_D7_Direction+0) BCF LCD_EN, BitPos(LCD_EN+0) BCF LCD_RS, BitPos(LCD_RS+0) BCF LCD_D7, BitPos(LCD_D7+0) BCF LCD_D6, BitPos(LCD_D6+0) BCF LCD_D5, BitPos(LCD_D5+0) BCF LCD_D4, BitPos(LCD_D4+0) RCALL _Delay_5500us RCALL _Delay_5500us RCALL _Delay_5500us BSF LCD_D5, BitPos(LCD_D5+0) BSF LCD_D4, BitPos(LCD_D4+0) // 0x30 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) // 0x30 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) // 0x30 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BCF LCD_D4, BitPos(LCD_D4+0) // 0x20 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) // 0x20 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BCF LCD_D5, BitPos(LCD_D5+0) // 0x00 BSF LCD_D7, BitPos(LCD_D7+0) // 0x80 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BCF LCD_D7, BitPos(LCD_D7+0) //0x00 BSF LCD_D4, BitPos(LCD_D4+0) //0x10 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BCF LCD_D4, BitPos(LCD_D4+0) BSF LCD_EN, BitPos(LCD_EN+0) // 0x00 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BSF LCD_D4, BitPos(LCD_D4+0) // 0x10 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BCF LCD_D4, BitPos(LCD_D4+0) BSF LCD_EN, BitPos(LCD_EN+0) //0x00 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BSF LCD_D7, BitPos(LCD_D7+0) BSF LCD_D6, BitPos(LCD_D6+0) BSF LCD_D5, BitPos(LCD_D5+0) BSF LCD_D4, BitPos(LCD_D4+0) BSF LCD_EN, BitPos(LCD_EN+0) //0xF0 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us MOVLB 0 BSF 0x7D,1; //__Lib_Lcd_cmd_status, BitPos(__Lib_Lcd_cmd_status+0), 1 RETURN 0 Delay_5500us: MOVLW 115 MOVWF R12, 0 MOVLW 71 MOVWF R13, 0 L_Delay_5500: DECFSZ R13, 1, 0 BRA L_Delay_5500 DECFSZ R12, 1, 0 BRA L_Delay_5500 NOP NOP RETURN 0 Delay_1us: MOVLW 5 MOVWF R13, 0 L_Delay_1us: DECFSZ R13, 1, 0 BRA L_Delay_1us RETURN 0 }
Thank you Paul,Hello Eric,
remark :l'usage de mot pour un byte n'est pas heureuse, ni recommandéeCode:void LCD_Write_Data(char mot)
use instead "mot" -> octet
did you test before with only one charactere to display ?
i think , LCD init is wrong .. because Init must strat in 8 bit configuration before to change to 4 bits ...
0X30 commande are missing !
Code:CPrint1(" Test avec init LCD en ASM , SANS LA Lib MikroC\r\n"); // Init_LCD_in_ASM() ; _asm{ BCF LCD_EN_Direction, BitPos(LCD_EN_Direction+0) BCF LCD_RS_Direction, BitPos(LCD_RS_Direction+0) BCF LCD_D4_Direction, BitPos(LCD_D4_Direction+0) BCF LCD_D5_Direction, BitPos(LCD_D5_Direction+0) BCF LCD_D6_Direction, BitPos(LCD_D6_Direction+0) BCF LCD_D7_Direction, BitPos(LCD_D7_Direction+0) BCF LCD_EN, BitPos(LCD_EN+0) BCF LCD_RS, BitPos(LCD_RS+0) BCF LCD_D7, BitPos(LCD_D7+0) BCF LCD_D6, BitPos(LCD_D6+0) BCF LCD_D5, BitPos(LCD_D5+0) BCF LCD_D4, BitPos(LCD_D4+0) RCALL _Delay_5500us RCALL _Delay_5500us RCALL _Delay_5500us BSF LCD_D5, BitPos(LCD_D5+0) BSF LCD_D4, BitPos(LCD_D4+0) // 0x30 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) // 0x30 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) // 0x30 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BCF LCD_D4, BitPos(LCD_D4+0) // 0x20 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) // 0x20 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BCF LCD_D5, BitPos(LCD_D5+0) // 0x00 BSF LCD_D7, BitPos(LCD_D7+0) // 0x80 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BCF LCD_D7, BitPos(LCD_D7+0) //0x00 BSF LCD_D4, BitPos(LCD_D4+0) //0x10 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BCF LCD_D4, BitPos(LCD_D4+0) BSF LCD_EN, BitPos(LCD_EN+0) // 0x00 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BSF LCD_D4, BitPos(LCD_D4+0) // 0x10 BSF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us BCF LCD_D4, BitPos(LCD_D4+0) BSF LCD_EN, BitPos(LCD_EN+0) //0x00 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) BSF LCD_D7, BitPos(LCD_D7+0) BSF LCD_D6, BitPos(LCD_D6+0) BSF LCD_D5, BitPos(LCD_D5+0) BSF LCD_D4, BitPos(LCD_D4+0) BSF LCD_EN, BitPos(LCD_EN+0) //0xF0 RCALL _Delay_1us BCF LCD_EN, BitPos(LCD_EN+0) RCALL _Delay_5500us MOVLB 0 BSF 0x7D,1; //__Lib_Lcd_cmd_status, BitPos(__Lib_Lcd_cmd_status+0), 1 RETURN 0 Delay_5500us: MOVLW 115 MOVWF R12, 0 MOVLW 71 MOVWF R13, 0 L_Delay_5500: DECFSZ R13, 1, 0 BRA L_Delay_5500 DECFSZ R12, 1, 0 BRA L_Delay_5500 NOP NOP RETURN 0 Delay_1us: MOVLW 5 MOVWF R13, 0 L_Delay_1us: DECFSZ R13, 1, 0 BRA L_Delay_1us RETURN 0 }
Try this change and apply it also to the LCD_Write_Data() code:
I do not have a copy of MikroC but the above should work with it. The idea is NOT to write to the whole of PORTB but to set/reset individual bits before pulsing the 'E' line. It also allows the pins to be re-allocated freely, even across different ports as long as you change the definitions appropriately.Code:void LCD_Write_Cmd(unsigned char mot) // Version 3 : OK. { LCD_RS = 0; Delay_us(5); LCD_D4 = ((mot & 0x10) == 0x10)?1:0; // Send upper nibble. LCD_D5 = ((mot & 0x20) == 0x20)?1:0; LCD_D6 = ((mot & 0x40) == 0x40)?1:0; LCD_D7 = ((mot & 0x80) == 0x80)?1:0; //PORTB = mot >> 4; LCD_E_Pulse(); LCD_D4 = ((mot & 0x01) == 0x01)?1:0; // Send upper nibble. LCD_D5 = ((mot & 0x02) == 0x02)?1:0; LCD_D6 = ((mot & 0x04) == 0x04)?1:0; LCD_D7 = ((mot & 0x08) == 0x08)?1:0; //PORTB = mot & 0x0F; // Send lower nibble. LCD_E_Pulse(); }
Brian.
LCD_Write_String("Bonjour !");
LCD_Write_String_v2("Bonjour !");
LCD_String_Position(1, 1, "Bonjour !");
LCD_String_Position_v2(1, 1, "Bonjour !");
LCD_String_Position(1, 1, *pointeur_de_char);
LCD_String_Position_v2(1, 1, *pointeur_de_char);
unsigned char *pointeur_de_char; // Déclaration d'un pointeur (*) de char "pointeur_de_char".
char texte[17]; // pour LCD de 16 chars/ligne
pointeur_de_char = &texte[0];
// --- Copie le texte depuis FLASH ROM vers RAM
void strConstRamCpy(unsigned char *dest, const code char *source)
{
while (*source)*dest++ = *source++ ;
*dest = 0 ; // terminateur
}
void LCD_Write_CString(const char *msg)
{
while ((*msg) != 0) // Send each char of string till the 0.
{
LCD_Write_Data(*msg);
*msg++; // pointeur msg modifié !
}
}
void LCD_Write_String_v2(char *msg)
{
// variante avec pointeur msg non modifié
int k;
k=0;
while( *(msg)>0)
{
LCD_Write_Data(*(msg+k)); // data pointée par msg+k
k++;
if (k>15) break;
}
}
void LCD_CString_Position(char row, char col, const char *msg)
{
char location = 0;
switch (row):
{
case 1:
location = (0x80) | ((col) & 0x0F); // Print message on 1st row and desired location.
break;
case 2:
location = (0xC0) | ((col) & 0x0F); // Print message on 2nd row and desired location.
break;
default:
break;
}
LCD_Write_Cmd(location);
LCD_Write_String(msg); // <-- au lieu de *msg
}
void LCD_String_Position_v2(char row, char col, char *msg)
{
if (row == 1)
{
LCD_Write_Cmd((col & 0x0F)|0x80); // Print message on 1st row and desired location.
}
else if (row == 2)
{
LCD_Write_Cmd((col & 0x0F)|0xC0); // Print message on 2nd row and desired location.
}
LCD_Write_String_v2(msg);
}
... main program...
Lcd_Init_v3(); // Initialize LCD.
while(1) // Endless loop.
{
pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré
portc.b2 = 1;
Lcd_Out(1, 1, "Bonjour ! ");
strConstRamCpy(pointeur_de_char,"Bonjour !");
Lcd_Out(1, 1, pointeur_de_char);
LCD_CString_Position(1, 1,"Bonjour !");
pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré
strConstRamCpy(pointeur_de_char,"Bonjour !");
LCD_String_Position_v2(1, 1, pointeur_de_char);
Delay_ms(1000);
}
hello Eric,
*pointer => contenu (char) pointé par le pointeur
pointer => seul = adresse zone pointée
Code:unsigned char *pointeur_de_char; // Déclaration d'un pointeur (*) de char "pointeur_de_char". char texte[17]; // pour LCD de 16 chars/ligne pointeur_de_char = &texte[0]; // --- Copie le texte depuis FLASH ROM vers RAM void strConstRamCpy(unsigned char *dest, const code char *source) { while (*source)*dest++ = *source++ ; *dest = 0 ; // terminateur } void LCD_Write_CString(const char *msg) { while ((*msg) != 0) // Send each char of string till the 0. { LCD_Write_Data(*msg); *msg++; // pointeur msg modifié ! } } void LCD_Write_String_v2(char *msg) { // variante avec pointeur msg non modifié int k; k=0; while( *(msg)>0) { LCD_Write_Data(*(msg+k)); // data pointée par msg+k k++; if (k>15) break; } } void LCD_CString_Position(char row, char col, const char *msg) { char location = 0; switch (row): { case 1: location = (0x80) | ((col) & 0x0F); // Print message on 1st row and desired location. break; case 2: location = (0xC0) | ((col) & 0x0F); // Print message on 2nd row and desired location. break; default: break; } LCD_Write_Cmd(location); LCD_Write_String(msg); // <-- au lieu de *msg } void LCD_String_Position_v2(char row, char col, char *msg) { if (row == 1) { LCD_Write_Cmd((col & 0x0F)|0x80); // Print message on 1st row and desired location. } else if (row == 2) { LCD_Write_Cmd((col & 0x0F)|0xC0); // Print message on 2nd row and desired location. } LCD_Write_String_v2(msg); } ... main program... Lcd_Init_v3(); // Initialize LCD. while(1) // Endless loop. { pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré portc.b2 = 1; Lcd_Out(1, 1, "Bonjour ! "); strConstRamCpy(pointeur_de_char,"Bonjour !"); Lcd_Out(1, 1, pointeur_de_char); LCD_CString_Position(1, 1,"Bonjour !"); pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré strConstRamCpy(pointeur_de_char,"Bonjour !"); LCD_String_Position_v2(1, 1, pointeur_de_char); Delay_ms(1000); }
Lcd_Init_v3(); // Initialize LCD.
while(1) // Endless loop.
{
pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré
portc.b2 = 1;
strConstRamCpy(pointeur_de_char,"Bonjour !");
LCD_CString_Position(1, 1,"Bonjour !");
pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré
strConstRamCpy(pointeur_de_char,"Bonjour !");
LCD_String_Position_v2(1, 1, pointeur_de_char);
}
hello Eric,
*pointer => contenu (char) pointé par le pointeur
pointer => seul = adresse zone pointée
Code:unsigned char *pointeur_de_char; // Déclaration d'un pointeur (*) de char "pointeur_de_char". char texte[17]; // pour LCD de 16 chars/ligne pointeur_de_char = &texte[0]; // --- Copie le texte depuis FLASH ROM vers RAM void strConstRamCpy(unsigned char *dest, const code char *source) { while (*source)*dest++ = *source++ ; *dest = 0 ; // terminateur } void LCD_Write_CString(const char *msg) { while ((*msg) != 0) // Send each char of string till the 0. { LCD_Write_Data(*msg); *msg++; // pointeur msg modifié ! } } void LCD_Write_String_v2(char *msg) { // variante avec pointeur msg non modifié int k; k=0; while( *(msg)>0) { LCD_Write_Data(*(msg+k)); // data pointée par msg+k k++; if (k>15) break; } } void LCD_CString_Position(char row, char col, const char *msg) { char location = 0; switch (row): { case 1: location = (0x80) | ((col) & 0x0F); // Print message on 1st row and desired location. break; case 2: location = (0xC0) | ((col) & 0x0F); // Print message on 2nd row and desired location. break; default: break; } LCD_Write_Cmd(location); LCD_Write_String(msg); // <-- au lieu de *msg } void LCD_String_Position_v2(char row, char col, char *msg) { if (row == 1) { LCD_Write_Cmd((col & 0x0F)|0x80); // Print message on 1st row and desired location. } else if (row == 2) { LCD_Write_Cmd((col & 0x0F)|0xC0); // Print message on 2nd row and desired location. } LCD_Write_String_v2(msg); } ... main program... Lcd_Init_v3(); // Initialize LCD. while(1) // Endless loop. { pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré portc.b2 = 1; Lcd_Out(1, 1, "Bonjour ! "); strConstRamCpy(pointeur_de_char,"Bonjour !"); Lcd_Out(1, 1, pointeur_de_char); LCD_CString_Position(1, 1,"Bonjour !"); pointeur_de_char=&texte[0]; // <- au cas ou le pointeur serais altéré strConstRamCpy(pointeur_de_char,"Bonjour !"); LCD_String_Position_v2(1, 1, pointeur_de_char); Delay_ms(1000); }
@KlausST,
The code that Eric_O posted is one of the better efforts I have seen so far this year.
After creating a microC project for the PIC16F887 and including support from the microC LCD library for a 16x2 LCD module the code compiles without any diagnostic messages (no errors or warnings).
That said there are some errors in Eric_O's implementation.
Some have already been mentioned, but another is much more subtle.
The sequence of commands to get the LCD module in to 4-bit parallel mode will only work one time immediately after the module has been powered on.
Hi,
If you want us to help you we need something to validate with.
A single source always is correct.
Usually we like to see code and schematic, so we can check if both match.
In post#1 you refer to line numbers, but I don't see line numbers in your sources.
Undocumented code never is a good idea, even not if it is just for yourself.
But posting it in a forum surely reduces feedback.
I've written many ASM programs. I've spent some time to find out what you want to achieve...but it's more difficult on a foreign code than on one owns code.
Klaus
while( *(msg)>0)
by while( *(msg+k)>0)
Bonjour Paul,hello
it seems zero string terminator is not detected ?
try to init texte table with zero values in it.
and modify the test
in void LCD_Write_String_v2(char *msg)
because msg itself is not increasingCode:while( *(msg)>0) by while( *(msg+k)>0)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?