Anyone who have used 56f84763 Quadrature decoder?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Anyone who have used 56f84763 Quadrature decoder?

514 Views
madhurhinge
Contributor I

Anyone who have used 56f84763 Quadrature decoder?

Labels (1)
0 Kudos
1 Reply

302 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

//The example code demonstrate how to initialize and run the Quadrature Encoder/Decoder

//The platform is CodeWarrior for mcu ver10.6 tools and TWR-8400(MC56F84789 is populated)

//scheme:use PWMA module to generate two signal with 90 degree shift, PWMA_SM0 is used to generate signal to simulate the PhaseA and PhaseB

//The PWMA_SM0 is set up in independent mode, and PWMA_0A and PWMA_0B signal have 90 degree phase shift and the same frequency which can simulate the PhaseA and PhaseB

//PWMA_0A outputs from GPIO_E1(pin11 of J501), PWMA_0B outputs from GPIO_E0 pin(pin9 of J501)

//PhaseA signal inputs from XB_IN2 or GPIOF6(pin 9 of J502)

////PhaseB signal inputs from XB_IN3 or GPIOF7(pin 11 of J502)

//on the TWR-8400 board, connect the pin9 of J501 to pin9 of J502, the pin11 of J501 to pin11 of J502 via cable, connect GPIOF0 pin to scope, user can see 1.137hZ signal

//explanation: PWMA_0A/PWMA_0B signal is 589Hz, the modulo of quadrature decoder is 1000, in the ISR of Modulo, GPIOF0 is toggled.

//GPIOF0 frequency is 589*4/(1000*2)=1.178Hz.

0 Kudos