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.

CC1310: 请教关于Sensor Controller pulse count功能

Part Number: CC1310
请教关于Sensor Controller pulse count功能,帮助文档中并没有写清楚,如下
gpioGenPulseTrain cfg.pulseCount这个参数是用来存放读取的脉冲个数么?那么pcntGetValue(output.measuredPulseCount);这句的作用是什么?AUXIO_O_PULSE_OUTPUT这个参数有事什么意思?输入的脉冲数并没有牵扯到任何输出引脚啊?
pcntEnable(PCNT_INPUT_AUXIO_BASE + AUXIO_I_PULSE_CNT_INPUT);
gpioGenPulseTrain(AUXIO_O_PULSE_OUTPUT, 0, 24, 24, cfg.pulseCount);
gpioDisableInputBuf(AUXIO_I_PULSE_CNT_INPUT);
pcntGetValue(output.measuredPulseCount);
gpioEnableInputBuf(AUXIO_I_PULSE_CNT_INPUT);
pcntDisable();
  • gpioGenPulseTrain cfg.pulseCount这个参数是用来存放读取的脉冲个数么?

    它是产生脉冲的长度

    gpioGenPulseTrain
    Prototype: gpioGenPulseTrain(#auxio, #polarity, #activeDuration, #inactiveDuration, count)
    
    Generates a pulse train with specified polarity and active/inactive duration on the specified AUX I/O pin.
    
    Parameter value(s)
    #auxio - The GPIO pin to be pulsed (index of AUX I/O pin)
    #polarity - The value of the pulse (1 = high, 0 = low) during the active phase
    #activeDuration - Duration of the active phase, in number of 12 MHz periods (1 to 256)
    #inactiveDuration - Duration of the inactive phase, in number of 12 MHz periods (3 to 256)
    count - Length of the pulse train in number of pulses (1 to 65535)

    那么pcntGetValue(output.measuredPulseCount);这句的作用是什么?
    获取脉冲串中的脉冲数

    AUXIO_O_PULSE_OUTPUT这个参数有事什么意思?输入的脉冲数并没有牵扯到任何输出引脚啊?

    这在注释中有说明,最后又到输入

    // Generate a pulse train on AUXIO_O_PULSE_OUTPUT, which is looped back
    // to AUXIO_I_PULSE_CNT_INPUT
    gpioGenPulseTrain(AUXIO_O_PULSE_OUTPUT, 0, 24, 24, cfg.pulseCount);
     
  • 您贴的代码我有看到过,其实不是很明白,

    gpioGenPulseTrain(AUXIO_O_PULSE_OUTPUT, 0, 24, 24, cfg.pulseCount);关于这个函数:第一个参数是不是要填写引脚如果是要填哪一个引脚,填写脉冲输入引脚我这边提示代码有问题,第二个应该是脉冲极性0是低电平,第三个是低电平的时间,第三个是高电平的时间,第四个是一个脉冲的总时间是么?
  • 第四个是一个脉冲的总时间是么?

    是的

  • Sensor Controller怎样使用ADC读取VDDS电压值,文档中未找到相关资料

  • 这是sensor Controller pulse count不太相关,是另一个主题的问题了,建议你重开一个新帖,方便其他人查找

  • sensor Controller pulse count,不能同时对两个及以上引脚进行计数么?由于传感器触发之后需要等待脉冲到来,挨个计数比较浪费时间。

  • 脉冲计数器一次只能在一个输入引脚上使用,sensor Controller 只是一个协处理器,资源没有那么多