ADC Function on NHS31xx

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ADC Function on NHS31xx

1,004件の閲覧回数
pingmei
Contributor I

I am trying to test ADC example on NHS3152. The code is from

 

Example 3 - Single-shot Analog-to-Digital Conversion without IRQ

-------------------------------

    int adcInput;

    Chip_ADCDAC_Init(NSS_ADCDAC0);

    Chip_ADCDAC_SetMuxADC(NSS_ADCDAC0, ADCDAC_IO_ANA0_5);

    Chip_ADCDAC_SetInputRangeADC(NSS_ADCDAC0, ADCDAC_INPUTRANGE_WIDE);

    Chip_ADCDAC_SetModeADC(NSS_ADCDAC0, ADCDAC_SINGLE_SHOT);

    Chip_ADCDAC_StartADC(NSS_ADCDAC0);

    while (!(Chip_ADCDAC_ReadStatus(NSS_ADCDAC0) & ADCDAC_STATUS_ADC_DONE)) {

        ; /* Wait until measurement completes. For single-shot mode only! */

    }

    adcInput = Chip_ADCDAC_GetValueADC(NSS_ADCDAC0);

---------------------------------

However, it seems that ReadStatus never gets out of while loop.  I wonder if I miss something here …

タグ(1)
1 返信

815件の閲覧回数
Daniel_Popa
NXP Employee
NXP Employee

Hi pingmei

In this community space we cover MATLAB related questions. For your issues is better to look for help in this space: NFC | NXP Community 

Unfortunately, i can't move your question there, therefore you need to create another issue there. 

Thank you!

Daniel

0 件の賞賛
返信