Post Go back to editing

Problem SPI communication with AD1940


I make the prototype of active crossover with AD1940 and PIC18F67J60.

But I have  a problem that SPI communication between PIC18F67J60 and AD1940 during test prototype board.

I made test code for PIC18F67J60 that read core register (address 2642) but after running code, read data is 0x0000.

SPI configuration of PIC18F67J60 is as follows.

1) PIC18F67J60's SPI mode 3: SPI1CON.CKP = 1, SPI1STAT.SKE = 0; SPI1STAT.SMP =0;

2) SPI speed is set to FOSC/64 (FOSC = 25Mhz)

Behaviour of test code

1) set AD1940 SPI select pin to low.

2) write "READ (0x01)" command to SPI

3) read two bytes from SPI

4) set AD1940 SPI select pin to high.

When I probed CDATA signal of AD1940, there was no signal.

PS: AD1940 is work well with USBi, and also PIC18F67J60 is work well with other components (SPI SRAM, SPI EEPROM).

I don't know what's problem.

Is any one help me to solve this problem?

  • Hello,

    If you are reading, you should be probing the COUT signal, not the CDATA signal. Here's a table showing the pins and what they do:

    Pin Name
    Also known as...
    CLATCH SS (Slave Select) Pull low to select this chip on the bus
    CCLK SCLK (SPI Clock) This is the clock pin used to time the data transfer
    CDATA MOSI (Master Out Slave In) This is the data input to the slave device (used when the master writes data)
    COUT MISO (Master In Slave Out) This is the data output from the slave device (used when the master reads data)
  • Hi,

    I fixed problem, now uC and AD1940 do SPI communication well.