<div class='quotetop'>QUOTE (jasinski @ Jul 14 2009, 07:36 AM) <{post_snapback}> (index.php?act=findpost&pid=23103)</div>
--- Quote Start ---
Please post the lines in your code where you open/configure/read the uart, it might be helpful.
Cheers,
Ricardo.[/b]
--- Quote End ---
Hello Ricardo,
Below are the lines I currently use to read form the port. The line is 42 characters long. I've already tried with fgets, and changing the number of characters read simultaneously. The thing is, the OS always takes about 1 ms per character reading, regardless of the method used. That is why I was suggested to increase the cache memory to see if it read the port a little faster. I need it to read at most at 0.25 ms per character.
Any ideas are greatly appreciated.
FRancisco
void buffer2 (void)
{
//Declaración de las variables que se usarán - Variables used
int contador=0;
char retraso = 0;
//caracter que viene desde el serial
char c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21;
printf("buffer2\n");
archivo_log = fopen ("/logs/buffer2.txt","w");
while(contador <= 1320)
{
fscanf(serial_port,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",&c1,&c2,&c3,&c4,&c5,&c6,&c7,&c8,&c9,&c10,&c11,&c12,&c13,&c14,&c15,&c16,&c17,&c18,&c19,&c20,&c21);
fprintf(archivo_log,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21);
contador = contador + 1;
}
fclose( archivo_log );
captura2 = fopen("/captura2Lista","w");
while(retraso <= 25)
{
retraso = retraso + 1;
}
fclose(captura2);
//printf("termina rutina_buffer2\n");
}