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.

TLC3544: 如何读取通道值?

Part Number: TLC3544


请问我的代码由什么问题吗?我读取不到ADC 0123通道的值。

已经通过示波器查看SPI接口 Data changed on SCK 1st edge, captured on 2nd  , SCK Signal is Active Low (idles high).

感觉SPI通讯时序没有错误,就是读出来的ADC值始终是32772不会改变

初始化代码:

void InitTLC3544 (void){
    ADC_CSN(0);
    SPI2_ReadWrite(0xA000,RW_16_Bit);
    ADC_CSN(1);
    Delay_ms(10);

    ADC_CSN(0);
    SPI2_ReadWrite(0xA800,RW_16_Bit);
    ADC_CSN(1);
    Delay_ms(10);
}

读取ADC通道值代码:

Read_Once_TLC3544 (void){
    ADC_CSN(0);
    print("\r\n 0ch = %d",SPI2_ReadWrite(0x0000,RW_16_Bit));
    ADC_CSN(1);
    Delay_ms(100);

    ADC_CSN(0);
    print("\r\n 1ch = %d",SPI2_ReadWrite(0x1000,RW_16_Bit));
    ADC_CSN(1);
    Delay_ms(100);

    ADC_CSN(0);
    print("\r\n 2ch = %d",SPI2_ReadWrite(0x2000,RW_16_Bit));
    ADC_CSN(1);
    Delay_ms(100);

    ADC_CSN(0);
    print("\r\n 3ch = %d",SPI2_ReadWrite(0x3000,RW_16_Bit));
    ADC_CSN(1);
    Delay_ms(100);

}