Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

TRAVEO™ T2G Forum Discussions

juan_2023
Level 1
Level 1
First like given First question asked Welcome!

请问带M的ADC如何配置,我需要用到10路AD,其中有3路为带M的ADC,但同样的配置此3路AD毫无作用,测量值始终为0。

//ADC_0_M
{
.preconditionTime = 0u,
.powerupTime = 0u,
.enableIdlePowerDown = false,
.msbStretchMode = CY_ADC_MSB_STRETCH_MODE_1CYCLE,
.enableHalfLsbConv = 0u,
.sarMuxEnable = true,
.adcEnable = true,
.sarIpEnable = true,

},

//ADC_0_M
{
.triggerSelection = CY_ADC_TRIGGER_OFF,
.channelPriority = 0,
.preenptionType = CY_ADC_PREEMPTION_FINISH_RESUME,
.isGroupEnd = true,
.doneLevel = CY_ADC_DONE_LEVEL_PULSE,
.pinAddress = (cy_en_adc_pin_address_t)ADC0_M_DETECT,//P11.0 CY_ADC_PIN_ADDRESS_VMOTOR
.portAddress = CY_ADC_PORT_ADDRESS_SARMUX0,
.extMuxSelect = 0,
.extMuxEnable = true,
.preconditionMode = CY_ADC_PRECONDITION_MODE_OFF,
.overlapDiagMode = CY_ADC_OVERLAP_DIAG_MODE_OFF,
.sampleTime = 60,
.calibrationValueSelect = CY_ADC_CALIBRATION_VALUE_REGULAR,
.postProcessingMode = CY_ADC_POST_PROCESSING_MODE_NONE,
.resultAlignment = CY_ADC_RESULT_ALIGNMENT_RIGHT,
.signExtention = CY_ADC_SIGN_EXTENTION_UNSIGNED,
.averageCount = 0,
.rightShift = 0,
.rangeDetectionMode = CY_ADC_RANGE_DETECTION_MODE_INSIDE_RANGE,
.rangeDetectionLoThreshold = 0x0000,
.rangeDetectionHiThreshold = 0x0FFF,
.mask.grpDone = true,
.mask.grpCancelled = false,
.mask.grpOverflow = false,
.mask.chRange = false,
.mask.chPulse = false,
.mask.chOverflow = false,

},

 

Cy_Adc_Channel_Enable(&PASS0_SAR0->CH[ADC0_M_DETECT]);

请提供帮助,谢谢

0 Likes
1 Solution
Jimmy-Liu
Moderator
Moderator
Moderator
First like received 100 sign-ins 50 replies posted

你好,

后缀带M的是3个motor用途的ADC信号做同步用的,所以还请使用其它不带M的引脚。

View solution in original post

1 Reply
Jimmy-Liu
Moderator
Moderator
Moderator
First like received 100 sign-ins 50 replies posted

你好,

后缀带M的是3个motor用途的ADC信号做同步用的,所以还请使用其它不带M的引脚。