I am using a sensor with SSI protocol, How can we interface it with K20 uc?
Thanks and Regards
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;
//Set SCK as SCK function
//Set SCK as GPIO, output high
Hope that helps,
Do you mean Synchronous Serial Interface? I think it can be connected with SAI interface of K20.
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
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
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.
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.
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.
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.
Retrieving data ...