View previous topic :: View next topic |
Author |
Message |
barnal
Joined: 27 Jun 2012 Posts: 8 Location: Hungary
|
QEI dsPIC30F6010 |
Posted: Wed Jun 27, 2012 5:09 am |
|
|
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
|
|
Posted: Wed Jun 27, 2012 8:32 am |
|
|
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
|
|
Posted: Wed Jun 27, 2012 11:16 pm |
|
|
thank you for your help very much, I try it soon |
|
|
|