• AVR Freaks

AnsweredHot!PIC32MZ USB without Harmony

Author
JEdgar
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2015/02/04 12:20:49
  • Location: 0
  • Status: offline
2017/09/28 11:50:50 (permalink)
3 (1)

PIC32MZ USB without Harmony

I'm currently developing a simple USB CDC device.  I have no problem running the harmony tool and setting up a USB CDC device.  However, I want to write this implementation from scratch without the tool.  I have been able to configure the interrupts, enable the USB and trigger on USB traffic. I receive the first setup packet requesting the device descriptor.  I load the FIFO with the appropriate device descriptor information but fail to see any traffic heading back to the computer.  Haven't been able to find any helpful documentation.  The most help so far is: http://aiju.de/misc/pic32mz-usb  Of course I've been scanning the datasheet and the DS60001326 app note, both aren't much help...  Any suggestion as to what is needed to pipe data out of endpoint 0?
 
--Joey
 
#1
Larry.Standage
Super Member
  • Total Posts : 901
  • Reward points : 0
  • Joined: 2011/12/30 09:50:47
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2017/09/28 12:23:08 (permalink) ☼ Best Answerby JEdgar 2017/09/28 13:55:17
4 (2)
You might take a look at what was done for implementing USB in the chipKIT core. While it hasn't been merged and released, there is a pull request for a working implementation of CDC, HID, Keyboard, Mouse, etc. No Host implementation yet, but that should come in the future.
 
https://github.com/chipKIT32/chipKIT-core
 
Look under the pull request:
Usb stack and board cleanup #363
#2
JEdgar
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2015/02/04 12:20:49
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2017/09/28 13:35:26 (permalink)
0
Excellent! Larry your comment is much appreciated. I found were they are setting up the endpoints and pushing data out (USB_HS.cpp). I'll do a quick update to my code and see where it goes.  I'll keep you posted.
#3
JEdgar
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2015/02/04 12:20:49
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2017/09/28 13:57:30 (permalink)
3.5 (2)
Thank you!  Got it working.  Needed to define EP0 buffer size. 
 
USBE0CSR0bits.TXMAXP = 64; // EP0 TX buffer size 64 bytes
 
#4
Joe
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2015/11/17 06:43:52
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2017/11/15 11:17:52 (permalink)
0
Hello JEdgar,
 
I am currently also on a project where I try to get USB going wihout using Harmony.
 
Is there any change to get the initialisation or even a example with sending data to the pc to this topic?
It looks like you got it working just fine and I have trouble to get it working.
 
—Joe
#5
ee91137
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2018/05/08 17:21:35
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2018/05/09 05:57:20 (permalink)
0
Hi JEdgar,
I am also looking to make my USB work without Harmony, can you share you code / solution ?
Thanks
#6
JEdgar
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2015/02/04 12:20:49
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2018/06/29 14:00:06 (permalink)
3.5 (2)
Sorry ee91137, I'm not going to make it that easy for you.  Larry pointed out an excellent source to learn how to use the USB registers. https://github.com/chipKIT32/chipKIT-core If you have a specific question about the USB registers our how to use them I'll gladly help you.
Kind regards, Joey
#7
NKurzman
A Guy on the Net
  • Total Posts : 17480
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2018/06/29 15:39:54 (permalink)
3 (1)
Another Option would be to make a USB Only Project with Harmony.  Then code the Rest without Harmony.
#8
JPortici
Super Member
  • Total Posts : 691
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: PIC32MZ USB without Harmony 2019/01/07 08:12:59 (permalink)
0
Which isn't an option if the current implementation is buggy and previous implementation aren't available for your device
 
Altough one can generate the project and copy over all the needed files and make all the manual changes
#9
marekb
Starting Member
  • Total Posts : 77
  • Reward points : 0
  • Joined: 2010/10/09 00:28:42
  • Location: 0
  • Status: offline
Re: PIC32MZ USB without Harmony 2019/01/10 16:43:14 (permalink)
0
What wromg is with Harmony? You can easily separate only the USB related source files, then  put them in a separate build directory and merege with other source.
#10
Jump to:
© 2019 APG vNext Commercial Version 4.5