Microchip
直播中

童霏

8年用户 183经验值
私信 关注
[问答]

是否有一些LIBS例子可以用来快速检查传感器的精度

大家好,我没有更新关于PIC的一段时间,但我又回来了:)我正在寻找用PIC32实现一个快速的解决方案(实际上,我仍然在检查这个微控制器是否能用于识别步进电机的正交线性编码器的计数),并且我需要一个我想知道,是否有一些LIBS/例子可以用来快速检查传感器的精度,比如它对于ARDUINO的存在吗?你建议我从哪里开始?非常感谢你!

以上来自于百度翻译


      以下为原文

    Hello guys, I was not updated for a while about PIC, but I am back again :)

I am looking for implementing a quick solution with PIC32 (Actually I am still examining if this microcontroller would be good to use for identifying the counts of a Quadrature linear encoder of a stepper motor) and I need a quick setup.

I was wondering, are there are some libs/examples I could use for quickly checking the accuracy of the sensor, like it exists for Arduino for example? Where do you suggest that I begin? Thank you so much in advance !

回帖(3)

阮盛婧

2019-2-15 07:53:10
QEI在PIC32 MK芯片MC版本上运行良好。这样做:QIICON=0;QII1CONBITS。QEEEN=1;然后从POS1CNT中读取计数。写入POS1CNT预置或清除计数。这就是全部。我已经在MC 100引脚设备上完成了所有6个QEIS,并且我可以确认它们运行良好。

以上来自于百度翻译


      以下为原文

    QEI works well on the PIC32MK  chips MC version. Just do this:
 
    QEI1CON = 0 ;
    QEI1CONbits.QEIEN = 1 ;
 
and then read from POS1CNT for the count. Write to POS1CNT to preset or clear the count.  That is all.
 
I have done this with all the 6 QEIs on the MC 100 pin device, and I can confirm that they work well.
 
Vaidi.
举报

阮盛婧

2019-2-15 08:06:10
哎呀,我忘了提一下:拿着闪烁的LED样本在2.2XXX中选择项目的MK配置:这是给GP设备的。复制这个配置并把名字改成MC设备。如果你想保存GP代码,请把GP文件夹拷贝到SRCStaseSyfIg文件夹中示例并将其重命名为MK,然后使用它。

以上来自于百度翻译


      以下为原文

    oops, I forgot to mention:
 
take the blinking LED sample in Harmony 2.xx
choose the MK configuration of the project : this is for the GP device.
Copy this configuration and change name to the MC device.
If you want to save the GP code, take a copy of the GP folder in the srcsystem_config folder of the example and rename it to MK and then use it.
 
举报

张浩

2019-2-15 08:14:58
唷,我还没有真正了解QEI。更糟糕的是,我在DSPICE端有一个非常不可维护的窍门(链接QEI CCMP到一个RPLE输出(因为虚拟引脚是非功能的,勘误表),然后使用这个PIN作为外部时钟到一个定时器,你用它作为OC的时钟源,并且Prestto,你。通过和更重要的是,过滤QEI几乎免费(读取减半的频率)

以上来自于百度翻译


      以下为原文

    Phew, I haven't really got to the QEI yet.
Worse, I have a pretty unmaintainable trick on the dspice side to port  (link QEI CCMP to a RPable output (because virtual pins are non functional, errata), then use that pin as external clock to a timer that you use as clock source to a OC, and presto, you passed through and more importantly, filtered QEI for almost free (read halving the frequency))
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分