• AVR Freaks

Hot!Resistive Touch Migration to Harmony v2.06

Page: < 12 Showing page 2 of 2
Author
jtzeng
Super Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2003/11/07 12:42:20
  • Status: offline
Re: Resistive Touch Migration to Harmony v2.06 2018/12/03 10:00:47 (permalink)
0
I have made some progress and see the ADC Touch driver being called and going through the steps for reading.
So the timer is working.
I missed the pull-up requirement for the detection part so turned on weep pull-ups.
I have place for hardware pull ups but they are attached to the -X and -Y as I have flipped the assignments so I can use CH-7 scanning.
I have to do more testing on this to make sure my setup is working.  Or move to the class 2 input.
 
As to initial calibration, I could not see that in the BSP but does the image attached show the values to be used?
 

Attached Image(s)


John Zigrang
JTZ Engineering, Inc.
#21
jtzeng
Super Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2003/11/07 12:42:20
  • Status: offline
Re: Resistive Touch Migration to Harmony v2.06 2018/12/03 18:35:48 (permalink)
0
I am getting in DRV_TOUCH_ADC_PositionDetect call based on the timer.
But I get stuck at case DRV_TOUCH_ADC_STATE_CHECK_X:
It never comes back correct to move on.
Configuration screens attached.

Attached Image(s)


John Zigrang
JTZ Engineering, Inc.
#22
jtzeng
Super Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2003/11/07 12:42:20
  • Status: offline
Re: Resistive Touch Migration to Harmony v2.06 2018/12/03 18:37:16 (permalink)
0
I am getting in DRV_TOUCH_ADC_PositionDetect call based on the timer.
But I get stuck at case DRV_TOUCH_ADC_STATE_CHECK_X:
It never comes back correct to move on.
Configuration screens attached.

Attached Image(s)


John Zigrang
JTZ Engineering, Inc.
#23
jtzeng
Super Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2003/11/07 12:42:20
  • Status: offline
Re: Resistive Touch Migration to Harmony v2.06 2018/12/04 21:00:11 (permalink)
0
Tried to post last night but the system is a little flaky.
I am getting the DRV_TOUCH_ADC_PositionDetect call.
It goes to case DRV_TOUCH_ADC_STATE_SET_X: and then case DRV_TOUCH_ADC_STATE_CHECK_X:
But this "if ( !PLIB_ADCHS_AnalogInputDataIsReady(DRV_ADC_ID_1, ADCHS_AN9) )" is always true.
Never get the Ready for the conversion.
 
What are the possibility to look for on this.
Images show my pin and setup.
 

Attached Image(s)


John Zigrang
JTZ Engineering, Inc.
#24
jtzeng
Super Member
  • Total Posts : 463
  • Reward points : 0
  • Joined: 2003/11/07 12:42:20
  • Status: offline
Re: Resistive Touch Migration to Harmony v2.06 2018/12/04 21:02:51 (permalink)
0
Not sure my posts are getting through.  On the PC I see them, but on the Mac they never show up.
Will look at another browser.
 

John Zigrang
JTZ Engineering, Inc.
#25
Digital_Angel
Starting Member
  • Total Posts : 57
  • Reward points : 0
  • Joined: 2014/08/27 06:56:45
  • Location: Northampton, UK
  • Status: offline
Re: Resistive Touch Migration to Harmony v2.06 2019/02/19 05:25:48 (permalink)
0
I really need some help with this.
I have got my touch screen code working fine after following instructions in this thread, but it seems that by doing that I sacrifice my USB device detection!
I believe that it is a timer-related issue, as the problem seems to lie in SYS_TMR_CallbackSingle never allowing the callback function to run, so my code sees that the USB stick has been plugged in, but cannot go through the whole state machine to report the device as connected, due to the aforementioned timer issue.
I'm using the MSD Host Client driver for the USB, with the Automount feature enabled in the File System service.
If I play around with the timer indexes and instances, I can get the USB to work fine (as it did in earlier versions of Harmony), but this always seems to be at the expense of the touch screen.
Can anyone advise where I even start?!
 
I'm using a custom PCB, Harmony v2.06, MPLAB X IDE v5.10, XC32 v2.10, PIC32MX795F512L.
 
*EDIT* I've realised thanks to another thread that I need to configure an timer driver instance for the timer system service, that has also not helped. 
I've also seen suggested that dynamic drivers need to be used if the system service is to be used, but then my generated adc_touch code doesn't compile due to the presence of the line DRV_TMR0_Start(); which implies static drivers should be used. I've tried to change to the dynamic function, but cannot find where the driver is open, to be able to get the driver handle info to pass to the function!
My head is spinning! 
post edited by Digital_Angel - 2019/02/19 09:09:26

Attached Image(s)

#26
automate
Junior Member
  • Total Posts : 85
  • Reward points : 0
  • Joined: 2014/11/10 09:58:57
  • Location: 0
  • Status: offline
Re: Resistive Touch Migration to Harmony v2.06 2019/02/19 13:57:08 (permalink)
0
@Digital_Angel,
 
The TMR is not required. That is, DRV_TMR0_Start() and its interrupt can be replaced with a call to DRV_TOUCH_ADC_PositionDetect();  The call can be inserted in your SYS_Tasks() routine.
 
The side effect is that you will not be able to interrupt current processing. The touch detection will be polling and scheduled based on existing task loop functionality.
 
If you see side affects and require interrupt priority for touch detection, you may want to switch from static TMR to dynamic TMR.
 
regards
 
 
 
 
 
 
#27
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5