I am using an NHS3152 device to generate a triangular waveform via the DAC and measure this signal with the ADC. The configuration is as follows
The DAC output is configured on pin ANA0_5 using the function Chip_ADCDAC_SetMuxDAC with the parameter ADCDAC_IO_ANA0_5.
The ADC input is configured on pin ANA0_3 using Chip_ADCDAC_SetMuxADC with the parameter ADCDAC_IO_ANA0_3.
A cable physically connects ANA0_5 to ANA0_3 to loop the signal.
Technical Details:
The IOCON configuration for both pins is set to analog mode (IOCON_FUNC_1).
The DAC is operated in SINGLE_SHOT mode to update the output on each write, although switching to CONTINUOUS mode does not resolve the issue—it only slightly affects the signal quality.
The ADC runs in continuous mode, with detection thresholds set to 1500 (LOW_THRESHOLD) and 2000 (HIGH_THRESHOLD).
The code generates a lookup table (LUT) for a triangular waveform (ranging from DAC_MIN_VALUE to DAC_MAX_VALUE), and a 16-bit timer periodically triggers the DAC update.
Despite a clearly observable triangular signal on the output, no ADC interrupt is triggered and no ADC conversion result is recorded.
Troubleshooting Steps Taken:
I verified that the MUX selection functions (Chip_ADCDAC_SetMuxADC and Chip_ADCDAC_SetMuxDAC) use the correct channels (channel 3 for ADC and channel 5 for DAC) as specified in the documentation (Figure 90, Chapter 9.4 of the UM10876 manual).
I confirmed that the IOCON settings for both pins are correctly set to analog mode (IOCON_FUNC_1) and that the cable connecting ANA0_5 to ANA0_3 is properly installed with a common ground.
I tested modifying the check for the ADC conversion ready flag (ADCDAC_INT_CONVERSION_RDY_ADC) in the ADC interrupt routine, but this did not change the behavior.
Changing the DAC mode between SINGLE_SHOT and CONTINUOUS has no significant effect on the issue, apart from a slight variation in the signal quality.
Request for Assistance:
I would appreciate your help in understanding whether:
The current configuration using two different pins via the analog multiplexer is correct for the shared ADCDAC block on the NHS3152, considering it operates with a round-robin scheduler.
There are additional constraints (such as timing or configuration sequence issues) that might prevent the ADC interrupts from being triggered in this setup.
Alternative modifications, such as testing the ADC in single-shot mode or using the same channel for both ADC and DAC, could resolve the issue.
Please find attached the complete code used for this configuration. Thank you in advance for your assistance and suggestions.
Regards,
Thomas
Solved! Go to Solution.
I wanted to update you on the ticket I submitted. The main issues were:
The triangular waveform generated by the DAC was too fast. This fast signal did not give the ADC enough time to capture the values correctly.
I mistakenly used the wrong name for the interrupt handler. It must be named ADC_IRQHandler(void) instead of ADCDAC_IRQHandler(void).
After lowering the frequency (or increasing the number of samples per period) and renaming the interrupt routine, the ADC started working as expected.
I wanted to update you on the ticket I submitted. The main issues were:
The triangular waveform generated by the DAC was too fast. This fast signal did not give the ADC enough time to capture the values correctly.
I mistakenly used the wrong name for the interrupt handler. It must be named ADC_IRQHandler(void) instead of ADCDAC_IRQHandler(void).
After lowering the frequency (or increasing the number of samples per period) and renaming the interrupt routine, the ADC started working as expected.