??? 01/24/06 03:22 Modified: 01/24/06 03:57 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#108150 - 'Read buffer' and 'Write buffer' Responding to: ???'s previous message |
Mehdi said:
i call read buffer after each write buffer and show it in main Did you notice that both of 'Read buffer' command code and 'Write buffer' code are the same code 'F0'? That is, the code 'F0' works as 'Read buffer' on the OUT EP. On the IN EP, it works as 'Write buffer'. From PDIUSBD12 datasheet (PDIUSBD12-08.pdf p19) Remark: There is no protection against writing or reading over a buffer’s boundary or against writing into an OUT buffer or reading from an IN buffer. Any of these actions could cause an incorrect operation. (added emphasis) Therefore, you cannot 'read' from IN EP. When your code 'read's from IN EP, it works as 'write', actually. Delete the read buffer routine after each write buffer. And add VALIDATE_BUFFER to each write buffer. Tsuneo |