Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Tito87
PostPosted: Aug 29, 2011 - 07:21 PM
Newbie


Joined: Jul 04, 2011
Posts: 5


Hello everybody.

I want to read the conversion result from a MAX186 using SPI module in Xmega128.
I follow the instructions in datasheet and the communication is perfect, I get the two conversion bytes RB2 and RB3.
In the data sheet says :"Bytes RB2
and RB3 will contain the result of the conversion
padded with one leading zero and three trailing zeros."

and the problem is that these bytes don't have this form. I mean, RB2 not always has zero on the MSB and RB3 never has 3 zeros on the LSB. So I don't know if I must move RB3 three positions to the right losing the three LSB and the RB2 one to the left losing the MSB and then work with both.
Or if they must be as in the data sheet says.

Thank for your help.
 
 View user's profile Send private message  
Reply with quote Back to top
alex.forencich
PostPosted: Sep 01, 2011 - 10:54 PM
Wannabe


Joined: Apr 01, 2010
Posts: 68
Location: San Diego, CA

How do you know the communication is perfect? It seems like it might not be in this case as the device is not quite SPI. Just because it's a serial interface that's not I2C or RS232 doesn't mean it will work out of the box with the SPI controller. Have you looked at the communication signals with an oscilloscope or logic analyzer? Perhaps posting the relevant portions of your code here would help a diagnosis of the issue.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits