• AVR Freaks

Hot!USB MCC PIC24FJ128GB202 Hmm

Author
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
2020/07/10 20:16:38 (permalink)
0

USB MCC PIC24FJ128GB202 Hmm

USB question #128564 from me.  I created a new MCC configuration for USB and TCP/IP stack.  Reason I mention TCP/IP stuff is because I had to negotiate on system settings to allow FOSC/2 = 16MHz with USB = 48MHz to allow both to work.  I checked clock output via forward to pin and am measuring what I expect core to be running at.  I am also getting the chip to enumerate without problems as a COM port via CDC.  Scoped D+/D- and USB is sitting there doing its handshake.  I included (checked in MCC) the example_mcc_usb_cdc option on creation.  When I go to execute the corresponding MCC_USB_CDC_DemoTasks() or alternately call a USB command contained in the library such as putUSBUSART() from main() directly, it compiles fine but during runtime I get absolutely nada listening to the COM port via PC.  So I guess my question is this pass, knowing that I can use an MLA instruction set to make this work, having a desire to strip out MLA overhead I don't need (and just get this working from the ground up on its own via canned includes), is there some kind of magic initialization that needs to take place on top of this?  Anyone try that route out with similar or different experience?
 
What I think I know: oscillator fine, includes for USB fine, linker files fine, it appears that I am missing some configuration info for formatting that was included in the MLA example, but I tried setting that in the MCC generation and still no luck.  By that I mean specifically this from MLA.  I just tacked it on to the DemoTasks() function in the MCC generated block.
 
void APP_DeviceCDCBasicDemoInitialize()
{
    line_coding.bCharFormat = 0;
    line_coding.bDataBits = 8;
    line_coding.bParityType = 0;
    line_coding.dwDTERate = 9600;

    //buttonPressed = false;
}
    
 
I'm hoping there is something stupid I am missing as is usually the case.
#1

4 Replies Related Threads

    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11936
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: USB MCC PIC24FJ128GB202 Hmm 2020/07/10 20:39:10 (permalink)
    0
    What makes you believe the MLA code has "overhead" that MCC doesn't have?  And even if it does, why is that worth spending time on?
    #2
    IBrokeIt
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2019/08/13 12:07:00
    • Location: 0
    • Status: offline
    Re: USB MCC PIC24FJ128GB202 Hmm 2020/07/10 20:53:46 (permalink)
    0
    The overhead I mention is just the built in lights, buttons, and app space that I wouldn't ordinarily include in program.  It's really trivial, doesn't result in much and can be deleted.  As far as worth spending time on, I actually really really like this MCC interface (I know it's an evil that more experienced folks shun) primarily for on the fly IO repurposing and generic code include generation.  (It's also a royal pita for me to take multiple MLA demo projects and merge a half a dozen folders deep worth of relevant includes into a project).  I'm looking at this 5 times over now and think I have everything configured how I need it to be.  I'm going to go back to the MLA example and try piecewise copying over demo task stuff until I see if I am missing something.  I was more just hoping for someone to look at this and be like "oh, I had the same problem...it generates all the relevant includes but doesn't initialize the app or call tasks it needs to on it's own with test example inclusion."  I know nebulous and a long shot but figured what the heck.
    #3
    IBrokeIt
    Starting Member
    • Total Posts : 64
    • Reward points : 0
    • Joined: 2019/08/13 12:07:00
    • Location: 0
    • Status: offline
    Re: USB MCC PIC24FJ128GB202 Hmm 2020/07/10 21:57:49 (permalink)
    +1 (1)
    Alright, figured it out.  Turns out it had nothing to do with configuration, includes, or MCC really.  The generated example, although it has a built in example.c file does not have a corresponding .h for whatever reason and the only issue was that the example function was missing a function prototype which I totally overlooked.  That and when I called library functions directly from main() I did not explicitly call for task updates().  So it basically just looked like nothing responded from 2 separate angles.  But it does.  Would like to go back and delete this thread but not having that option, I have decided to leave it and brag to the forum that I am a bozo.  <flex>
    #4
    ric
    Super Member
    • Total Posts : 28009
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: USB MCC PIC24FJ128GB202 Hmm 2020/07/11 00:19:41 (permalink)
    +1 (1)
    so you can now be known as "IFixedIt" ? :)
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    Jump to:
    © 2020 APG vNext Commercial Version 4.5