how to interface sensor with SSI protocol with FRDM-K20D50M board?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to interface sensor with SSI protocol with FRDM-K20D50M board?

Jump to solution
3,503 Views
Amit_Kumar1
Senior Contributor II

Hi

I am using a sensor with SSI protocol, How can we interface it with K20 uc?

Thanks and Regards

Amit Kumar

Tags (3)
1 Solution
1,881 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Amit Kumar,

I investigated the timing of the sensor, but found it can not meet the SSI spec that  K20 can support , because K20's SAI module doesn't support gated clock mode, the clk outputs continuously, so I would suggest you using DSPI module instead. and you have to set CONT_SCKE = 0(Continuous SCK disabled.), CPOL = 0(The inactive state value of SCK is low.) , FMSZ=0xF, and CPHA = 1(Data is changed on the leading edge of SCK and captured on the following edge.), Please also note to simulate the timing, you have to read the data out as the following pseudo-code:

//Set SCK as GPIO , output high before initialize DSPI module;

init_Dspi();

while(1){

//Set SCK as SCK function

//read SPI

//Set SCK as GPIO, output high

}

Hope that helps,

B.R

Kan

View solution in original post

6 Replies
1,881 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Amit Kumar,

Do you mean Synchronous Serial Interface? I think it can be connected with SAI interface of K20.

B.R

Kan

1,880 Views
Amit_Kumar1
Senior Contributor II

HI Kan

yes it is Synchronous Serial Interface. I was going through the PE component SSI_LDD incode warrior, there were too many pins to configure. The timing diagram which is required by the sensor is as follows

pastedImage_0.png

I was thinking of using 2 wire SSI mode so I configured the PE component and did the connection with CLK--->Receiver clock PTC9 and DO/DI---->Receive data channel 0 to PTC5. i.e

pastedImage_1.png

The sensor is supposed to give the readings automatically but I need to know if the pins assigned and the SSI_LDD settings done is correct or not as I am getting only "0" as received values.I am also attaching my program just have a look.

Thanks and Regards

Amit Kumar

0 Kudos
1,882 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Amit Kumar,

I investigated the timing of the sensor, but found it can not meet the SSI spec that  K20 can support , because K20's SAI module doesn't support gated clock mode, the clk outputs continuously, so I would suggest you using DSPI module instead. and you have to set CONT_SCKE = 0(Continuous SCK disabled.), CPOL = 0(The inactive state value of SCK is low.) , FMSZ=0xF, and CPHA = 1(Data is changed on the leading edge of SCK and captured on the following edge.), Please also note to simulate the timing, you have to read the data out as the following pseudo-code:

//Set SCK as GPIO , output high before initialize DSPI module;

init_Dspi();

while(1){

//Set SCK as SCK function

//read SPI

//Set SCK as GPIO, output high

}

Hope that helps,

B.R

Kan

1,880 Views
Amit_Kumar1
Senior Contributor II

Hi Kan

I tried this but it didn't worked. I think I might have done something wrong in coding. I will check and let you know. Meanwhile I came across some post in which some peoples have connected the SSI based sensors through RS-422 driver. Due to this confusion I m toggling b/w the two protocols, i.e UART(RS-422) and SPI. Basically I am trying to interface the magnetic encoder ic http://www.avagotech.com/pages/en/motion_control_encoder_products/magnetic_encoders/aeat-6600-t16/  . Please look into the matter.

Thanks and Regards

Amit Kumar

0 Kudos
1,880 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Amit Kumar,

I don't think RS-422 can be used to connect with the sensor you specified , because RS-422 are Differential mode, which has RX+,RX- and TX+,TX- for transferring data, maybe there is a RS-422 to SSI bridge used in that case, with a SOC such as MCU to handle the conversion b/w RS-422 and SSI protocol. Please kindly let me know if you have any issue.

B.R

Kan

1,880 Views
Amit_Kumar1
Senior Contributor II

Hi kan

I made it working. thanks for your support. I did it with SPI only for stoping the clock I used delay so it is now sending the data. but now only thing I need to do is eliminate the noise. That I will try from the product's app note.

Thanks and Regards

Amit Kumar