• AVR Freaks

Hot!Problem with ADC PIC32 High Speed SAR Block and PIC32MZ2048EFM144

Author
wema1108
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2020/01/17 00:48:31
  • Location: 0
  • Status: offline
2020/01/20 01:01:37 (permalink)
0

Problem with ADC PIC32 High Speed SAR Block and PIC32MZ2048EFM144

Hi,
 
I have a problem with the ADC PIC32 High Speed SAR Block.
 
Hardware:
PIC32MZ2048EFM144
Software:
MATLAB Version 9.4 (R2018a)
Simulink Version 9.1 (R2018a)
MPLAB Device Blocks for Simulink v3.44
XC32 Compiler v2.30
 
My problem:
I just want to read an analog value at the AN19 analog input of my Chip and convert it to uint16 (AnalogAN19.slx). Trying to Build the Model generates the error message attached in "DiagnosticViewer.txt".
 
When I change the ADC Block into a constant block everything is working fine and there is no problem to program the Chip. 
 
Does anyone know how to solve this problem?
 
Thank you in advance!
 
#1

2 Replies Related Threads

    Lubin
    Moderator
    • Total Posts : 403
    • Reward points : 5
    • Joined: 2007/03/31 07:38:15
    • Location: Bayonne, France
    • Status: offline
    Re: Problem with ADC PIC32 High Speed SAR Block and PIC32MZ2048EFM144 2020/01/20 02:51:08 (permalink)
    0
    Hi,
     
    Thanks for reporting this issue including Diagnostic message and model example.
     
    This is an issue from the blockset. 
    Please download the .p file attached, and replace the existing file in the blockset installation folder (blocks subfolder ; type picInfo('check') to find the blockset installation folder). This file should fix the issue for the PIC32MZ2048EFM144 only.
    Type
    =>bdclose all
    => rehash
    at matlab prompt to refresh matlab path, then make a "clean build" from the microchip menu.
     
    For details:
    The ADC PIC32 High Speed SAR block assumed that AN channel above 31 belong to ADC class3 and others one belongs to class 2 and 1. This assumption is incorrect. In fact, this "31" threshold depends on chip. The configuration code is slightly different.
    For the targeted chip PIC32MZ2048EFM144, the threshold is 12.
     
    The issue will be fix with the next blockset release.
     
    Lubin
    #2
    wema1108
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2020/01/17 00:48:31
    • Location: 0
    • Status: offline
    Re: Problem with ADC PIC32 High Speed SAR Block and PIC32MZ2048EFM144 2020/01/21 01:44:29 (permalink)
    0
    Hi Lubin,
     
    thank you for your quick response.
     
    Now its possible to program the Chip.
     
    Nevertheless the uint16 signal of the AN19 doesn't change my Output. (I set the Conversion to 8 Bit and my Output is also 8 Bit). (Same Model like in the opening post, just the change of the conversion to 8 Bit)
     
    When I change the AN19 to AN2, I'm getting the attached error message in the Diagnostiv Viewer ("DiagnosticViewerAN2'")
     
    Thank you!
     
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5