CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Quadrature encoder with CCP and no software

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
willd1971



Joined: 24 May 2011
Posts: 5
Location: UK

View user's profile Send private message Visit poster's website

Quadrature encoder with CCP and no software
PostPosted: Fri May 27, 2011 7:06 am     Reply with quote

Has anyone made a quadrature encoder interface using CCP modules?

I have made one in the past, but it depended on priority interrupts for the software to have a look at the 2 signal levels after a level change to work out which direction the encoder clicked and to update the position counter accordingly. As the quadrature signal frequency increases the bandwidth requirements on the processor rise, eventually there is no resource left for anything other than decoding the quadrature interface...

I think it should be possible to create a quadrature decoding interface in a suitable PIC18 device using CCP and ECCP modules and not using software in the process - what do you think?
_________________
William
http://www.labtronix.co.uk
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 27, 2011 7:23 am     Reply with quote

I have to ask, what else is the PIC going to do ? Really, if you're that tight on code/speed that an encoder routine takes all the PICs time, you have the wrong algorithm for the encoder.Options include using a PIC with QEI or a dedicated chip like the LS7166 type series. I've never used a QEIed PIC but for 20 years used the LS7166 type products in PID true servo controllers running around 20KHz. You could of course take an 8 pin PIC and dedicate it to be an encoder interface. Depending on required 'options' the small PIC might be cheaper than the LS, but consider YOUR time in 'cloning' what you get in the LS series. I'm sure there are other, newer QEI chips out there, but I'm just super happy with the tried and true LS.
andrewg



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

PostPosted: Fri May 27, 2011 7:42 am     Reply with quote

The best PIC18 is one with a QEI built-in! The bottom four PIC18s in the table on this page have QEI support:

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2125&param=en543012#P289_3746
_________________
Andrew
willd1971



Joined: 24 May 2011
Posts: 5
Location: UK

View user's profile Send private message Visit poster's website

PostPosted: Fri May 27, 2011 7:46 am     Reply with quote

Wow! Things have moved on - that's exactly perfect! Thanks for your help Very Happy
_________________
William
http://www.labtronix.co.uk
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group