01-19-2006 09:32 AM - edited 01-19-2006 09:32 AM
Message Edited by ScottieB on 01-19-2006 09:34 AM
04-10-2006 06:45 AM
This is a quote from a previos answer we received from you (reply 12 of 31)
“Reading the TA bit and accepting it as an indicator as when the device is addressed as a talker and should send data isn't entirely correct--as we have seen, a serial poll will activate this bit as well. Also, reading the SPMS bit is of questionable value when determining when one should respond to a serial poll. Ideally, one would use the STBO bit in ISR2 to know when to respond to a serial poll, and one would do so by writing to the SPMR. As soon as you write to the SPMR, the STBO bit will clear. Thus you won't run into weird timing problems that manifest themselves because SPMS does eventually go away, but only after the device has transmitted the serial poll response to the controller.
So, I wonder:
1) Why use SPMS in ADSR instead of STBO in ISR2?”
Following your above answer, which indeed describe quite accurately the structure of our code, I have additional question:
As stated above, we are using the ADSR(TA) bit in order to check if our embedded device is in Talker mode. If so, we call the function that handles this mode.
Unfortunately, as you said, the TA bits is also activated when in active SPOLL state.
We have bypassed this problem by checking ADSR(SPMS) bit as well, so that even if the TA bit is ON, we do not call our Talker function unless the SPMS bit is OFF.
This bypass works, but not in all cases, so we are searching for another method.
Your answer indeed indicates that monitoring the ADSR(TA) bit is not the correct way to know whether the Host is asking to read data (as it also activated by the SPMS). However, your answer didn’t include any hint regarding which bit should we use in order to be sure that the Host wants to read data from our device.
We found in the Reference Manual, that what we should look for is the TADS state. However, there is not bit to directly report this state. All that we have found is the ADSR(TA) ….
How can we, as an embedded device, know that the host is requesting to read data (not Serial Poll) ?04-10-2006 07:13 AM
04-17-2006 10:25 AM
04-17-2006 10:35 AM