This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI communication between PIC24H and ADuCM360

My project have PIC as master and ADC ADuCM360 as slave and PIC24HJp128310A sends command to ADC via SPI and ADC should reply with 4 bytes of ADC data back at 8Mbps speed. I am not able to achieve this Please help me with this. I am doing this in following way.

ADC keeps polling its one of its digital I/O, and when PIC goes to get data from it, it pulls this pin down and and waits for certain time while ADC accumulated data and puts this in SPITX FIFO(4 byte deep) register, then only pic initiates the Chip select and sends 4 dummy bytes to ADC and expecting 4 valid data in return from its SPI receive buffer one by one without asserting and de-asserting chip select again as i use continuous mode of transfer in ADC. But problem is i am not getting any data back.

I am using keil for ADCuCM 360 c program. Can somebody say whether i am doing correctly, or i am missing something, user guide of ADuCM360 is little confusing to me.

one more question what is meaning of flushing the RX or TX in ADuCM360 paralance.

I can send my program if needed.

Thank you very much
I will really appreciate early reply.

Parents
  • No. No one can say what you are doing wrong, because you have given too little information.

    You haven't told us if the Cortex chip sees the pin requesting data.
    You haven't told us if the Cortex does manage to start an ADC conversion.
    You haven't told us if the Cortex does manage to get any ADC value to feed into the SPI FIFO.
    You haven't told us if there is enough time for the program to put the ADC value into the SPI FIFO before the master starts the transfer.
    You haven't told us if the PIC manages to toggle the slave-select line.
    You haven't told us if the PIC does produce clock signals for the 4-byte transfer - and with the same polarity and phase as the Cortex side expects.
    You haven't told us if the Cortex MISO line does seem to activate when the slave-select gets activated.
    You haven't told us if the Cortex MISO line produces any data when the clock starts to tick.
    You haven't told us how fast you internally clock the SPI of the ADC chip. But you run the master at 8Mbit/s. And the slave requires the clock to be high for at least 62.5ns and low for at least 62.5ns. An 8MHz clock must be absolutely perfectly symmetrical and with zero rise and fall times to manage that. The timing diagram shows the SPI clock period as being the sum of:
    tSR+tSH+tSF+tSL
    That can't be fulfilled with a 8MHz clock since you can't reach zero rise and fall times, which means the rise and fall times will make either tH or tL or both shorter than the 62.5ns minimum specified.

    Flushing? To make sure you don't have old, partial, data left in the FIFO.

Reply
  • No. No one can say what you are doing wrong, because you have given too little information.

    You haven't told us if the Cortex chip sees the pin requesting data.
    You haven't told us if the Cortex does manage to start an ADC conversion.
    You haven't told us if the Cortex does manage to get any ADC value to feed into the SPI FIFO.
    You haven't told us if there is enough time for the program to put the ADC value into the SPI FIFO before the master starts the transfer.
    You haven't told us if the PIC manages to toggle the slave-select line.
    You haven't told us if the PIC does produce clock signals for the 4-byte transfer - and with the same polarity and phase as the Cortex side expects.
    You haven't told us if the Cortex MISO line does seem to activate when the slave-select gets activated.
    You haven't told us if the Cortex MISO line produces any data when the clock starts to tick.
    You haven't told us how fast you internally clock the SPI of the ADC chip. But you run the master at 8Mbit/s. And the slave requires the clock to be high for at least 62.5ns and low for at least 62.5ns. An 8MHz clock must be absolutely perfectly symmetrical and with zero rise and fall times to manage that. The timing diagram shows the SPI clock period as being the sum of:
    tSR+tSH+tSF+tSL
    That can't be fulfilled with a 8MHz clock since you can't reach zero rise and fall times, which means the rise and fall times will make either tH or tL or both shorter than the 62.5ns minimum specified.

    Flushing? To make sure you don't have old, partial, data left in the FIFO.

Children