Please help check on SPI timing diagram

Discussion in 'Embedded Systems and Microcontrollers' started by richiechen, Dec 7, 2012.

  1. richiechen

    Thread Starter Member

    Jan 1, 2012
    93
    0
    Hi all

    [Problem solved]

    I am trying to use PIC30F2012 to control a DAC
    (AD5760, http://www.analog.com/static/imported-files/data_sheets/AD5760.pdf)

    through SPI.

    However, it just does not work....
    Could you please help me check on the SPI timing sequence or any problem?
    The attached files are the timing diagrams captured.

    The first command sent is: 0x200000, which is to configure the DAC
    The second command sent is: 0x1fff00, which is to make the output as 0xfff0.
    After the second command, a latch* falling edge will be given to update the output.


    [Problem solved.]

    The timing diagram is correct. When I was trying to test the maximum and minimum value of DAC, I just used 0xffff and 0x0000 and expecting them to have minimum and maximum values.

    However 2's complement is adopted by DAC as a default value. As a result, there is no big difference between these two values. And I though I made s mistake on SPI.

    Now it works fine.

    Thank you all.

    Thank you very much.
    Regards
    Richie
     
    Last edited: Dec 7, 2012
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    What speed is your SCLK(CLK) operating at?
     
  3. richiechen

    Thread Starter Member

    Jan 1, 2012
    93
    0
    Very slow, only at 5kHz.

    Regards
    Richie
     
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Two things I would say to do, first, post your schematic. Second, determine if you are getting output on pin 11(SDO of the DAC)....
     
  5. richiechen

    Thread Starter Member

    Jan 1, 2012
    93
    0
    Thanks for your help.
    The attachment is the schematic.

    The pins are connected in the correct way I think

    Regards
    Richie
     
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,605
    There is no PIC on that schematic. Did you post the one you meant?
     
  7. richiechen

    Thread Starter Member

    Jan 1, 2012
    93
    0
    Thanks Ernie. I did post the one I meant. The port is implying PIC.

    Problem solved.

    The timing diagram is correct. When I was trying to test the maximum and minimum value of DAC, I just used 0xffff and 0x0000 and expecting them to have minimum and maximum values.

    However 2's complement is adopted by DAC as a default value. As a result, there is no big difference between these two values. And I though I made s mistake on SPI.

    Now it works fine.

    Thank you all.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,605
    Only to those with the MENTAL TELEPATHY 2.0 interface installed.
     
    richiechen likes this.
Loading...