Code help needed please
Don M
Posts: 1,653
This project involves a Master / Slave type arraignment utilizing 9 bit serial data. The 9th bit is used as a mode flag to specify if the information transmitted is a command (9th bit set) or just data (9th bit cleared).
It goes through an initial handshake whereby the Master sends out a 10 10 Hex. The first 10 is the Command and the second 10 is the checksum.
The Slave is to then respond within 5 mSec with an ACK which is 00 Hex.
The Master then sends out a POLL command which is 12 12 (12 command and 12 checksum)
The Slave is to then respond with 00 00 Hex to indicate that the Slave is Just Reset. The Master then sends an ACK (00) to acknowledge.
What I am getting is an additional 00 sent from the Slave. The only time that the Slave is to respond with 00 00 is after the Master has requested it to be reset otherwise it is correct for the Slave to respond to the Master Poll (12 12) with just a single ACK (00).
I have attached 2 photos from the logic analyzer showing this.
Please excuse the messy code. Anyone have any ideas?
Thanks.
Don
It goes through an initial handshake whereby the Master sends out a 10 10 Hex. The first 10 is the Command and the second 10 is the checksum.
The Slave is to then respond within 5 mSec with an ACK which is 00 Hex.
The Master then sends out a POLL command which is 12 12 (12 command and 12 checksum)
The Slave is to then respond with 00 00 Hex to indicate that the Slave is Just Reset. The Master then sends an ACK (00) to acknowledge.
What I am getting is an additional 00 sent from the Slave. The only time that the Slave is to respond with 00 00 is after the Master has requested it to be reset otherwise it is correct for the Slave to respond to the Master Poll (12 12) with just a single ACK (00).
I have attached 2 photos from the logic analyzer showing this.
Please excuse the messy code. Anyone have any ideas?
Thanks.
Don
Comments