• AVR Freaks

Hot!BUG REPORT: ADC channels are swapped on generated code (MCC v3.75 & PIC16F15345)

Author
iggardo
Starting Member
  • Total Posts : 28
  • Reward points : 0
  • Joined: 2013/07/13 07:03:47
  • Location: 0
  • Status: offline
2019/05/14 04:13:28 (permalink)
0

BUG REPORT: ADC channels are swapped on generated code (MCC v3.75 & PIC16F15345)

Hello all.
I don't know if this has already been reported or not, but it could be useful for those who arrive here from google.
Generated code for ADC channels AN4 and AN5 is swapped by MCC v3.75 when working with PIC16F15345.
See attached project and picture.
 
This two channels custom names are swapped on generated enum 'adc_channel_t' on file 'adc.h':
 
typedef enum
{
    sample_2 = 0x4,
    sample_1 = 0x5,
    channel_AVSS = 0x3B,
    channel_Temp = 0x3C,
    channel_DAC1 = 0x3D,
    channel_FVR_BUF1 = 0x3E,
    channel_FVR_BUF2 = 0x3F
} adc_channel_t;

 
It should be:
 
typedef enum
{
    sample_2 = 0x5,
    sample_1 = 0x4,
    channel_AVSS = 0x3B,
    channel_Temp = 0x3C,
    channel_DAC1 = 0x3D,
    channel_FVR_BUF1 = 0x3E,
    channel_FVR_BUF2 = 0x3F
} adc_channel_t;

 
Environment:
 
MPLAB X v4.05
MCC plugin v3.75
Core v4.65 loaded
Device PIC16F15345
 
 
 
 
post edited by iggardo - 2019/05/14 06:19:36

Attached Image(s)

#1

2 Replies Related Threads

    PA91
    Junior Member
    • Total Posts : 59
    • Reward points : 0
    • Joined: 2012/09/03 21:45:40
    • Location: 0
    • Status: offline
    Re: BUG REPORT: ADC channels are swapped on generated code (MCC v3.75 & PIC16F15345) 2019/08/15 22:21:29 (permalink)
    0
    Hi,
    If you look into datasheet of PIC16F15345 it says AN4 = 0x04 and AN5 = 0x05.
     
     

    Attached Image(s)

    #2
    iggardo
    Starting Member
    • Total Posts : 28
    • Reward points : 0
    • Joined: 2013/07/13 07:03:47
    • Location: 0
    • Status: offline
    Re: BUG REPORT: ADC channels are swapped on generated code (MCC v3.75 & PIC16F15345) 2019/08/16 10:56:40 (permalink)
    0
    Renukaprasad
    If you look into datasheet of PIC16F15345 it says AN4 = 0x04 and AN5 = 0x05



    And how exactly this info helps with the bug in the enum definition?
    #3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5