908AP32 on CW5.0- Help with AS1_SendBlock.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

908AP32 on CW5.0- Help with AS1_SendBlock.

1,544 Views
B_Conf
Contributor I
Hello,
I´m using the AP32 and CW5.0 to program.
I was trying to use "LCD_GetTxComplete();" or "AS1_GetTxComplete();" without results.
I´m sending some characters to a serial Display, and sometimes lose characters in Buffer, it is like the previous command, hasn´t any effect, I used a delay between sending and clearing but the same, The next code show what I'm talking about.

LCD_SendChar(148); //Command for display
LCD_SendBlock("Some text",9,&SND);
while (!(LCD_GetTxComplete())){}; // WITHOUT SUCCESS!
LCD_ClearTxBuf(); //IT CLEARS SOME CHARACTERS BEFORE SEND MESSAGE,


Another example:
LCD_ClearTxBuf();
/***************** DELAY *************
for (G=0;G65535;G++){ //delay 1.09 Seg
for (d=0;d8;d++){
}
d=0;
}
/*************************************
d=0;
LCD_SendChar(18); //I LOSE THIS DATA, 18 turn off the BACKLIT of LCD
d=0;
G=0;
/***************** DELAY *************
for (G=0;G65535;G++){ //delay 1.09 Seg
for (d=0;d8;d++){
}
d=0;
}
/*************************************
d=0;
/***************** DELAY *************
for (G=0;G65535;G++){ //delay 1.09 Seg
for (d=0;d8;d++){
}
d=0;
}
/*************************************
d=0;
LCD_ClearTxBuf();


Please, if somebody, can tell me how can I use "LCD_GetTxComplete();" to avoid lose of data, or another thing, I will appreciate a lot!.

Thanks and regards!

B_conf
Labels (1)
0 Kudos
2 Replies

278 Views
ProcessorExpert
Senior Contributor III
Dear Customer,
 
Is it possible to send us a project or detail description of CPU and bean settings, especially AsynchroSerial bean? We tried to reproduce your problem according your instructions and examples and no data loss was found. The project may be sent to support@processorexpert.com.
 
Best Regards,
Jan Pospisilik, Processor Expert Support 
0 Kudos

278 Views
B_Conf
Contributor I
Dear Jan Pospisilik,
Thanks for your response.
I´m going to send the entire project but first I have to translate it into English, it is in Spanish.
On the other hand, I found that if I put below LCD_SendBlock();, LCD_ClearTxBuf(); It clears all buffer and the text inside SendBlock, vanishes, Here an example:

LCD_SendChar(12);
while(IRSCS1_TC==0){};
Pausa1s(); // Delay 1 seg aprox.
LCD_SendChar(148);
while(IRSCS1_TC==0){};
LCD_SendChar(18);
while(IRSCS1_TC==0){};
LCD_SendBlock("La tension de la fase R es: ",28,&SND);
while(IRSCS1_TC==0){};
//LCD_ClearTxBuf(); IF I UNCOMMENT THIS, THE PREVIOUS MESSAGE DOESN´T APPEAR.
resultado=(byte)Datos[0][45].datocompl/0x0333;
resultado=0x30+resultado;
LCD_SendChar(resultado);
while(IRSCS1_TC==0){};
resultado=(byte)Datos[0][45].datocompl%0x0051;
resultado=0x30+resultado;
LCD_SendChar('.');
while(IRSCS1_TC==0){};
//LCD_ClearTxBuf();
LCD_SendChar(resultado); //envia el decimal
while(IRSCS1_TC==0){};
LCD_SendBlock(" Volts",6,&SND);
while(IRSCS1_TC==0){};
//LCD_ClearTxBuf(); THE SAME, Volts DOESN´T APPEAR ON A SERIAL DISPLAY if I uncomment
Pausa1s();

I tried with delays(); before clear, but the same, the display is @ 19200 Bauds, and I configure the bean according to this, The size of Tx buffer is 50 bytes. However in simulation, the program works fine, and I can see all the text sended.
Well, here is a preview of the program.
Thanks and regards

Pablo
0 Kudos