Author Topic: dsPIC33 QEI Guidance Appreciated  (Read 4122 times)

0 Members and 1 Guest are viewing this topic.

Offline Tin Duc VoTopic starter

  • Contributor
  • Posts: 41
dsPIC33 QEI Guidance Appreciated
« on: June 30, 2016, 07:27:31 pm »
Hey, everyone

I have another question. It seems that everything on dsPIC33 is a bit hard to find information on. Right now, I'm trying to use the QEI module, but I do not understand how to even use the peripheral library. I looked in the dsPIC33 family QEI datasheet, the dsPIC33EP32MC204 datasheet, the 93002A Microchip datasheet, and outline, but I can't find any place that explains the various registers. Additionally, I do know how one would determine the direction of either the position or velocity.

The functions are:
3.4                    Read32bitQEIxPositionCounter
3.5                    Read32bitQEIxCapture
3.6                    Read32bitQEIxIndexCounter
3.7                    Read32bitQEIxIntervalTimer
3.8                    Read32bitQEIxVelocityCounter
3.9                    Write32bitQEIxGreaterEqual
3.10                 Write32bitQEIxIndexCounter
3.11                 Write32bitQEIxInitialization
3.12                 Write32bitQEIxIntervalTimer
3.13                 Write32bitQEI1LesserEqual
3.14                 Write32bitQEIxPositionCounter

1. I am unsure how the position/velocity direction work
2. I do not know what the capture read is supposed to do
3. I do not know if the only way to infer position sign is to use the index counter and whether is overflowed.
4. I think two logical things for the greater or lesser than functions to do are to either set the values at which interrupts will be greater and/or set a maximum/minimum vaue for the position counter.

In general, I just do not understand. I've looked everywhere I could. I also signed up for the microchip forums, but I haven't been admitted. If someone could point me in the right way, that would be lovely. Thank you.
 

Offline andre_teprom

  • Regular Contributor
  • *
  • Posts: 72
  • Country: br
    • Aluis-Rcastro
Re: dsPIC33 QEI Guidance Appreciated
« Reply #1 on: July 01, 2016, 12:09:47 am »
I used the dsPIC30F more than a decade ago, but I had to do myself some calculations. For example, to obtain direction it was done just subtracting two consecutive readings, if greater or smaller than zero, meant clockwise or opposite direction. To obtain the speed, I had to make the division of the previous result by a constant value, proportional to the sample interval.
"Part of the world that you live in, You are the part that you're giving" ( Renaissance )
 

Offline Tin Duc VoTopic starter

  • Contributor
  • Posts: 41
Re: dsPIC33 QEI Guidance Appreciated
« Reply #2 on: July 03, 2016, 12:23:33 am »
Thanks Andre. I know it could be done that way, but it seems like there is hardware support for velocity and the other stuff too. but with velocity, you need a sign for direction. For some reason, the velocity is returned as an unsigned value.
 

Offline Maxlor

  • Frequent Contributor
  • **
  • Posts: 565
  • Country: ch
Re: dsPIC33 QEI Guidance Appreciated
« Reply #3 on: July 03, 2016, 12:43:15 am »
The Datasheet for your micro only contains a very brief register summary for most peripherals. To learn how the peripherals work, you need to look at the PDFs listed under Documentation/Reference Manual (near the bottom) on this page: http://www.microchip.com/dsPIC33EP32MC204 . The one labelled dsPIC33E/PIC24E FRM, Quadrature Encoder Interface should contain the explanations you seek.
 

Offline Tin Duc VoTopic starter

  • Contributor
  • Posts: 41
Re: dsPIC33 QEI Guidance Appreciated
« Reply #4 on: July 11, 2016, 03:24:21 pm »
Thanks. I had a look at the datasheet already, but I still don't understand. I will have another look.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->