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

QEI dsPIC30F6010

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



Joined: 27 Jun 2012
Posts: 8
Location: Hungary

View user's profile Send private message AIM Address

QEI dsPIC30F6010
PostPosted: Wed Jun 27, 2012 5:09 am     Reply with quote

Can somebody help me?

How can I get the direction of the rotation in the ccs language from dsPIC30F6010?
And what is the qei_status() function?

sorry for my english...

thank you!!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19481

View user's profile Send private message

PostPosted: Wed Jun 27, 2012 8:32 am     Reply with quote

The QEI_STATUS function returns the contents of the QEICON register, 'anded' with 0x9800. So, bit 15 is 'CNTERR', bit 12 is INDX, and bit 11, is UPDN. All other bits are '0'.

So:
Code:

if (bit_test(qei_status(),11) ) {
   //Here going up

}
else {
   //Here down

}


Best Wishes
barnal



Joined: 27 Jun 2012
Posts: 8
Location: Hungary

View user's profile Send private message AIM Address

PostPosted: Wed Jun 27, 2012 11:16 pm     Reply with quote

thank you for your help very much, I try it soon
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