83Plus:Ports:96
This port only exists on the the TI-84 Plus and the TI-84 Plus Silver Edition. On the standard TI-83 Plus, it acts as a shadow of port 06. On the TI-83 Plus Silver Edition, this port has no effect. |
Synopsis
Port Number: 96h (LSB), 97h (MSB, hypothetical)
Function: USB Data-Received Counter
This port shows the number of bytes left to read from a USB pipe.
Read Values
- Bits 0-7: Number of bytes left to read.
Write Values
- No effect
Comments
When a data packet has been received - either an IN packet in host mode, or an OUT packet in peripheral mode - the contents of the packet are stored in an internal buffer in the USB controller. Each pipe has its own buffer; this port tells you how many bytes are currently in the queue for the current pipe. (The "current" pipe is determined by port 8E.)
The contents of the buffer can be retrieved using the appropriate Ax port. As you read bytes from the buffer, port 96 will count down to zero.
Port 97 is probably the MSB; this should be tested. (Note that, for full-speed devices, the maximum size permitted for a single control, bulk, or interrupt data packet is 64 bytes - see sections 5.5 to 5.8 of the USB specification. Isochronous packets may be up to 1023 bytes.)