• AVR Freaks

AnsweredHot!Problem with QEI block - PIC32MK0512MCF100

Author
Darc
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2019/08/23 19:29:13
  • Location: 0
  • Status: offline
2019/09/19 10:40:55 (permalink)
0

Problem with QEI block - PIC32MK0512MCF100

Hello,
 
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.

Attached Image(s)

#1
Lubin
Moderator
  • Total Posts : 375
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Problem with QEI block - PIC32MK0512MCF100 2019/09/20 04:36:22 (permalink)
0
Hi,
 
I confirm the issue affecting QEI on PIC32.
Fix will be published shortly. 
 
Thanks for the detailed report.
 
Lubin
#2
Darc
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2019/08/23 19:29:13
  • Location: 0
  • Status: offline
Re: Problem with QEI block - PIC32MK0512MCF100 2019/09/20 10:36:01 (permalink)
0
Hi Lubin,
 
Thanks for looking into this. We were able to fix the issue by using MPLAB X to change the register names in the _main.c file and then uploading the code through that interface.
 
We look forward to the next release!
#3
Lubin
Moderator
  • Total Posts : 375
  • Reward points : 5
  • Joined: 2007/03/31 07:38:15
  • Location: Bayonne, France
  • Status: offline
Re: Problem with QEI block - PIC32MK0512MCF100 2019/09/21 06:25:27 (permalink) ☼ Best Answerby Darc 2019/10/03 15:24:42
5 (2)
Hi,
 
early version including fixes available here: https://github.com/LubinKerhuel/MPLAB-Device-Blocks-for-Simulink/archive/Beta.zip
 
Lubin
#4
Jump to:
© 2019 APG vNext Commercial Version 4.5