• AVR Freaks

Hot!MCC oddities when using TCP/Lite and PIC16F18446

Author
obones
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2006/03/06 08:15:09
  • Location: 0
  • Status: offline
2019/08/20 05:37:29 (permalink)
0

MCC oddities when using TCP/Lite and PIC16F18446

Hello,
 
I'm trying to use the MPLab Xpress PIC16F18446 board (A08-2889) to acquire a serial signal and send it over a local ethernet network.
Using MCC inside MPLab (installed last week), I was able to follow the steps outlined in AN1921 and I have a compiling test code for use with a ENC28J60 based module. As that module will take a few days to arrive, I started using MCC to parameter everything, noticed some strange things and wonder what I may have missed.
 
First, the SDO1 function of the MSSP1 module is not connected to anything and no warning is emitted. But if I'm correct, the ENC28J60 requires both SDI and SDO to function properly, not just SDO. Using the Pin Manager grid view, I'm successfully able to assign RC1 to SDO.
 
Second, when I start MPLab and it reopens my project from the day before, I see the following message in the MCC notifications:
Pin Module - Warning - Function "SDA1" does not have output setting "RB4PPS" set to pin "RB4".
If I go into the Pin module, I see no way of setting RB4PPS with an intuitive set of checkboxes. But what's even weirder is that if I go into the "MSSP1 (Foundation services)" tab and that I check and uncheck the "Enable I2C" checkbox, then the warning goes away.
What's annoying, though, is that when I do that "check/uncheck" step, it removes the RC1 assignment done for SDO and I have to remember doing it again as I still don't get any warning.
 
Third, there is this hint from TCP/IP Lite:
Add Network_Manage( ) in the main while loop
But it does not disappear despite having that exact call inside the main while loop, just like in the AN1921 examples.
 
This is done with MPLab X 5.25, MCC 3.85.1 and TCP/IP Lite 2.2.8
 
What did I miss?
#1

7 Replies Related Threads

    katela
    Super Member
    • Total Posts : 1830
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: MCC oddities when using TCP/Lite and PIC16F18446 2019/08/21 11:10:27 (permalink)
    0
    obones
     
    First, the SDO1 function of the MSSP1 module is not connected to anything and no warning is emitted. But if I'm correct, the ENC28J60 requires both SDI and SDO to function properly, not just SDO. Using the Pin Manager grid view, I'm successfully able to assign RC1 to SDO.


    You are correct, the SPI communication with the ENC28J60 will require both SDI and SDO pins. As you have correctly assigned them. I Believe they are PPS pins.
    obones
     
    But what's even weirder is that if I go into the "MSSP1 (Foundation services)" tab and that I check and uncheck the "Enable I2C" checkbox, then the warning goes away.What's annoying, though, is that when I do that "check/uncheck" step, it removes the RC1 assignment done for SDO and I have to remember doing it again as I still don't get any warning.


    Are you using SPI and I2C from the same MSSP1 with both libraries?
    This simple example also describes the same steps as the AN1921 in case you missed something.

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #2
    obones
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2006/03/06 08:15:09
    • Location: 0
    • Status: offline
    Re: MCC oddities when using TCP/Lite and PIC16F18446 2019/08/21 12:54:49 (permalink)
    0
    Ok, so my configuration is correct, but I would have expected to receive a warning from MCC.
    As to I2C, I don't need it and it has to stay unchecked. It's just that turning it on then off it's the only way that I found to get rid of the MCC warning related to the RB4 pin.
     
    Thanks for the example, it's very similar to what's in the Application Note. What's clearer, though, is that to get the mode options for MSSP1, one has to "add" the first of the two options, the one that is named "MSSP1 (PIC10 / PIC12 / PIC16 / PIC18 MUCs by Microchip Technology, Inc."
    However, if I do that, I get the following warning in MCC:
    Please load MSSP1 (Foundation Services Library) for the MAC configuration or generated code may not compile
    And with that, the generated code does not indeed compile.
     
    To me it seems like there is some sort of mixup between the two possible ways to configure MSSP1 and I'm not sure how this will behave. I'll have to wait for the ENC28J60 module to arrive to fully test this.
     
    Thanks for your anwser
     
    #3
    obones
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2006/03/06 08:15:09
    • Location: 0
    • Status: offline
    Re: MCC oddities when using TCP/Lite and PIC16F18446 2019/10/24 07:40:24 (permalink)
    0
    The ENC28J60 finally arrived and communication is working fine with the PIC, so clearly, the warning can be ignored in my case. Not nice, though.
    #4
    oliverb
    Super Member
    • Total Posts : 285
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: MCC oddities when using TCP/Lite and PIC16F18446 2019/12/08 13:00:02 (permalink)
    0
    I'm interested in running a similar setup, but in my case I'm using a PIC18F46K42 on an xpress board as host, and an old Mikroelektronika serial Ethernet board, old enough it still has the DIP part not SMT on.
    I think I wasted much of the weekend wondering why it wouldn't run until I found that the SPI output wasn't configured.
     
    I've got it to connect to my router, it responds to PING mostly, though it seems to suffer from a delayed connection: the first PING after a reset fails.
     
    I've pasted in the TCP demo code, and the demo application connects to it.
     
    Now I wonder if it can be turned into a http server?
     
    #5
    katela
    Super Member
    • Total Posts : 1830
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: MCC oddities when using TCP/Lite and PIC16F18446 2019/12/08 13:27:55 (permalink)
    0
    The TCP/IP lite stack doesn't support the HTTP protocol at the moment. This is the lite version, fot HTTP and other protocols, use the full TCP/IP stack.

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #6
    oliverb
    Super Member
    • Total Posts : 285
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: MCC oddities when using TCP/Lite and PIC16F18446 2019/12/09 03:22:42 (permalink)
    0
    How about telnet? That's pretty close to just being a bare socket.
    #7
    katela
    Super Member
    • Total Posts : 1830
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: MCC oddities when using TCP/Lite and PIC16F18446 2019/12/10 05:35:00 (permalink)
    0
    You can read the datasheet to find out what's supported and what's not, or add it your MCC project and see which protocols you are able to use.

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5