• AVR Freaks

Hot!Harmony v2.06 USB not working PIC32MZ2048EFH064

Author
lelsteph
Super Member
  • Total Posts : 401
  • Reward points : 0
  • Joined: 2008/09/17 05:10:00
  • Location: 0
  • Status: offline
2019/11/13 10:59:43 (permalink)
0

Harmony v2.06 USB not working PIC32MZ2048EFH064

Hello
 
  • I guess another same subject. I am very sorry, I tried to look at many aspects but I cannot get USB to work.
  • The schematic is very common: it worked already on at least 2 other boards. The connections are very short, impedance are adapted, I verified all connections are correct.
  • USB does not work either with v2.02b.
  • Even with an identical configuration I used on previous working board it does not work.
  • I checked the USBOTG register, all seems correct: device, VBUS is ok.
  • It seems the very basic is not working: the pull-up does not seem to work when Harmony Console is attaching because the HOST (PC) is not seeing it (just having the pull-up should be detected and then get a failing device).
  • Attached the Harmony configuration
  • I use the Console
Can you please help me to find the root cause of the problem? Where should I look at? I am stuck.
 
Thank you very much for your help
 
Stephane.

Attached Image(s)

#1
Paul PortSol
Super Member
  • Total Posts : 534
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/11/14 06:26:42 (permalink)
0
Check:
- VBUS signal connected to PIC32MZ so can check voltage? (through 100ohm)
- Big enough cap on USB 5V? (150uF+ at 6V, not higher voltage else uF changes)
- Heap big enough? (10000+)
- Polarity on TPS2051 signals changes with part number suffix (Enable and Fault)
- Some people have reported issues with some USB functionality in Hv206 and have found Hv204 to be more reliable for some USB features. (I'm using Hv206 for USB Stick only).
 
I suggest trying generate in Hv204, and if it works do a detailed compare of Hv204 and Hv206 projects to see where differences are, and possibly create a patch for Hv206 based on that (please share). I had to do a similar patch on an earlier version for ADC and UART issues.
 
Paul
#2
JPortici
Super Member
  • Total Posts : 851
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/11/14 08:50:04 (permalink)
0
Then there is the software side of it.. The state machine inside app.c actually set up and start the stack. Harmony will just set up the hardware.
 
have you tried starting from one of the examples?
 
Then tried replicating the example? (because examples worked but new projects wouldn't)
#3
lelsteph
Super Member
  • Total Posts : 401
  • Reward points : 0
  • Joined: 2008/09/17 05:10:00
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/11/14 11:52:02 (permalink)
0
@Paul:
- VBUS signal connected to PIC32MZ so can check voltage? (through 100ohm): checked 5V clean
- Big enough cap on USB 5V? (150uF+ at 6V, not higher voltage else uF changes): why do you need so much? I have 1uF
- Heap big enough? (10000+): 32000
- Polarity on TPS2051 signals changes with part number suffix (Enable and Fault): no TPS chip, direct connection
 
I have the same problem with v2.02b where my other boards work very well and same schematic.
 
@JPortici
Yes, all is fine there. I even try to follow in debug what is happened, when it goes in Attach, nothing happens.

Stephane.
 
#4
Paul PortSol
Super Member
  • Total Posts : 534
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/11/15 05:14:37 (permalink)
0
Do you have more than one of the new boards? Possibly something damaged or mis-populated on the new board.
 
Otherwise - Minimize! Something is hiding, remove everything not necessary for testing that one feature.
 
Make fresh minimal USB projects for each board, possibly using MHC Generate App feature (option to generate demo code under MHC-Apps, ensure disable any BSP features that might get enabled).
Following exact same procedures and options for both boards (NOT using BSP's!).
Build & Run the projects on both your good & trouble boards.
Then compare the two projects using something like "Beyond Compare" to find every difference.
 
*I recommend avoiding BSP and doing everything in MHC Pin Manager. That will keep the two projects similar.
 
Paul
 
#5
lelsteph
Super Member
  • Total Posts : 401
  • Reward points : 0
  • Joined: 2008/09/17 05:10:00
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/11/16 23:50:11 (permalink)
0
Hello
 
Thank you. I will continue investigating.
I realized there is one key difference with previous projects: the device is BUS powered.
I did a very simple project already but not sure I disabled anything related to BSP, I will try.
 
Stephane.
 
#6
Paul PortSol
Super Member
  • Total Posts : 534
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/11/18 05:16:34 (permalink)
0
Bus Powered:
- Ensure big enough cap on USB 5V at master (To supply the initial kick of power to the slave, like charging all the slave's caps).
- Ensure a good powerup reset/brownout device on slave (to protect from slow voltage rampup which can cause some ICs to not start properly).
- Try manually resetting the slave while powered to see if it was a powerup issue. 
- Try locally powering the slave to see if it is a supply issue (and measure actual power consumed by slave).
- scope the USB 5V looking for glitches/dips.
 
Paul
#7
laffelt
Super Member
  • Total Posts : 152
  • Reward points : 0
  • Joined: 2008/05/08 18:05:53
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/02 11:56:48 (permalink)
0
Are you using any of the system timers? The USB stack uses a timer to progress thru its state machine, if you change the first timer th USB does not work. I had to use a different time (no big deal) to get a recent v2.06 project to run ... see this thread https://www.microchip.com/forums/m1113598.aspx
 
Good Luck!
#8
sborden
Super Member
  • Total Posts : 1956
  • Reward points : 0
  • Joined: 2010/08/05 02:12:53
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/03 13:32:04 (permalink)
0
Just thought of something: You may have to have the VUSB3.3 connected to 5V instead of 3.3V.
 
That bit me before. Had to respin a board.
 
The USB section (chap 55, IIRC) of the reference guide mentions about this.
#9
NKurzman
A Guy on the Net
  • Total Posts : 18043
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/03 16:16:38 (permalink)
0
Deleted
post edited by NKurzman - 2019/12/03 16:29:44
#10
lelsteph
Super Member
  • Total Posts : 401
  • Reward points : 0
  • Joined: 2008/09/17 05:10:00
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/06 11:47:20 (permalink)
0
Hi Everyone,
 
Sorry for late reply.
Thank you for all your good suggestions.
 
@Laffelt: I use the Timer Services which is using Timer0 and I use Timer8 with external source. How do I know what timer is used by USB?
 
To others, I still need to do various tests based on your inputs.
 
Thank you!
 
#11
lelsteph
Super Member
  • Total Posts : 401
  • Reward points : 0
  • Joined: 2008/09/17 05:10:00
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/07 06:53:53 (permalink)
5 (1)
Hello
 
Reading this thread https://www.microchip.com/forums/m1113598.aspx suggested by Laffelt, Paul talks about RF3...
I do not use RF3 so it is setup as an output drive low. Just by setting it High, USB works!!!! I didn't have that problem in previous projects. Let me check the errata, there may be a bug depending on the version...
 
Stephane.
#12
Paul PortSol
Super Member
  • Total Posts : 534
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/09 05:24:34 (permalink)
0
Check your populated full part number for USB's TPS2051 IC, the suffix can change the drive level Hi/Lo.
Paul
#13
laffelt
Super Member
  • Total Posts : 152
  • Reward points : 0
  • Joined: 2008/05/08 18:05:53
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/09 09:51:10 (permalink)
0
lelsteph,
 
In my project the USB was using Timer0, it was configured for something like a 10kHz interrupt. As I configured the USB first that was the timer it allocated for itself. This was different from an earlier version of Harmony I had been using. As long you are using a different timer and havent changed the first timer you should be fine. Since you has some success getting it working it sounds like you do not have a timer issue like I had.
#14
lelsteph
Super Member
  • Total Posts : 401
  • Reward points : 0
  • Joined: 2008/09/17 05:10:00
  • Location: 0
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/09 10:09:30 (permalink)
0
Hello
 
@Paul: what is TPS2051 ?
 
@laffelt: Timer0 is used by the Timer Service.
 
There is nothing in the errata about that crazy behavior of RF3/ID...
 
Thank you 
#15
Paul PortSol
Super Member
  • Total Posts : 534
  • Reward points : 0
  • Joined: 2015/07/03 11:52:03
  • Location: Newfoundland, Canada
  • Status: offline
Re: Harmony v2.06 USB not working PIC32MZ2048EFH064 2019/12/09 10:47:47 (permalink)
0
Stephane,
What IC do you have between the PIC and the USB Connector?
 
Mine uses a TPS2051CDBVR, and something in the "CDBVR" specifies the control signals, see datasheet. The TPS2051 was used an earlier PIC32MZ demo board.
 
Check the polarity of control signals used by your USB Interface IC.
 
Paul
#16
Jump to:
© 2019 APG vNext Commercial Version 4.5