Hot!Resistive Touch Migration to Harmony v2.06

Page: 12 > Showing page 1 of 2
Author
automate
Junior Member
  • Total Posts : 81
  • Reward points : 0
  • Joined: 2014/11/10 09:58:57
  • Location: 0
  • Status: offline
2018/09/26 08:56:58 (permalink)
0

Resistive Touch Migration to Harmony v2.06

Resistive Touch Migration to v2.06.
 
New in release v2.06 is the Input System Service. It is preferred over the deprecated Touch System Service. By default, MHC will attempt to set your pre-v2.06 configuration to the new Input System Service and the interrupt-based TouchADC driver. When using Resistive ADC in v2.06 the customer must ensure that 4 distinct areas of the MHC configuration are set correctly:  System Service, Drivers, Graphics Stack, and Timer.
 
Use the following steps below to migrate your resistive touch project to the Input System Service v2.06. To illustrate, please see attached images.
 
System Service
  • Open MHC to load project’s MHC configuration
  • Navigate to System Services
  • Select Input System Service
  • Deselect Touch System Service 
    Drivers
  • Navigate to Drivers / Input Drivers
  • Select Use Touch ADC Driver
  • Navigate to Drivers / Touch Drivers
  • Deselect Use Touch ADC Driver under touch drivers
     
    Graphics Stack
  • Navigate to Graphics Stack / Use Graphics Stack?
  • Navigate to Use Harmony Graphics Composer Suite?
  • Navigate to Use Aria User Interface Library?
  • Select Use Input System Service?
  • Deselect Use Touch System Service? 
    Interrupt Timer
    ADC driver defaults to interrupt mode. The trigger for the interrupt is a Timer.  The default timer is instance 0.
     
    First, select the Timer Driver and configure an available instance. The Image will show instance 0 and TMR_ID_3.  If TMR_ID_3 is not available, the customer is welcome to select another Module ID and associated INDEX ID.
     
  • Navigate to Input Drivers/ Touch Drivers
  • Navigate to Use touch ADC Driver?
  • Select Interrupt Mode
  • Navigate to TMR Settings
  • Set Timer Instance to 0
  • Set Driver INDEX to (TMR_ID -1)
  • Set Press Threshold to 256 
    After Timer Driver setup, the customer must associated the TMR Settings with the ADC Driver. The Timer.png image will show that for TMR_ID_3 the associated INDEX is DRV_TMR_INDEX_2. Therefore the INDEX is one less than the TMR_ID. The Timer Period is important: set it to 336.
     
  • Navigate to Drivers/ Timer Driver
  • Navigate to Use Timer Driver?
  • Select: Interrupt Mode
  • Set TMR Driver Instance values
  • Timer Module ID – (DRV_TIMER_INDEX +1)
  • Set  INT_PRIORITY_LEVEL1
  • Set INT_SUBPRIORITY_LEVEL0
  • Set DRV_TMR_CLKSOURCE_INTERNAL
  • Set TMR_PRESCALE_VALUE_256
  • Set Timer Period 336 
    Regenerate, Build, and Program
  • #1

    26 Replies Related Threads

      automate
      Junior Member
      • Total Posts : 81
      • Reward points : 0
      • Joined: 2014/11/10 09:58:57
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/09/26 09:04:32 (permalink)
      0
      MHC Illustrations

      Attached Image(s)

      #2
      jtzeng
      Super Member
      • Total Posts : 431
      • Reward points : 0
      • Joined: 2003/11/07 12:42:20
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 06:06:23 (permalink)
      0
      It there a example project that show this setup working using any of the kit configurations?
      Also how does it handle 90 or 270 deg screen rotation?
       

      John Zigrang
      JTZ Engineering, Inc.
      #3
      automate
      Junior Member
      • Total Posts : 81
      • Reward points : 0
      • Joined: 2014/11/10 09:58:57
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 09:59:02 (permalink)
      0
      @zigrang
       
      aria_quickstart
       
      This demonstration serves as a preconfigured starting point for a touch-enabled application powered by the Aria User Interface Library. The demonstration has resistive touch configurations to demonstrate the graphics library running on different resistive touch display panels.
       
      For example:
      pic32mx_usb_sk2_lcc_pictail_qvga
      pic32mx_usb_sk2_lcc_pictail_wqvga
      pic32mx_usb_sk2_meb
      pic32mx_usb_sk2_s1d_pictail_wqvga,
      pic32mx_usb_sk2_s1d_pictail_wvga
       
      Orthogonal Rotation/orientation is set using the MHC Display Manager tool.
      #4
      cjohnson
      Starting Member
      • Total Posts : 31
      • Reward points : 0
      • Joined: 2017/04/27 11:55:47
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 10:02:41 (permalink)
      0
      How about a tutorial on setting up the PIC32MZ DA ADC driver to work with this?
       
      I already have mine working, but it is NOT a straight forward process.
      #5
      jtzeng
      Super Member
      • Total Posts : 431
      • Reward points : 0
      • Joined: 2003/11/07 12:42:20
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 10:09:04 (permalink)
      0
      Thanks for that list.
      I will have to see if I have an PIC32MX SK2.  I have the other parts, but am using a PIC32MZ EF.

      John Zigrang
      JTZ Engineering, Inc.
      #6
      automate
      Junior Member
      • Total Posts : 81
      • Reward points : 0
      • Joined: 2014/11/10 09:58:57
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 10:24:16 (permalink)
      0
      @cjohnson and @jtzeng
       
      The following configuration is a PIC2MZ EF demonstration.
      pic32mz_ef_sk_s1d_pictail_wqvga
       
      For this configuration, the resistive overlay display is driven by an EPSON S1D13517 display controller (located on the Graphics LCD Controller PICtail Plus SSD1926 Daughter Board) that interfaces to the PIC32MZ through the PMP.
       
      The application features the touchadc driver for user resistive touch input by measuring the voltages from the display panel. The voltage signal are measured by the ADC and interpreted by the touch driver, and the Touch System Service acquires the touch input information from the touch driver. The Touch System Service sends touch events to the Graphics Library, which processes these events and updates the frame data accordingly.
      Please review the MHC pin configuration settings for the ADC 4-wire. It is using the shared ADC-7 channel.
       
      Harmony does not have access to a productized board to show an example of other ADC channels. Currently, the touchadc driver is using ADC-7. Please share your solution if not using ADC-7.
       
      #7
      cjohnson
      Starting Member
      • Total Posts : 31
      • Reward points : 0
      • Joined: 2017/04/27 11:55:47
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 11:29:43 (permalink)
      0
      The way our custom board was designed, we used the following settings:
       
      Overview

       
      Channels

       
      Analog Scanning

       
      Pin Settings

       
      Here's the problem though. This is extremely noisy. There is no adjustment in this "new and improved" input system service for move delta. Any recommendations on interrupt speed on the PIC32MZ for the touch adc driver, or ways to improve the noise? It's also extremely insensitive and no adjustment or tweaking of the press threshold will improve it.
       
      Also having a lot of issues with the "released" event being triggered, but the buttons released action never fires. I can post a video of the issue if that helps.
       

      Colby Johnson
      Product Design Engineer
      OEM Solutions, Inc.
      #8
      cjohnson
      Starting Member
      • Total Posts : 31
      • Reward points : 0
      • Joined: 2017/04/27 11:55:47
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 11:52:58 (permalink)
      0
      Also, on one side note from my previous post. In the OP you stated a 336 period for the ADC interrupt. That 336 is determinate on the clock speed to the peripheral clock. What is the actual interrupt frequency you are trying to obtain, so others can use that as a guide?

      Colby Johnson
      Product Design Engineer
      OEM Solutions, Inc.
      #9
      automate
      Junior Member
      • Total Posts : 81
      • Reward points : 0
      • Joined: 2014/11/10 09:58:57
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 15:01:22 (permalink)
      0
      Using a 1:256 prescale and PR1 of 336, the Timer asserts interrupt request every 256*336 clocks.
      The PBCLK is 100000000
      #10
      cjohnson
      Starting Member
      • Total Posts : 31
      • Reward points : 0
      • Joined: 2017/04/27 11:55:47
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/30 15:04:41 (permalink)
      0
      Do you have any documentation that talks about your choice of interrupt of roughly 1100 kHz (~1162 kHz)?

      Colby Johnson
      Product Design Engineer
      OEM Solutions, Inc.
      #11
      automate
      Junior Member
      • Total Posts : 81
      • Reward points : 0
      • Joined: 2014/11/10 09:58:57
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/31 09:01:29 (permalink)
      0
      At this time, there is no design/implementation documentation for the touchadc driver added to the release.  We plan to take note of your questions and review your configuration to improve the existing documentation. We agree there is need to verify a CLASS1 implementation.
       
      Note: Review the configuration for pic32mz_ef_sk_s1d_pictail_wqvga. This solution has been verified to have low noise using ADCHS_CHANNEL_7.
      #12
      cjohnson
      Starting Member
      • Total Posts : 31
      • Reward points : 0
      • Joined: 2017/04/27 11:55:47
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/10/31 10:50:07 (permalink)
      0
      In my opinion the ADC driver in Harmony is difficult to setup, period. Notes should be taken from how easy it is to setup an ADC driver in MCC and implemented in Harmony.
       
      Interesting, the ADC is setup way differently in the aria_touchadc_calibrate for the mz_ef than my configuration. 

      Colby Johnson
      Product Design Engineer
      OEM Solutions, Inc.
      #13
      jtzeng
      Super Member
      • Total Posts : 431
      • Reward points : 0
      • Joined: 2003/11/07 12:42:20
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/11/02 07:05:52 (permalink)
      0
      I have this setup but with MPLAB X 5.05 I can not get it to program with the Starter Kits (PKOB).
      It complies just fine.  See screen shot.  There are no messages that I can see when I select the PKOB.
      I have tried two ef kits on a Mac 10.13.6.  The second time it hung on loading the projects at 75% and had to force quite.
      I have a different problem on the PC. It will not bring up the project properties.
      Can you give me the IDE version that is working please.
       

      Attached Image(s)


      John Zigrang
      JTZ Engineering, Inc.
      #14
      cjohnson
      Starting Member
      • Total Posts : 31
      • Reward points : 0
      • Joined: 2017/04/27 11:55:47
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/11/02 07:50:42 (permalink)
      0
      jtzeng
      I have this setup but with MPLAB X 5.05 I can not get it to program with the Starter Kits (PKOB).
      It complies just fine.  See screen shot.  There are no messages that I can see when I select the PKOB.
      I have tried two ef kits on a Mac 10.13.6.  The second time it hung on loading the projects at 75% and had to force quite.
      I have a different problem on the PC. It will not bring up the project properties.
      Can you give me the IDE version that is working please.



      You should be able to use v5.05, but is your computer an SSD or regular HDD? On HDD it will take MPLAB X a century to load any Harmony project. Not sure how to help on the Mac side, as I don't use one.
       
      If you are connecting the PKOB to your computer through a USB hub, bypass it, they cause problems with the PKOB's and pretty much any programmer I've used.

      Colby Johnson
      Product Design Engineer
      OEM Solutions, Inc.
      #15
      jtzeng
      Super Member
      • Total Posts : 431
      • Reward points : 0
      • Joined: 2003/11/07 12:42:20
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/11/02 10:19:14 (permalink)
      5 (2)
      Other than the load issues, it was my error.
      Had the wrong USB connected for programming.
      But there are still a lot of issues on the Mac size for the tools.
       

      John Zigrang
      JTZ Engineering, Inc.
      #16
      cjohnson
      Starting Member
      • Total Posts : 31
      • Reward points : 0
      • Joined: 2017/04/27 11:55:47
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/11/02 10:29:07 (permalink)
      0
      jtzeng
      Other than the load issues, it was my error.
      Had the wrong USB connected for programming.
      But there are still a lot of issues on the Mac size for the tools.



      I can only imagine what the bugs are like on a Mac. Even on Windows 10, MPLAB X consumes close to 6 GB of ram and still takes over two minutes to compile a PIC32MZ Harmony project.

      Colby Johnson
      Product Design Engineer
      OEM Solutions, Inc.
      #17
      jtzeng
      Super Member
      • Total Posts : 431
      • Reward points : 0
      • Joined: 2003/11/07 12:42:20
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/11/30 18:21:13 (permalink)
      0
      Which ADC connection is connected to X and Y?
      I have it setup for my target PIC32mz2048EFG100.
      I have X+/Y+ on AN33 and AN32.
      All compiles but no touch action.
       
      Also how is the init calibration done without going through touch?
       
      I know the touch demo show how to calibrate, but it starts without going through it.
       

      John Zigrang
      JTZ Engineering, Inc.
      #18
      jtzeng
      Super Member
      • Total Posts : 431
      • Reward points : 0
      • Joined: 2003/11/07 12:42:20
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/11/30 23:47:55 (permalink)
      0
      I have this setup and it is all compiling but I am not sure about all the timers being used.
      Timer System Service uses DRV_TMR_INDEX_0
      Timer Driver is using TMR_ID_3 in Instance 0 (the only Instance)
      Input Driver ADC Touch is using DRV_TMR_INDEX_2
      I know there is another timer being used for the LCC DMA, but I don't set that one up.
       
      I also tried to do a SYS_TMR_CallbackPeriodic at 5000ms but my app_trm_callback is never called.
      If that is the case, maybe my ADC Driver is never getting called as well.
      Any ideas out there.
      Thanks.
       

      John Zigrang
      JTZ Engineering, Inc.
      #19
      automate
      Junior Member
      • Total Posts : 81
      • Reward points : 0
      • Joined: 2014/11/10 09:58:57
      • Location: 0
      • Status: offline
      Re: Resistive Touch Migration to Harmony v2.06 2018/12/03 09:30:31 (permalink)
      0
      @jtzeng,
       
      1. >>> but I am not sure about all the timers being used....
      Without looking at your mhc config [font="%value"]file, your timers, as you listed, appear to be setup correctly. The touch timer is started by the touch driver at initialization, DRV_TMR0_Start(). To verify, set a break point at DRV_TOUCH_ADC_PositionDetect() in the interrupt handler.  This function runs the state machine. There is no need for a SYS_TMR_Callback handler.
       
      2. >> Also how is the init calibration done without going through touch?...
      Init calibration is performed by taking 4 raw constants (samples). Each sample is translated to the dimension of a defined touch area using user known constants. These known constants are used to solve for the four desired calibration values. The raw values are typically in range of 0 <= touch point <= 1024 for both X and Y.
       
      3. >>> I know the touch demo show how to calibrate, but it starts without going through it...
      The touch demo is using default/preset calibration values for the board's display which is defined by the BSP (board support package). Therefore, the GUI is usable on default startup. These values can be overridden. The method to override is to perform a 5s touch/hold then release on the display. This will cause the demo to go into calibration mode.
       
       
      #20
      Page: 12 > Showing page 1 of 2
      Jump to:
      © 2019 APG vNext Commercial Version 4.5