PIC18F66J60 / 18F66J90 - Integral Ethernet

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: PIC18F66J60 / 18F66J90 - Integral Ethernet

Post by Jerry Messina » Sun Apr 05, 2015 3:59 pm

Here's a package that adds support to the TCP/IP library for the 18FxxJ60 family of devices with internal ethernet.

The zip file contains the following:
  • Ethernet (dir)
    - adds new file eth97J60.bas
    - modified MAC.BAS file to add support for 18FxxJ60
    - copy of the remaining original Ethernet library files (unmodified)

    Copy the contents of these to your existing SF installation directory:
  • Swordfish\Includes (dir)
    - new updated devices files for the J60 family (required)
  • Swordfish\UserLibrary (dir)
    - modified USART.BAS to support all 8/16 bit SPBRG/SPBRGH register combinations
  • PIC_WEB_67J60.bas
    - config, osc, and hdw setup for Olimex PIC-WEB board (18F67J60)
  • basicJ60Test.bas
    - simple serial test program for the 67J60
  • EthernetTest.bas
    - version of the test sample code on the main Ethernet library wiki page
  • EthernetICMP.bas
    - version of the Ping sample code (no DNS) from EthernetICMP
  • EthernetTCPServer.bas
    - version of the TCP server sample code from EthernetTCPServer
I tested these on an Olimex PIC-WEB board running at 25MHz and 41.66MHz and it seems to work ok.

Give it a try and if it all works out I can add it to the wiki.
Attachments
sfEthernetJ60.zip
(169.49 KiB) Downloaded 201 times
Last edited by Jerry Messina on Fri Sep 04, 2015 12:02 pm, edited 1 time in total.
Reason: change '#option ETH_MAC' to allow selecting internal/external MAC (see post below)

User avatar
Coccoliso
Posts: 152
Joined: Mon Feb 17, 2014 10:34 am

Re: PIC18F66J60 / 18F66J90 - Integral Ethernet

Post by Coccoliso » Mon Apr 06, 2015 7:15 am

It's a shame that there is only SMD! :?
Is there something similar with old features DIP?

Wobbles
Posts: 9
Joined: Sun Mar 22, 2015 4:07 pm
Location: Torbay, Devon, u.k.

Re: PIC18F66J60 / 18F66J90 - Integral Ethernet

Post by Wobbles » Mon Apr 06, 2015 10:54 am

Coccoliso wrote:It's a shame that there is only SMD! :?
Is there something similar with old features DIP?
I was lucky Santa brought me a dev board with this icon it then Microchip sent me a sample and I happen to have acquired a 64 pin ZIF (burn in socket they called it) . Just perfect for these.
Last edited by Wobbles on Mon Apr 06, 2015 10:59 am, edited 1 time in total.
Me ? No I'm not confused , well I don't think I'm am, well maybe your right !

Wobbles
Posts: 9
Joined: Sun Mar 22, 2015 4:07 pm
Location: Torbay, Devon, u.k.

Re: PIC18F66J60 / 18F66J90 - Integral Ethernet

Post by Wobbles » Mon Apr 06, 2015 10:57 am


After an intellectual effort ..
I added the ping function to the W5500 library.
Cool going to try this on Friday.

:-)
Me ? No I'm not confused , well I don't think I'm am, well maybe your right !

User avatar
RangerBob
Posts: 152
Joined: Thu May 31, 2007 8:52 am
Location: Beds, UK

Re: PIC18F66J60 / 18F66J90 - Integral Ethernet

Post by RangerBob » Wed Apr 08, 2015 8:48 am

Nice one Jerry,

I'll download it and give it a buzz at some point this week on our PICDEM2 board, plus a couple of custom boards I have.

Regards,

Rangerbob

Jerry Messina
Swordfish Developer
Posts: 1469
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: PIC18F66J60 / 18F66J90 - Integral Ethernet

Post by Jerry Messina » Wed Apr 08, 2015 8:59 am

I probably should have mentioned that with the way I modified MAC.BAS if the device file has the ethernet flag set (#const _ethernet = $01) then it'll automatically pick the new eth97J60 internal driver... there's no way to change that w/out modifying the logic in MAC.bas.

I added an '#option ETH_MAC' to the file but the '_ethernet' flag overrides it. One way to change that would be to have the '_ethernet' flag set the #option. That way you could override it if desired.

Change MAC.BAS from:

Code: Select all

// default MAC selection if not internal
#option ETH_MAC = ENC28J60

#if (_ethernet = 1) or (ETH_MAC = ETHXXJ60)
// 18FxxJ60 with internal ethernet
to

Code: Select all

#if (_ethernet = 1)
// use internal ethernet
#option ETH_MAC = ETHXXJ60
#else
// default MAC selection if not internal
#option ETH_MAC = ENC28J60
#endif

#if (ETH_MAC = ETHXXJ60)
// 18FxxJ60 with internal ethernet
That way if you want to use the ENC28J60 over the internal one then just set '#option ETH_MAC = ENC28J60' before including the network files

note: I've updated the zip file to include this modification

Post Reply