Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18F2550 won't correctly return multiple bytes in slave read mode. #2

Open
GoogleCodeExporter opened this issue Jun 19, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

All files to reproduce this are available in the motor controller folder.
What steps will reproduce the problem?
1. Supply a write command to 0x10 containing two bytes
2. Supply a read command to 0x11(read address of 0x10) and read two bytes

What is the expected output? What do you see instead?
You should see the initial two bytes read back, however the pic will often only 
return the first byte correctly, and the second byte will usually be 
right-shifted by 1.

I suspected this to be a timing issue, so I added a delay after filling the 
SSPBUF from the array. It made no difference how long or short the delay was, 
the problem still occurred with more or less the same frequency. 

When inspected with the logic analyzer, it appears that the data being returned 
from the pic is in fact correct, but the bus pirate reads the data differently 
depending on if the last byte was ACKed or NACKed. 

Attached are two logic analyzer traces of the communication. When the bus 
pirate reads the correct values, it is always when a NACK is returned, 
otherwise it reads the incorrect values.

Original issue reported on code.google.com by [email protected] on 13 Jan 2012 at 7:36

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant