07-17-2009 07:34 AM
Thanks Steven,
All of the writes are now OK. I delete the line : // Write_7210(AUXMR,0x0C); // lul at the end of my loop. The erros ENOL disapeared now.
But now, I have troubles with the read because of the time outs (Errors AEBO). I read again chapter 5-8. How Could I ignore this errors.
Please, could you have a look on my code in C. ID_size represents the size of the data I want to return by IEEE.
What's your advice?
if (bit_test(Read_7210(ADSR),1)) // TA ?
{
if (b_IEEE[0] == 'I') { ///////////// Cmde 'I' : Lecture *IDN?
IEEE_temp1 = 0;
IEEE_temp2 = Read_7210(ISR1);
IEEE_temp = 255;
while ((!bit_test(IEEE_temp2,2)) && (IEEE_temp1 <= (ID_size - 1)) && (IEEE_temp > 1))
{ // ERR? && fin de chaine
IEEE_temp--;
if (bit_test(IEEE_temp2,1))
{ // DO?
if ((IEEE_temp1) == (ID_size - 1))
{
Write_7210(AUXMR,0x06); // EOI?
}
Write_7210(CDOR,ID[IEEE_temp1]);
IEEE_temp1++;
IEEE_temp = 255;
}
IEEE_temp2 = Read_7210(ISR1);
}
if (bit_test(IEEE_temp2,2)) // ERR ?
{
Write_7210(AUXMR,0x0E); // nbaf
Write_7210(AUXMR,0x57); // Clear ERR
Write_7210(AUXMR,0x0B); //lut
return(1);
}
Write_7210(AUXMR,0x0B); //lut
if (IEEE_temp <= 1)
Init_IEEE488();
return(0);
}
}
07-20-2009 08:14 AM
Hello Neo19,
From a small code inspection I was not able to see any problems. Are you able to do any debug prints so that you can tell what code paths are being executed? Without seeing the code paths it would be difficult to see what is happening. Please print out debug information pertaining to each if statement as well as the values that you get from reading from the 7210 registers. That will help with finding the problem.
Also what is the behavior on the PC side? Do you receive any data or none at all?
Thanks,
Steven T.