Hi Simon
Using a function like QEI that is not in the mbed library requires a little research, of which getting the CMSIS register names is just the first step. Getting QEI is on my to do list and so I have made a start by building this crib.
/*------------- Quadrature Encoder Interface (QEI) ---------------------------*/
CMSIS Name Handbook Name Function
572 typedef struct
573 {
574 __O uint32_t QEICON; // QEICON ( Control)
575 __I uint32_t QEISTAT; // QEISTAT ( Status)
576 __IO uint32_t QEICONF; // QEICONF ( Configure)
577 __I uint32_t QEIPOS; // QEIPOS ( Position)
578 __IO uint32_t QEIMAXPOS; // QEIMAXPOS ( Max Position)
579 __IO uint32_t CMPOS0; // CMPOS0 ( Position Compare 0)
580 __IO uint32_t CMPOS1; // CMPOS1 ( Position Compare 1)
581 __IO uint32_t CMPOS2; // CMPOS2 ( Position compare 2)
582 __I uint32_t INXCNT; // INXCNT ( Index Count)
583 __IO uint32_t INXCMP; // INXCMP ( Index Compare)
584 __IO uint32_t QEILOAD; // QEILOAD ( Velocity Timer Reload)
585 __I uint32_t QEITIME; // QEITIME ( Velocity Timer)
586 __I uint32_t QEIVEL; // QEIVEL ( Velocity Counter)
587 __I uint32_t QEICAP; // QEICAP ( Velocity Capture)
588 __IO uint32_t VELCOMP; // VELCOMP ( Velocity Compare)
589 __IO uint32_t FILTER; // FILTER ( Digital Filter)
590 uint32_t RESERVED0[998];
591 __O uint32_t QEIIEC; // QEIIEC ( Interrupt Enable Clear)
592 __O uint32_t QEIIES; // QEIIES ( Interrupt Enable Set)
593 __I uint32_t QEIINTSTAT; // QEINTSTAT ( Interrupt Status)
594 __I uint32_t QEIIE; // PCQIE ( QIE Interrupt Enable = 1 Disabled = 0)
595 __O uint32_t QEICLR; // QEICLR ( Interrupt Status Clear)
596 __O uint32_t QEISET; // QEISET ( Interrupt Status Set)
597 } LPC_QEI_TypeDef;
/*--------------------- Other Regs ----------------------------*/
LPC_SC->PCONP // PCONP ( Power Enable)
(not found) // PCLK_QEI
(PINSEL and PINMODE regs not found) //
(NVIC registers CMSIS name not found)
The idea is to match the CMSIS register names with the names used in the User Manual and the register function. You will see that I still have some work to do in the Other Register part at the bottom of the table. With the table complete, writing code is a do-able task.
It is not exactly like decoding Linear B, but there are similarities.
Hi,
The Led's which are connected to the board are pin no 34 & 37 (i am considering only two port pins ) which are also encoder i/p to the microcontroller.......i was planning to remove the led's and give my encoder input's ......please suggest me if i am going wrong........
The other issue is about the programming part . The online compiler doesnt support quadrature encoder interface(i mean no built in library for encoder) .......So suggest me any offline line compiler for the same......