• AVR Freaks

Hot!PIC18F96 and friends, which MCU with Ethernet MAC and PHY?

Author
nyholku
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2008/04/30 05:13:58
  • Location: 0
  • Status: offline
2020/01/13 08:37:04 (permalink)
0

PIC18F96 and friends, which MCU with Ethernet MAC and PHY?

Hi,
 
I'm looking to re-desing a PIC18F45K50 based design to replace USB with Ethernet.
 
My requirements are modest, the current application fits into about 40 kB code and uses about 1 kB RAM, one 8 bit PWM at 1.5 kHz and a 100 kHz timer interrupt to generate some step pulses for a four stepper motors.
 
Obviously would be nice to get a little bit more of everything if I upgrade but there is no dramatic need to get 'more' of everything.

Nothing like what I could get at almost the same price (meaning a few dollars more makes no difference) with ARM based Cortex CPUs with floating point and memory management. With ARM I would get more complexity and an unfamiliar MCU and development environment which is not attractive but not an obstacle.

The main thing I would like to get is faster execution by factor of x2 ...  x3 to be able to get equivalent increase in my step pulse generation (timer interrupt frequency) and a bit more code space and RAM.
 
PIC18F96J60 looks like a strong contender.
 
 
But what other options I have (not sure if it is kosher to suggest non-Microhip solutions, but for me that is ok)?

All thoughts and comments around the topic are welcome.
 
wrb Kusti
 
#1

19 Replies Related Threads

    katela
    Super Member
    • Total Posts : 1564
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/13 08:44:05 (permalink)
    0
    Try Microchip Advanced Part Selector to check if you could get a suitable replacement that meets your requirments.

    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
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/13 11:05:21 (permalink)
    2 (1)
    Thanks, looks like all the other Microchip options cost more that RaspberryPI...
    #3
    Mysil
    Super Member
    • Total Posts : 3642
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/13 12:31:27 (permalink)
    0
     
    As far as I understand, PIC18F__J60  is the family of 8-bit PIC devices with Ethernet transciever builtin,
    for wired ethernet.
    PIC18F67J60  might be a possibility, it have fewer pins and more memory than PIC18F96J60,
    or do you really need a 100 pin device?
     
    There is some support for these devices with Microchip Code Configurator MCC TCP/IP Lite Stack,
    Se MCC Library Release Notes: https://www.microchip.com/mplab/mplab-code-configurator
    Scroll down to 'Current Download'  tab, and search among 'Application Libraries'
    Also see:  https://www.microchip.com/SWLibraryWeb/product.aspx?product=TCPIPSTACK
    and:   https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en573940  
     
    There is also ENC28J60 which I believe is about the same chip,
    preprogrammed with the lower layers of IP stack.
    https://www.microchip.com/wwwproducts/en/ENC28J60
     
        Mysil
    #4
    MCT
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2013/01/28 20:54:45
    • Location: Canada
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/13 12:31:55 (permalink)
    0
    Hi Kusti, for what you describe the PICF96J60 sounds like a good candidate. That part has become my go-to when building simple web-enabled devices. There are a lot of variants, if you want to add extra interfaces, memory, etc. The ethernet circuit is very simple to build, with a few parts and transformer. On the down-side it is limited to 10MBPS. I use it to control several motorized devices, some with PWM. No stepper so far. I use an embedded web page for control and configuration, and the bootloader for field programming.
     
    Now it's interesting that you wish to replace USB with ethernet. I would like to add USB host capability to the PIC18F96J60. My intention is to plugin in something simple like a USB footpedal to capture its position and control a motor. Any thoughts on that? (I suppose I could start a thread about that but your post just reminded me of this). For that project I'm currently building the non-USB prototype using a POE developer kit.
    MCT
     
     
     
    #5
    ric
    Super Member
    • Total Posts : 25592
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/13 15:21:39 (permalink)
    0
    You won't get USB host functionality in a PIC18F device.
    You could just add on a slave PIC32MM0064GPM028 to do it for you.
    They're pretty small, and dirt cheap.
    I'm just about to head down that path myself. See: https://www.microchip.com/forums/m1104910.aspx
     

    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!
    #6
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/14 07:24:07 (permalink)
    4 (1)
    @MCT I want to get rid of the USB because it is not isolated and very sensitive motor generated interference.

    @Mysil, Yes I do not need 100 pins, that PIC18F67J60 you mention is an option. Need to look into ENC28J60.

    Thanks everyone.
    #7
    NKurzman
    A Guy on the Net
    • Total Posts : 18266
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/14 07:37:29 (permalink)
    5 (1)
    You can buy USB Isolater ICs from Analog Devices.
     
    Note for PICF96J60 the TCP/IP Stack is limited and the memory is not sufficient for https
    #8
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/18 09:34:31 (permalink)
    0
    Hi, looks like I want to try PICF96J60.
     
    Which and where is the TCP/IP stack?
     
    I tried to find Microchip Lite. I only find the AN1921 which seems to contain the code but is that really how the library is distributed?
     
    Also by default it uses some PIC16 with ENC28J60.
     
    Harmony seems to be for PIC32 only.
     
    So which are my options and what is recommended, some one in some forum said Lite is obsolete...
     
    #9
    NKurzman
    A Guy on the Net
    • Total Posts : 18266
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/18 10:32:21 (permalink)
    0
    You need to download MLA. Possibly an older version. That is an old PIC. I assume not supported by MCC.
    #10
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/18 10:35:54 (permalink)
    0
    Thanks. Hmm, older PIC eh? For my re-design, maybe I should shop around  more for a more modern chip... but I prefer to keep simple things simple and have and having to learn a lot of stuff I have no use...
     
    #11
    katela
    Super Member
    • Total Posts : 1564
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/18 11:01:54 (permalink)
    0
    Lite is not absolute, which thread are you referring to? The lite is a simplified version of the full TCP/IP stack which you can get by downloading MLA. To use the TCP lite stack you will need a newer PIc supported bu MCC

    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
    #12
    Mysil
    Super Member
    • Total Posts : 3642
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/18 15:12:37 (permalink)
    0
    Hi,
    The PIC18  family of Ethernet microcontrollers, PIC18FxxJ60
    are all supported by MPLAB Code Configurator, MCC.
     
    Read Release Notes for Device library PIC10/PIC12/PIC16/PIC18 library v1.78.1
    See the same link given already in message #4 above:
    https://www.microchip.com...plab-code-configurator
    Scroll down to Tab marked 'Current Download' and open it.
     
    Note that there are separate links for the various library software packages,
    and the corresponding Release Notes document.
     
    TCP/IP Lite Stack  version 2.2.12   released  12/11/2018  is among the application libraries.
    It may be used with any of the PIC18FxxJ60 microcontrollers, which have its own Ethernet interface,
    Or with ENC28J60 together with any microcontroller  that have SPI interface and is supported by MCC.
    Read the Release Notes for TCP/IP Lite Stack in MCC.
     
        Mysil
    #13
    Jerry Messina
    Super Member
    • Total Posts : 460
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/18 17:02:28 (permalink)
    4 (1)
    Or with ENC28J60 together with any microcontroller

    Or the ENCxxJ600, which is 10/100Mbit, and choice of SPI or parallel interface
    #14
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/19 11:10:58 (permalink)
    0
    Thanks for the pointers to the stack/MCC. Downloading as I write this.

    However, noticed two things which I think are a deal breaker. 
     
    Flash only rated for 100 writes ... in debug mode I go through through that in a week. No a big expense but...
     
    But more importantly it cannot be programmed without a programmer in the field. The whole memory is one big block with no provision for a boot block. 

    That is a bummer as firmware upgrades are a fact of life, and to require the customer to have a PICKit at hand is not good.
     
    So back to square one, perhaps adding ENC28J60 to my existing PIC18F45K50 design could do the trick. The 45K50 SPI is max 12 MHz so about 10x bandwidth that I need from the USB/Ethernet so that gives me some hope. And while making the firmware upgradable via Ethernet seems like a lot of work customers could at least use a USB cable for the firmware upgrade.
     
     
     
    #15
    Jerry Messina
    Super Member
    • Total Posts : 460
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/19 15:51:25 (permalink)
    0
    If your intent is to have both USB and Ethernet then you'll need a chip with more program space than the 45K50. The 32K will just barely get the basic network stack up. I'd go with a chip with 128K like the 18F67J94
     
     
    #16
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/20 05:46:21 (permalink)
    0
    My USB bootloader fits into the 2kb boot block of PIC18F45K50 so I should be able to fit both USB and TCP/IP especially as I intend to use only UDP.

    I'm using the Diolan boot loader which I've tuned up a bit, here:
     
    https://github.com/nyholku/diolan-plus2
     
     
    #17
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/20 05:57:55 (permalink)
    0
    Editing posts seems to be forbidden so reposting here:


    My USB bootloader fits into the 2kb boot block of PIC18F45K50 so I should be able to fit both USB and TCP/IP especially as I intend to use only UDP.

    I'm using the Diolan boot loader which I've tuned up a bit, here:
     
    https://github.com/nyholku/diolan-plus2
     
    Also, I had a bried look at the 18F67J94 and it seems to suffer from the same problem as PIC18F96 in that it cannot be programmed without an ICSP in the field. The whole Flash memory is one big block with no provision for a boot block.
     
     
    #18
    Jerry Messina
    Super Member
    • Total Posts : 460
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/20 07:06:10 (permalink)
    5 (1)
    I'm not sure where you get that idea. I have bootloaders running on the J94 with no problems.
    You can write-protect the pages occupied by the bootloader if desired. Check the documentation for CONFIG4.
     
    You can have a bootloader in the J60 as well... you just can't write-protect it.
    #19
    nyholku
    Junior Member
    • Total Posts : 112
    • Reward points : 0
    • Joined: 2008/04/30 05:13:58
    • Location: 0
    • Status: offline
    Re: PIC18F96 and friends, which MCU with Ethernet MAC and PHY? 2020/01/20 08:04:52 (permalink)
    0
    Ok, like said (or tried to ;) I had a brief look. I will need to look at this more carefully. J60 manual said it is all one block ... I took this to mean that you have to erase the whole Flash making a bootloader impossible. I guess I read too much to that statement. My bad.
     
     
     
    #20
    Jump to:
    © 2020 APG vNext Commercial Version 4.5