we cam from: https://community.freescale.com/message/63224#63224
I understand that I have something worng in my code, I read a lot of documentation and look for some examples but I don't find a solution, my problem know is that I receive teh data from the sensor in reversebit mode (1=low and 0=high).
I configured the SPI modulo as:
//SPIBR SPI clock = BUSCLK/4 = 1MHz
then a GPIO as a SS, and make a loop as:
while (SPIS_SPTEF==0) clrWD();
while (SPIS_SPRF==0) clrWD();
res[vegades] = SPID;
SO in that way I recevie 2 byte with the 10 bit angular position and 6 bits with the sensor status and all is ok.
But now I checking the sensor behavior: the data output with the PWM sensor output and when the PWM output is like 26 I receive 998, I didn't realize of that the first time because I didn't need to compare both signals, and also I'm not able to localize the status bits (where are they and the logic levels don't match with the reality).
So i'm doing something wrong?