Problem with QEI block - PIC32MK0512MCF100
I am using the PIC32 to control an exoskeleton. I have written my code in simulink r2019a and using the 3.45.04 blockset. We have all the functionality that we want (SPI, PWM, and various analog and digital read) except for the Quadrature Encoder Block. When we build our projects through simulink or MPLAB we receive the following errors:
test11_HipExo_main.c: In function 'main':
test11_HipExo_main.c:71:3: error: 'QEIA2R' undeclared (first use in this function)
QEIA2R = 0x06;
test11_HipExo_main.c:71:3: note: each undeclared identifier is reported only once for each function it appears in
test11_HipExo_main.c:72:3: error: 'QEIB2R' undeclared (first use in this function)
QEIB2R = 0x06;
(see attached image).
If we build this code in Simulink 2017 with with blockset 3.44 the encoder block compiles and works - but the PWM function and various analog reads do not work.
From our experience, we believe that there might be an error in the code for the QEI block in blockset 3.45.04. You can confirm our results using simulink models below.