Other Parts Discussed in Thread: HALCOGEN
Hello,
I am using a TMS570LS1224 µC in a project, and have to interface it with several sensors including an ADIS16210 from AnalogDevice ( )
I have issues with the SPI communication, and I would like any help on it :-)
1) As you can see in the ADIS16210 datasheet page 7 of 20: the clock configuration required is Polarity = 1, Phase = 1. I configured this (with halcogen), but it did not work. Later, giving more attention to chronograms on page 8 of 20 of this datasheet, and comparing to the descriptions and chronograms of the page 588/589 of the TMS570 techmanual, I realized that the correct configuration seems to be Polarity = 1 and Phase = 0. My qyestion is: why such a difference between the configuration given in the sensor datasheet and the actual working confiugration ont µC ? I thought Phase en Polarity where standaradised parameters, with same behaviour for same values ?
2) When i switched from POL/PHASE = 11 to POL/PHASE = 1/0, it works better but still not perfectly: sometimes I miss data and dont know why... I'm gonna have a look on a scope, but something retained my attention: on the sensor datasheet, it is specified that de delay between 2 SPI transaction must be at least of 40µs. I wanted to program it in halcogen, using the wdelay parameter but here is my problem: the wdelay is computed dividing the VCLK1 frequency by a 8 bits prescaler. With a VCLCK of 80Mhz, I can't reach 40µs of delay, but only something around 2µs..
I went to the clock tree parameter and downed the VCLCK1 frequency to 10 MHz (minimum), but then the maximum prescaler value in halcogen is 63, wich leads to a wdelay of 6.5µs: this is way too short for the communication. Any clue what I am supposed to do ? For now I do 1 transaction, wait for 100 µs at least (using freeRTOS) and then do the second transaction, but I would like to have something cleaner.
Now :
spiTransmitData(spiREG3, &(Accelerometer->spi_conf_register), 1, TxData);
vTaskDelay(20);
spiReceiveData(spiREG3, &(Accelerometer->spi_conf_register), 1, RxData);
and I'd like to do
spiTransmitAndReceiveData(spiREG3, &(Accelerometer->spi_conf_register), 2, TxData, RxData); respecting the correct wdelay
Thanks