• AVR Freaks

Hot!Fiber ethernet on pic32mz

Author
Thorben.Z
Starting Member
  • Total Posts : 32
  • Reward points : 0
  • Joined: 2017/06/03 06:33:33
  • Location: 0
  • Status: offline
2020/08/11 08:43:02 (permalink)
4 (1)

Fiber ethernet on pic32mz

I plan to use a pic32mx170f256b or pic32mz1024efh064  connecting to a LAN9250 ethernet controller chip using (quad) SPI, that will then connect to a 100base-fx SFP module.
 
Will I be able to just plug the other side of the fiber into an sfp media converter, and is there any rough estimation of the throughput I might get, after the overhead of the TCP/IP stack? I'd guess the limiting factor is the slow-ish SPI interface on the mx series pic, so maybe I could use either the qSPI or EBI on the mz series one, if the normal spi speed is too slow.
And most importantly, will this even work? I have never used SFP modules before, and reading up on it is a little bit confusing...
 
Not quite sure where else to ask this :/
And for those wondering why I'd even do this: It is a data link to a tesla coil driver, and I'd rather not use copper cables connecting to any electronics anywhere near a thing that can make 3m arcs ;)
#1

10 Replies Related Threads

    friesen
    Super Member
    • Total Posts : 2150
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/14 14:16:17 (permalink)
    0
    If its a one off, why not either use a fiber to ethernet converter, or a wifi module?

    Erik Friesen
    #2
    Thorben.Z
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2017/06/03 06:33:33
    • Location: 0
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/14 14:36:18 (permalink)
    0
    No it wouldn't necessarily be a one of. The Tesla coil driver that it is for, is an open source design that quite a few people have already built, so I expect that a working ethernet addon will be made by quite a few people.
     
    The media converter is a good idea, but since I need to add an ethernet chip anyway (the controller does not have one usually) I may as well use one that natively supports fiber ;)
     
    The wifi modules that I have tried tend to be unhappy once a ground strike occurs (the arc discharging directly into a grounded object, which is electrically very noisy) and loose connection.
    #3
    MisterHemi
    Super Member
    • Total Posts : 293
    • Reward points : 0
    • Joined: 2017/11/02 12:24:21
    • Location: Commerce, CA USA
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/15 07:22:47 (permalink)
    0
    In regards to throughput I don't think a fiber connection would be a problem as fiber can handle data rates much faster than the PIC can stream.
     
    I think SPI on the PIC32MZ may have a maximum rate of around 50Mbps. The Ethernet should be able to send at its maximum rate of 100Mbps.
     
    Perhaps this is something you're looking for:
    www.microchip.com/wwwproducts/en/VSC8211

    My configuration:
    MacBook Pro (Retina, 15-inch, Mid 2015) with MacOS Mojave (10.14.6) and MPLAB X IDE v5.30
     
    Curiosity PIC32MZ EF 1 & 2, PIC24F Curiosity, XPRESS EVAL BOARD (PIC16F18855), SAMA5D3 Xplained and various custom boards.
    #4
    Thorben.Z
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2017/06/03 06:33:33
    • Location: 0
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/15 08:05:42 (permalink)
    0
    50Mbps should be plenty (more with qSPI?), even after the stack overhead. We currently have a UART stream with CRC checking on every packet with much less throughput and it is fine.
     
    The VSC8211 is only a phy though, so if I understood correctly I would need a pic with an integrated ethernet module to use it, wouldn't I? 
    EDIT: I completely forgot the fact, that the mz series have a builtin mac...
    The other issue with that chip is the package and the fact that it doesn't seem readily available. I can solder BGAs no problem, but since this is an open source project and I'd expect other people will build one of these boards too, I'd like to keep things accessible, even for people with only a soldering iron.
    Also that chip seems to be designed for Gbps applications. much higher than I'd need :)
    post edited by Thorben.Z - 2020/08/15 08:31:39
    #5
    Jim Nickerson
    User 452
    • Total Posts : 6736
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/15 08:40:13 (permalink)
    4 (1)
    Have you looked at these ?

     

    Attached Image(s)

    #6
    Thorben.Z
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2017/06/03 06:33:33
    • Location: 0
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/15 11:09:49 (permalink)
    0
    No I haven't...
     
    Is there any disadvantage to the chip I selected over those suggested?
    If possible I would like to use one that has a mac build in, as I could then use a smaller pic (at least I don't know of a 28 pin one that has a mac).
    Though that does make the post title a little misleading, as it isn't necessarily for pic32mZ anymore...
     
    The guy that makes the driver just said that the throughput required is <1Mbps, so even a slow pic would pe perfectly fine in terms of SPI speed.
    #7
    friesen
    Super Member
    • Total Posts : 2150
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/15 11:17:34 (permalink)
    1 (1)
    weeping..  weeping..  Sort of like driving the classic vw on the autobahn in the fast lane.

    Erik Friesen
    #8
    ShaikhsPro
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2020/07/08 07:56:32
    • Location: 0
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/15 11:19:14 (permalink)
    0
    About fibre on PIC32MZ, I've developed a project in which I've connected the LAN9353 (2 port fibre switch) to my PIC32MZ1024EFM144 microcontroller. According to my personal experience, the best and fast method is to develop the project is to start it with the PIC32 Starter kit 2. The starter kit supports 2 copper port switch LAN9303. The drivers of both these switches are exactly the same (the only difference is the PHY Address). Hence you can use the referential design and firmware of the "PIC32 Starter kit 2 + LAN9303" and later you can simply replace the switch by LAN9353 by keeping all other configuration exactly the same. In addition, In MPLAB Harmony you'll get the ready-made drivers file and sample codes related to everything (All TCP/IP codes too). 
     
     
    PIC32 Starter Kit 2: https://www.microchip.com...ductDetails/dm320004-2
    Lan9303: https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/AC320004-4
    Lan9353: https://www.microchip.com/wwwproducts/en/LAN9353
    #9
    Thorben.Z
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2017/06/03 06:33:33
    • Location: 0
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/16 04:24:40 (permalink)
    0
    Sort of like driving the classic vw on the autobahn in the fast lane.



    Well as I said in my first post: The reason for doing this is to get isolation and protection against arc strikes. No matter how good the internal isolation in ethernet hardware might be, it does nothing when an arc that is over 3m long hits the copper cable and even if it did the cable would still get heavily burned and damaged. Fiber has the benefit of being the worlds largest optocoupler ;)
     
    ...is to start it with the PIC32 Starter kit 2

    I'll look into it thanks :) Nice of microchip (or whatever company originally made these) to make the chips so compatible.
    #10
    vexorg
    Super Member
    • Total Posts : 83
    • Reward points : 0
    • Joined: 2019/09/27 10:59:40
    • Location: 0
    • Status: offline
    Re: Fiber ethernet on pic32mz 2020/08/27 13:56:21 (permalink)
    3.5 (2)
    It should support 100Mbs ethernet. I'm looking at the KSA8041 as it'll do fibre and copper on one PHY chip. MII is 4-bit clocked at 25MHz, or RMII is 2bit clocked at 50MHz.
     
    The layout will need a bit of careful working out, but the sample board in the SDK doc shows how it can be done for both fibre or copper.
     
    Ethernet might be real overkill, and a simple uart  with HFBR1414 / HFBR2412 fibre transmitters receivers would do the same job. Not sure who makes them now, was HP, then agilent, then avago, they keep changing company. A simple mosfet driver is all you need to switch the output off and on. And ST-ST multimode preterminated fibre is cheap.
    #11
    Jump to:
    © 2020 APG vNext Commercial Version 4.5