This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TM4C1294NCPDT: Technical Support

Part Number: TM4C1294NCPDT


Tool/software: Code Composer Studio

 Hi,

I want a technical support for me with an encoder module problem as in direction count mode it does not work, only work in quadrature mode and i ask before in discussion board and cannot solve the problem til now this my mail if you can help me solve this problem.

- mail address

alimagdi377@gmail.com

 - Here is pin configuring:

// step 1. CONFIGURE GPIO PINS TO WORK AS ENCODER PIN
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL);
GPIOPinConfigure(GPIO_PL1_PHA0);
GPIOPinConfigure(GPIO_PL2_PHB0);
GPIOPinConfigure(GPIO_PL3_IDX0);

// step 2. Enable ENCODER PINS
SysCtlPeripheralEnable(SYSCTL_PERIPH_QEI0);
GPIOPinTypeQEI(GPIO_PORTL_BASE,GPIO_PIN_1); // channel A
GPIOPinTypeQEI(GPIO_PORTL_BASE,GPIO_PIN_2); // channel B
GPIOPinTypeQEI(GPIO_PORTL_BASE,GPIO_PIN_3); // channel I

// step 3. Enable ENCODER MODULE
QEIEnable(QEI0);

// step 4. Enable INDEX INTERRUPT
QEIIntEnable(QEI0,QEI_INTINDEX);

// step 5. pad configuration
GPIOPadConfigSet(GPIO_PORTL_BASE, GPIO_PIN_1 | GPIO_PIN_2, GPIO_STRENGTH_8MA_SC, GPIO_PIN_TYPE_STD_WPU);

- Here is module configuring to work in Direction count mode:

QEIConfigure(QEI0,(QEI_CONFIG_CAPTURE_A | QEI_CONFIG_NO_RESET | QEI_CONFIG_CLOCK_DIR | QEI_CONFIG_NO_SWAP),2500); 

- Here is the clock setting i use:

SysCtlClockFreqSet(SYSCTL_OSC_INT,16000000);

  • Hello,

    First of all, why are you using such a slow system clock speed? You should run from the VCO and use a higher clock speed. Most users have it at 120 MHz. The code to do that is:

        ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                    SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
                    SYSCTL_CFG_VCO_480), 120000000);

    Secondly, can you better describe the issue? Have you determined how it is not working (i.e. what results are you getting/not getting)? What Encoder module are you using? What is your goal here - 'direction count' is not something I am familiar with (keep in mind I am TM4C device expert, not an Encoder module expert).

    Taking a stab at what might be going on... you talk about direction count, so are you trying to detect changes in Direction? If so you need to use QEI_INTDIR and not QEI_INTINDEX.