<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
hi dieter,<br>
<br>
i like to clean up and merge the sim reader code with master branch.
while looking at the code i found a delay_ms(1) in interrupt handler:<br>
<br>
-------<br>
        /* Used by: calypso_sim_transmit() to transmit the data */<br>
        if(regVal & REG_SIM_IT_SIM_TX)<br>
        {<br>
#if (SIM_DEBUG == 1)<br>
                puts(" Waiting for transmit...\n");<br>
#endif<br>
                if(sim_tx_character_count >= sim_tx_character_length)<br>
                {<br>
                        txDoneFlag = 1;<br>
                }<br>
                else<br>
                {<br>
                        writew(*tx_buffer,REG_SIM_DTX);<br>
                        tx_buffer++;<br>
                        sim_tx_character_count++;<br>
<br>
        #if 1 /* Dieter: set to 0 to get problems with some cards */<br>
                        /* its essential to immediately switch to RX
after TX is done */<br>
                        if(sim_tx_character_count >=
sim_tx_character_length)<br>
                        {<br>
                                /* TODO: set a proper delay here, 4 is
to<br>
                                   long if not debugging and no delay
is too short */<br>
<font color="#ff0000">                                delay_ms(1);<br>
</font>                                /* Switch I/O direction to input
*/<br>
                                writew(readw(REG_SIM_CONF1) &
~REG_SIM_CONF1_CONFTXRX, REG_SIM_CONF1);<br>
                        }<br>
        #endif<br>
                }<br>
        }<br>
---------<br>
<br>
i removed the delay, and it works. i checked the tsm30 source code. it
also sets the IO to input right after writing the last TX byte. (i
guess that the controller will trigger the IO switching at the end of
transmission.) so why do we need that delay? are there any problems?<br>
<br>
regards,<br>
<br>
andreas<br>
<br>
</body>
</html>