SPI (master) for PIC18F6680 (10Mhz 4xPLL)

Discussion in 'Embedded Systems and Microcontrollers' started by weeb0, Aug 16, 2006.

  1. weeb0

    Thread Starter New Member

    Jun 13, 2005
    5
    0
    Hi,

    I have a questions regarding the connection to device (DAC) with the SPI protocol.

    Often, I have to write to the device 2 times to get the correct Vout voltage of the DAC.

    I use the following code: (Read the comments to know more about my question)


    The SSPCON1 is as follow :
    Code ( (Unknown Language)):
    1.  
    2.     SSPCON1           = 0x02;
    3.     SSPCON1bits.CKP   = 1;
    4.     SSPSTATbits.SMP   = 0;
    5.     SSPSTATbits.CKE   = 0;
    6.     SSPSTATbits.SSPEN = 0;
    7.  
    The device is a TI D A C 7 6 1 5.


    Thank your for your help, I'm desesperated. lol
     
Loading...