• AVR Freaks

Hot!Harmony Adding Resistive Touch Panel with LCC .

Page: 12 > Showing page 1 of 2
Author
TS9
Super Member
  • Total Posts : 817
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
2019/05/04 08:52:12 (permalink)
0

Harmony Adding Resistive Touch Panel with LCC .

Hi,
 
I am using Harmony V2_06 with PIC32MZ2048EFM100. 
https://www.microchip.com/forums/m1069348.aspx
I am trying to add/migrate resistive touch with aria_quickstart as per above link but unable to compile the program.
after following the link.
I have added ADC Pin as below:

// Functions for BSP_ADC_TOUCH_YPLUS pin 
#define BSP_ADC_TOUCH_YPLUS_PORT PORT_CHANNEL_B
#define BSP_ADC_TOUCH_YPLUS_PIN PORTS_BIT_POS_10
#define BSP_ADC_TOUCH_YPLUS_PIN_MASK (0x1 << 10)
 
// Functions for BSP_ADC_TOUCH_XPLUS pin 
#define BSP_ADC_TOUCH_XPLUS_PORT PORT_CHANNEL_B
#define BSP_ADC_TOUCH_XPLUS_PIN PORTS_BIT_POS_11
#define BSP_ADC_TOUCH_XPLUS_PIN_MASK (0x1 << 11)
 
// Functions for BSP_ADC_TOUCH_YMINUS pin
#define BSP_ADC_TOUCH_YMINUS_PORT PORT_CHANNEL_D
#define BSP_ADC_TOUCH_YMINUS_PIN PORTS_BIT_POS_8
#define BSP_ADC_TOUCH_YMINUS_PIN_MASK (0x1 << 8)
 
// Functions for BSP_ADC_TOUCH_XMINUS pin 
#define BSP_ADC_TOUCH_XMINUS_PORT PORT_CHANNEL_D
#define BSP_ADC_TOUCH_XMINUS_PIN PORTS_BIT_POS_9
#define BSP_ADC_TOUCH_XMINUS_PIN_MASK (0x1 << 9)
 

 
I am also attaching screenshorts.Any body experience  this issue?
 
--
TS9
post edited by TS9 - 2019/05/04 08:53:23

Attached Image(s)

#1

31 Replies Related Threads

    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 08:53:41 (permalink)
    0

    make[2]: Entering directory 'C:/microchip/harmony/v2_06/apps/gfx/aria_quickstart_100pin_Touch/firmware/GFXProject.X'
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c: In function 'DRV_TOUCH_ADC_PositionDetect':
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/477038478/gfx_display_def.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/477038478/gfx_display_def.o ../src/system_config/pic32mz_ef_sk_meb2/framework/gfx/hal/gfx_display_def.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:542:67: error: expected expression before ')' token
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/570842328/drv_touch_adc.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/570842328/drv_touch_adc.o ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ) )
    nbproject/Makefile-pic32mz_ef_sk_meb2.mk:1879: recipe for target 'build/pic32mz_ef_sk_meb2/production/_ext/570842328/drv_touch_adc.o' failed
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/1740298103/libaria_macros.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/1740298103/libaria_macros.o ../src/system_config/pic32mz_ef_sk_meb2/framework/gfx/libaria/libaria_macros.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/477038478/gfx_driver_def.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/477038478/gfx_driver_def.o ../src/system_config/pic32mz_ef_sk_meb2/framework/gfx/hal/gfx_driver_def.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:547:74: error: expected expression before ')' token
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, )>>2 )
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:570:40: error: 'BSP_ADC_TOUCH_XPLUS_PORT' undeclared (first use in this function)
    BSP_ADC_TOUCH_XPLUS_PORT, 
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:570:40: note: each undeclared identifier is reported only once for each function it appears in
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:571:40: error: 'BSP_ADC_TOUCH_XPLUS_PIN_MASK' undeclared (first use in this function)
    BSP_ADC_TOUCH_XPLUS_PIN_MASK );
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:574:40: error: 'BSP_ADC_TOUCH_YPLUS_PORT' undeclared (first use in this function)
    BSP_ADC_TOUCH_YPLUS_PORT, 
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:575:40: error: 'BSP_ADC_TOUCH_YPLUS_PIN_MASK' undeclared (first use in this function)
    BSP_ADC_TOUCH_YPLUS_PIN_MASK );
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:578:40: error: 'BSP_ADC_TOUCH_XMINUS_PORT' undeclared (first use in this function)
    BSP_ADC_TOUCH_XMINUS_PORT, 
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:579:40: error: 'BSP_ADC_TOUCH_XMINUS_PIN_MASK' undeclared (first use in this function)
    BSP_ADC_TOUCH_XMINUS_PIN_MASK );
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:581:45: error: 'BSP_ADC_TOUCH_YMINUS_PORT' undeclared (first use in this function)
    SYS_PORTS_PinClear( PORTS_ID_0, BSP_ADC_TOUCH_YMINUS_PORT, 
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:582:33: error: 'BSP_ADC_TOUCH_YMINUS_PIN' undeclared (first use in this function)
    BSP_ADC_TOUCH_YMINUS_PIN );
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:587:40: error: 'BSP_ADC_TOUCH_YMINUS_PIN_MASK' undeclared (first use in this function)
    BSP_ADC_TOUCH_YMINUS_PIN_MASK);
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:598:67: error: expected expression before ')' token
    if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ) )
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:604:74: error: expected expression before ')' token
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, )>>2)
    ^
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/477038478/gfx_processor_def.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/477038478/gfx_processor_def.o ../src/system_config/pic32mz_ef_sk_meb2/framework/gfx/hal/gfx_processor_def.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:609:35: error: 'BSP_ADC_TOUCH_YPLUS_PIN' undeclared (first use in this function)
    BSP_ADC_TOUCH_YPLUS_PIN );
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:636:67: error: expected expression before ')' token
    if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ) )
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:642:74: error: expected expression before ')' token
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, )>>2)
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:647:35: error: 'BSP_ADC_TOUCH_XPLUS_PIN' undeclared (first use in this function)
    BSP_ADC_TOUCH_XPLUS_PIN );
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:683:66: error: expected expression before ')' token
    if (!PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ))
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:687:77: error: expected expression before ')' token
    temp = (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, )>>2;
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:711:66: error: expected expression before ')' token
    if (!PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ))
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:716:77: error: expected expression before ')' token
    temp = (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, )>>2;
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:740:66: error: expected expression before ')' token
    if (!PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ))
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:746:74: error: expected expression before ')' token
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, )>>2 )
    ^
    ../src/system_config/pic32mz_ef_sk_meb2/framework/driver/input/touch_adc/src/drv_touch_adc.c:767:33: error: 'BSP_ADC_TOUCH_XMINUS_PIN' undeclared (first use in this function)
    BSP_ADC_TOUCH_XMINUS_PIN );
    ^
    make[2]: *** [build/pic32mz_ef_sk_meb2/production/_ext/570842328/drv_touch_adc.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/924081491/sys_devcon.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/924081491/sys_devcon.o ../src/system_config/pic32mz_ef_sk_meb2/framework/system/devcon/src/sys_devcon.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/924081491/sys_devcon_pic32mz.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/924081491/sys_devcon_pic32mz.o ../src/system_config/pic32mz_ef_sk_meb2/framework/system/devcon/src/sys_devcon_pic32mz.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    "C:\Program Files (x86)\Microchip\xc32\v2.10\bin\xc32-gcc.exe" -g -x c -c -mprocessor=32MZ2048EFM100 -ffunction-sections -O1 -I../src -I../src/system_config/pic32mz_ef_sk_meb2 -I../src/pic32mz_ef_sk_meb2 -I../../../../../framework -I../src/system_config/pic32mz_ef_sk_meb2/framework -I../src/system_config/pic32mz_ef_sk_meb2/bsp -Werror -Wall -MMD -MF build/pic32mz_ef_sk_meb2/production/_ext/1847413222/sys_clk_pic32mz.o.d -o build/pic32mz_ef_sk_meb2/production/_ext/1847413222/sys_clk_pic32mz.o ../src/system_config/pic32mz_ef_sk_meb2/framework/system/clk/src/sys_clk_pic32mz.c -DXPRJ_pic32mz_ef_sk_meb2=pic32mz_ef_sk_meb2 -no-legacy-libc 
    make[2]: Leaving directory 'C:/microchip/harmony/v2_06/apps/gfx/aria_quickstart_100pin_Touch/firmware/GFXProject.X'
    nbproject/Makefile-pic32mz_ef_sk_meb2.mk:90: recipe for target '.build-conf' failed
    make[1]: Leaving directory 'C:/microchip/harmony/v2_06/apps/gfx/aria_quickstart_100pin_Touch/firmware/GFXProject.X'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
    make[1]: *** [.build-conf] Error 2
    make: *** [.build-impl] Error 2
    BUILD FAILED (exit value 2, total time: 4s)

    Attached Image(s)

    #2
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 09:09:38 (permalink)
    0
    I am using PIC32MZ LCC +
    4.3inch 480 x 272 Resolution .
    My TFT is working fine. Also how to calibrate Resistive Touch with method suggested in link

    https://www.microchip.com/forums/m1069348.aspx

    and save that in NVM (Internal Flash) ?
    post edited by TS9 - 2019/05/04 09:19:53
    #3
    jtzeng
    Super Member
    • Total Posts : 470
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 16:41:55 (permalink)
    0
    If you are using a Class 1 or 2 ADC Channel, Harmony may not be configuring it correctly.
    See if this link helps.
    https://www.microchip.com/forums/tm.aspx?tree=true&m=1078798&mpage=1#
     
    I had to add code to my app to fix the notification on conversion complete.
     

    John Zigrang
    JTZ Engineering, Inc.
    #4
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 17:01:55 (permalink)
    0
    jtzeng
    If you are using a Class 1 or 2 ADC Channel, Harmony may not be configuring it correctly.See if this link helps.https://www.microchip.com/forums/tm.aspx?tree=true&m=1078798&mpage=1# I had to add code to my app to fix the notification on conversion complete. 

    Thanks...for update..
    Are you able to drive Resistive touch with LCC on PIC32MZ MCU?
    #5
    jtzeng
    Super Member
    • Total Posts : 470
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 20:36:26 (permalink)
    0
    For a Class 2 ADC you need to fix the ADC Done indication which is not setup correctly by Harmony 2.06.
        // Fix for class 2 input scanning  
        ADCTRG3bits.TRGSRC10 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE; // Not done in ADC INIT
        ADCTRG3bits.TRGSRC9 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE;  // Not done in ADC INI


    I think there was an error on the PLIB calls to setup the input as well but can't find that in my code at this time.
    Just make sure that the ADC is setup on the correct channels you have assigned the hardware to.
    I think the issue was it was set as an output when it should have been an input.

    John Zigrang
    JTZ Engineering, Inc.
    #6
    jtzeng
    Super Member
    • Total Posts : 470
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 20:50:43 (permalink)
    0
    My working configuration is:
    PIC32MZ2048EFG100
    LCC(16 bit) 480 x 272 at 90deg
    I2C to RTC and DAC
    SQI to SST26 (no file system)
    2 PWM's
     

    John Zigrang
    JTZ Engineering, Inc.
    #7
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 21:01:11 (permalink)
    0
    jtzeng
    My working configuration is:PIC32MZ2048EFG100LCC(16 bit) 480 x 272 at 90degI2C to RTC and DAC SQI to SST26 (no file system)2 PWM's 


    Thanks.. Is your TFT LCC worked
    with Resistive Touch...?
    #8
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/04 21:05:55 (permalink)
    0
    Also With ADC pins I am getting error..
    Which I have already declared...

    BSP_ADC_TOUCH_XPLUS_PORT
    BSP_ADC_TOUCH_YPLUS_PORT
    BSP_ADC_TOUCH_XMINUS_PIN
    BSP_ADC_TOUCH_YMINUS_PIN


    Why so?
    post edited by TS9 - 2019/05/04 23:54:27
    #9
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/05 09:21:47 (permalink)
    0
    Hi John Zigrang,
     
    I have ported aria_touchadc_calibrate from pic32mz_ef_sk_s1d_pictail_wqvga to pic32mz_ef_LCC_wqvga 
    which is not available in Harmony V2_06 for four wire resistive touch Successfully.
    Code Reached at "TouchADC TouchWidget Test".
    But I am confused how to set Analog and Digital Pins in MHC Pin Setting tab to make in work and how to calibrate it and save it's parameter to make it work.. 
    Will ADC by just changing channel will work properly ?
    X+ -> Analog with 100K
    Y+  -> Analog with 100K
    X-  -> GPIO
    Y-  -> GPIO
     
    Please Check screenshots and update...
     
    Thanks..
    TS9
    #10
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/05 09:24:38 (permalink)
    0

    Access Denied

    You don't have permission to access "http://www.microchip.com/forums/post.aspx?" on this server.
    Reference #18.7e4fc817.1557073379.32c99f0c
     
    So Check Image on below link ..
    https://imgur.com/a/kJMuUB1
    #11
    jtzeng
    Super Member
    • Total Posts : 470
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/05 18:04:14 (permalink)
    0
    You are using a Class 1 ADC.  The Harmony 2.06 was only tested with Class 3.
    In Class 2 we found that the software triggers are not configured correctly: (added to app Init)
        ADCTRG3bits.TRGSRC10 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE; // Not done in ADC INIT
        ADCTRG3bits.TRGSRC9 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE;  // Not done in ADC INI


    If this is not fixed in the class 1, then you will never see the conversion complete and the ADC_Touch_Task has nothing to process.
    Your pin setup looks fine.  Not sure how you got to RB0..3 with that setup of dev board you indicated.
     
     

    John Zigrang
    JTZ Engineering, Inc.
    #12
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/05 22:51:08 (permalink)
    0
    Zigrang.. Thanks for update ..

    If this is not fixed in the class 1, then you will never see the conversion complete and the ADC_Touch_Task has nothing to process.
    Your pin setup looks fine.  Not sure how you got to RB0..3 with that setup of dev board you indicated. 

    I have designed my own hardware ..While  designing I just used  Multiplexed Analog/Digital Pins for Resistive Touch irrespective to Class(es) of ADC.
    Do I need to change Hardware connection for Class 3 = AN32 to AN53 first or try with Class 1?
    Or Any way to fix it/use  for AN0 to AN6 in  Class 3 mode/Harmony?
     
    Please Check attachment..
    --
    TS9
    post edited by TS9 - 2019/05/06 08:32:19

    Attached Image(s)

    #13
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/06 08:34:57 (permalink)
    0
    As I have seen in MHC Setting of pic32mz_ef_sk_s1d_pictail_wqvga uses AN21 and AN11 for ADC Conversion ?
    post edited by TS9 - 2019/05/06 08:36:40

    Attached Image(s)

    #14
    jtzeng
    Super Member
    • Total Posts : 470
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/06 08:47:25 (permalink)
    0
    Looks like the post I made about 30min ago did not stick.
    I will recreate.
    You should not need to change your design at this time.
    First lets see what the issues is.
    Most of the work is done in dvr_touch_adc.c. (generated file)
    The routine DRV_TOUCH_ADC_PositionDetect is called from a timer which is a timer call IntHandlerDrvTouchAdc.
     
    In DRV_TOUCH_ADC_PositionDetect it will start with DRV_TOUCH_ADC_STATE_SET_X to start the first conversion.
    On the next call to this routine it will be waiting for the conversion to be completed at state: DRV_TOUCH_ADC_STATE_CHECK_X
     
    If the test fails to show completion it will be waiting for ever.  No error recovery on driver issue indication.
                if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN10) )


    You want to see that your are getting to            
                 if ((uint16_t) 256 >
                    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, ADCHS_AN10)>>2)
                {


    If not then the start conversion may not have been setup correctly.
    That is why I have to add this to my app init:
        // Fix for class 2 input scanning
        
        ADCTRG3bits.TRGSRC10 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE; // Not done in ADC INIT
        ADCTRG3bits.TRGSRC9 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE;  // Not done in ADC INI



    John Zigrang
    JTZ Engineering, Inc.
    #15
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/06 09:16:50 (permalink)
    0
    Zigrang.. Thanks for update ..Again ..

    You should not need to change your design at this time.

    Table 22-2: Analog Input Class of DS60001344D "Section 22. 12-bit High-Speed Successive Approximation
    Register (SAR) Analog-to-Digital Converter (ADC)" stated that AN0 and AN1 falls under Class 1 ADC.
    Do I need to add..
      ADCTRG3bits.TRGSRC10 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE;
    // Not done in ADC INIT
        ADCTRG3bits.TRGSRC9 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE; 
    // Not done in ADC INIT
    Also for class 1 or add something else ?
    Please Review my generated file .

     
     
     
    short DRV_TOUCH_ADC_PositionDetect(void)
    {
    DRV_TOUCH_ADC_OBJECT * pDrvInstance = (DRV_TOUCH_ADC_OBJECT *) &sADCDriverInstances[0];
    static short tempX;
    static short tempY;
    short temp;
     
     
     
    switch ( pDrvInstance->state )
    {
    case DRV_TOUCH_ADC_STATE_IDLE:
    {
    adcX = -1;
    adcY = -1;

    break;
    }

    case DRV_TOUCH_ADC_STATE_SET_VALUES:
    {
    if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN1) )
    {
    break;
    }
    if ( (uint16_t) 256 <
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, ADCHS_AN1)>>2 )
    {
    adcX = -1;
    adcY = -1;
    }
    else
    {
    adcX = tempX;
    adcY = tempY;
    }

    // If the hardware supports an analog pot, if not skip it
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_X;
    pDrvInstance->touchStatus = DRV_TOUCH_POSITION_SINGLE;
    return 1; // touch screen acquisition is done

    }

    case DRV_TOUCH_ADC_STATE_SET_X:
    {
    //x+
     
     
     
    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_XPLUS_PORT,
    BSP_ADC_TOUCH_XPLUS_PIN_MASK );
    //y+
    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_YPLUS_PORT,
    BSP_ADC_TOUCH_YPLUS_PIN_MASK );
    //x-
    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_XMINUS_PORT,
    BSP_ADC_TOUCH_XMINUS_PIN_MASK );
    //y-
    SYS_PORTS_PinClear( PORTS_ID_0, BSP_ADC_TOUCH_YMINUS_PORT,
    BSP_ADC_TOUCH_YMINUS_PIN );

    //y-
    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT,
    BSP_ADC_TOUCH_YMINUS_PORT,
    BSP_ADC_TOUCH_YMINUS_PIN_MASK);
     
     
     
    PLIB_ADCHS_GlobalSoftwareTriggerEnable(DRV_ADC_ID_1);
     
     
     
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_CHECK_X;

    break;
    }
     
     
     
    case DRV_TOUCH_ADC_STATE_CHECK_X:
    {
    if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN0) )
    {
    break;
    }
     
     
     
    if ((uint16_t) 256 >
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, ADCHS_AN0)>>2)
    {
    //y+
    SYS_PORTS_PinSet( PORTS_ID_0,
    BSP_ADC_TOUCH_YPLUS_PORT,
    BSP_ADC_TOUCH_YPLUS_PIN );
     
     
     
    SYS_PORTS_DirectionSelect( PORTS_ID_0,
    SYS_PORTS_DIRECTION_OUTPUT,
    BSP_ADC_TOUCH_YPLUS_PORT,
    BSP_ADC_TOUCH_YPLUS_PIN_MASK);
     
     
     
    tempX = -1;
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_RUN_X;

    }
    else
    {
    adcX = -1;
    adcY = -1;
     
     
     
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_X;
    pDrvInstance->touchStatus = DRV_TOUCH_POSITION_SINGLE;
    return 1; // touch screen acquisition is done

    break;
    }
    break;
    }
     
     
     
    case DRV_TOUCH_ADC_STATE_CHECK_Y:
    {
    if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN1) )
    {
    break;
    }
     
     
     
    if ((uint16_t) 256 >
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, ADCHS_AN1)>>2)
    {
    //x+
    SYS_PORTS_PinSet( PORTS_ID_0,
    BSP_ADC_TOUCH_XPLUS_PORT,
    BSP_ADC_TOUCH_XPLUS_PIN );
     
     
     
    SYS_PORTS_DirectionSelect( PORTS_ID_0,
    SYS_PORTS_DIRECTION_OUTPUT,
    BSP_ADC_TOUCH_XPLUS_PORT,
    BSP_ADC_TOUCH_XPLUS_PIN_MASK );
     
     
     
    tempY = -1;
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_RUN_Y;
    }
    else
    {
    adcX = -1;
    adcY = -1;
     
     
     
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_X;
    pDrvInstance->touchStatus = DRV_TOUCH_POSITION_SINGLE;
    return 1; // touch screen acquisition is done

    break;
    }
    }
     
     
     
    case DRV_TOUCH_ADC_STATE_RUN_X:
    case DRV_TOUCH_ADC_STATE_RUN_Y:
    {
    PLIB_ADCHS_GlobalSoftwareTriggerEnable(DRV_ADC_ID_1);
     
     
     
    pDrvInstance->state = (pDrvInstance->state == DRV_TOUCH_ADC_STATE_RUN_X) ?
    DRV_TOUCH_ADC_STATE_GET_X : DRV_TOUCH_ADC_STATE_GET_Y;
     
     
     
    break;
    }
     
     
     
    case DRV_TOUCH_ADC_STATE_GET_X:
    {
    if (!PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN0))
    {
    break;
    }
    temp = (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, ADCHS_AN0)>>2;
    if (temp != tempX)
    {
    tempX = temp;
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_RUN_X;
    break;
    }
     
     
     
    //y+
    SYS_PORTS_DirectionSelect( PORTS_ID_0,
    SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_YPLUS_PORT,
    BSP_ADC_TOUCH_YPLUS_PIN_MASK );

    PLIB_ADCHS_GlobalSoftwareTriggerEnable(DRV_ADC_ID_1);
     
     
     
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_Y;

    break;
    }

    case DRV_TOUCH_ADC_STATE_GET_Y:
    {
     
     
     
    if (!PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN1))
    {
    break;
    }
     
     
     
    temp = (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, ADCHS_AN1)>>2;
     
     
     
    if (temp != tempY)
    {
    tempY = temp;
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_RUN_Y;
    break;
    }
     
     
     
    //x+
    SYS_PORTS_DirectionSelect( PORTS_ID_0,
    SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_XPLUS_PORT,
    BSP_ADC_TOUCH_XPLUS_PIN_MASK );
     
     
     
    PLIB_ADCHS_GlobalSoftwareTriggerEnable(DRV_ADC_ID_1);
     
     
     
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_VALUES;

    break;
    }
     
     
     
    case DRV_TOUCH_ADC_STATE_SET_Y:
    {
    if (!PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN0))
    {
    break;
    }

    if ( (uint16_t) 256 <
    (uint16_t) PLIB_ADCHS_AnalogInputResultGet(DRV_ADC_ID_1, ADCHS_AN0)>>2 )
    {
    adcX = -1;
    adcY = -1;
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_X;
    pDrvInstance->touchStatus = DRV_TOUCH_POSITION_SINGLE;
    return 1; // touch screen acquisition is done
    break;
    }
     
     
     

    //x+
    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_XPLUS_PORT,
    BSP_ADC_TOUCH_XPLUS_PIN_MASK );
    //y+
    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_YPLUS_PORT,
    BSP_ADC_TOUCH_YPLUS_PIN_MASK );
    //x-
    SYS_PORTS_PinClear( PORTS_ID_0, BSP_ADC_TOUCH_XMINUS_PORT,
    BSP_ADC_TOUCH_XMINUS_PIN );

    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT,
    BSP_ADC_TOUCH_XMINUS_PORT,
    BSP_ADC_TOUCH_XMINUS_PIN_MASK );

    //y-
    SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
    BSP_ADC_TOUCH_YMINUS_PORT,
    BSP_ADC_TOUCH_YMINUS_PIN_MASK );
     
     
     
    PLIB_ADCHS_GlobalSoftwareTriggerEnable(DRV_ADC_ID_1);
     
     
     
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_CHECK_Y;
    break;
    }

    default:
    {
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_X;
    pDrvInstance->touchStatus = DRV_TOUCH_POSITION_SINGLE;
    return 1; // touch screen acquisition is done
    }
    }
     
     
     
    return 0; // touch screen acquisition is not done
    }
     
     
     

    post edited by TS9 - 2019/05/06 09:22:24
    #16
    jtzeng
    Super Member
    • Total Posts : 470
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/06 09:29:34 (permalink)
    0
    You might have to add the code indicated but it would be for:
    • ADCTRG1: ADC Trigger Source 1Register
    This register controls the trigger source selection for AN0 through AN3 analog inputs.
     
    First I would use the debugger to make sure that is the issue.
    You can set a breakpoint at the Check_X or look at the ADCTRG1 register.
    See section:  Register 22-18: ADCTRG1: ADC Trigger Source 1Register
     
    How did you include the source capture in the post? I have never figured that one out yet.

    John Zigrang
    JTZ Engineering, Inc.
    #17
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/06 11:52:52 (permalink)
    0
    Thanks again

    You might have to add the code indicated but it would be for:
    • ADCTRG1: ADC Trigger Source 1Register
    This register controls the trigger source selection for AN0 through AN3 analog inputs.

    I have added these as below but still Not succeeded yet :

     
     
     
    SYS_MODULE_OBJ DRV_TOUCH_ADC_Initialize( const SYS_MODULE_INDEX index,
    const SYS_MODULE_INIT * const init )
    {
    DRV_TOUCH_ADC_OBJECT * pDrvInstance = (DRV_TOUCH_ADC_OBJECT *) NULL;
    DRV_TOUCH_SAMPLE_POINTS samplePoints;
     
     
     
    if (index >= 1)
     
     
     

    {
    SYS_ASSERT(false, "ADC Driver: Attempting to initialize an instance number greater than the max");
    return SYS_MODULE_OBJ_INVALID;
    }
     
     
     
    pDrvInstance = ( DRV_TOUCH_ADC_OBJECT *)&sADCDriverInstances[index];
     
     
     
    const DRV_TOUCH_ADC_INIT * const pInit = (const DRV_TOUCH_ADC_INIT * const)init;
     
     
     
    pDrvInstance->status = SYS_STATUS_READY;
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_IDLE;
    pDrvInstance->touchId = pInit->touchId;
    pDrvInstance->verticalResolution = pInit->verticalResolution;
    pDrvInstance->horizontalResolution = pInit->horizontalResolution;
    pDrvInstance->touchStatus = DRV_TOUCH_POSITION_NONE;
     
     
     
    _DRV_TOUCH_ADC_HardwareInit(0);

    // set the state of the statemachine to start the sampling
    pDrvInstance->state = DRV_TOUCH_ADC_STATE_SET_X;

    samplePoints.touchCalUlx = 0x0096;
    samplePoints.touchCalUly = 0x00C9;
     
     
     
    samplePoints.touchCalUrx = 0x0371;
    samplePoints.touchCalUry = 0x00C3;
     
     
     
    samplePoints.touchCalLrx = 0x036F;
    samplePoints.touchCalLry = 0x0351;
     
     
     
    samplePoints.touchCalLlx = 0x008E;
    samplePoints.touchCalLly = 0x0350;

    // AN0
    ADCTRG1bits.TRGSRC0 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE;
    // AN1
    ADCTRG1bits.TRGSRC1 = ADCHS_SCAN_TRIGGER_SOURCE_GLOBAL_SOFTWARE_EDGE;

    DRV_TOUCH_ADC_CalibrationSet(&samplePoints);
     
     
     
    DRV_TMR0_Start();
     
     
     
    return (SYS_MODULE_OBJ)pDrvInstance;
    }
     
     
     

     

    First I would use the debugger to make sure that is the issue.
    You can set a breakpoint at the Check_X or look at the ADCTRG1 register.
    See section:  Register 22-18: ADCTRG1: ADC Trigger Source 1Register

    I have set the Breakpoint . See Attachment.
     

    How did you include the source capture in the post? I have never figured that one out yet.

    I am attaching one screen may be you can asking for that..
     
    --
    TS9
    post edited by TS9 - 2019/05/06 12:01:51

    Attached Image(s)

    #18
    TS9
    Super Member
    • Total Posts : 817
    • Reward points : 0
    • Joined: 2010/05/07 10:52:22
    • Status: online
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/06 12:01:12 (permalink)
    0
    Also In previous , MLA .. There are Red Dots  or Arrows on the edges of screen for calibration
    how do  calibrate with harmony with aria_touchadc_calibrate?
    #19
    jtzeng
    Super Member
    • Total Posts : 470
    • Reward points : 0
    • Joined: 2003/11/07 12:42:20
    • Status: offline
    Re: Harmony Adding Resistive Touch Panel with LCC . 2019/05/06 12:06:24 (permalink)
    0
     
    In drv_touch_adc.c: DRV_TOUCH_ADC_PositionDetect set 3 break points.
     
            case DRV_TOUCH_ADC_STATE_SET_X:
            {
                //x+

                SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
                                           BSP_ADC_TOUCH_XPLUS_PORT,
                                           BSP_ADC_TOUCH_XPLUS_PIN_MASK );
                //y+
                SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
                                           BSP_ADC_TOUCH_YPLUS_PORT,
                                           BSP_ADC_TOUCH_YPLUS_PIN_MASK );
                //x-
                SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_INPUT,
                                           BSP_ADC_TOUCH_XMINUS_PORT,
                                           BSP_ADC_TOUCH_XMINUS_PIN_MASK );
                //y-
                SYS_PORTS_PinClear( PORTS_ID_0, BSP_ADC_TOUCH_YMINUS_PORT,
                                    BSP_ADC_TOUCH_YMINUS_PIN );
                
                //y-
                SYS_PORTS_DirectionSelect( PORTS_ID_0, SYS_PORTS_DIRECTION_OUTPUT,
                                           BSP_ADC_TOUCH_YMINUS_PORT,
                                           BSP_ADC_TOUCH_YMINUS_PIN_MASK);

                PLIB_ADCHS_GlobalSoftwareTriggerEnable(DRV_ADC_ID_1);

     BKPT1->>>           pDrvInstance->state = DRV_TOUCH_ADC_STATE_CHECK_X;
                
                break;
            }

            case DRV_TOUCH_ADC_STATE_CHECK_X:
            {
     BKPT2->>>            if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN10) )
                {
                    break;
                }

     BKPT3->>>            if ((uint16_t) 256 >

     
    BKPT1 will show the timer is calling the routine.
    BKPT2: will show that the routine is waiting for completion.  Disable after reached.
    BKPT3: will so there was a conversion.
     
    I put the fix in my APP_Initialize so I would not have issues with future Harmony Generation.
     

    John Zigrang
    JTZ Engineering, Inc.
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5