This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PIC单片机与DAC7615的SPI通信有问题

今天在测试的时候按照时序图上面 写了下面这些   但是测试发现有错误,希望会的能指点一下

while(1)
{

PORTBbits.RB0=1; CS置高
PORTBbits.RB1=1;LOADREG置高

PORTBbits.RB0=0; CS置低

sendSPI(0x0F);发2个字节

delay;

sendSPI(0xFF);

PORTBbits.RB0=1; CS置高

PORTBbits.RB1=0;LOADREG置低

}

  • pic单片机在操作的时候要按字节操作,比如,PORTBbits.RB0=1; PORTBbits.RB1=1;应写成:PORTB=0x01;PORTB=0x03;否则可能会出问题

x 出现错误。请重试或与管理员联系。