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 on DSPIC30F4011. Code not working!!!

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



Joined: 18 Jul 2013
Posts: 1

View user's profile Send private message

QEI on DSPIC30F4011. Code not working!!!
PostPosted: Thu Jul 18, 2013 3:25 pm     Reply with quote

I am trying to use the QEI module of DSPIC30F4011 to read the encoder counts. I am using MPLAB IDE to monitor the internal register POSCNT. On applying the sequence on QEA and QEB, the POSCNT is not changing at all. I am compiling the following code.
Code:

#include <30F4011.h>
#fuses FRC_PLL16,NOWDT,PROTECT,PUT64
#use delay(clock=120000000)

void main(void)
{
int16 value;
set_tris_b(0xFFFF);
setup_adc_ports(no_analogs);
setup_qei(QEI_MODE_X2); 
qei_set_count(0b1);
value=0;

while(1)
{
value=qei_get_count();
delay_us(10);
}
}
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