User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Miscap - PiZero Ethernet pHAT

Mon Nov 30, 2015 4:33 pm

The ebay is full of ENC28J60 Ethernet LAN Network Module For Arduino for less than what the chips cost.

So why not just make the mechanics to plug in a module like this on top of the PiZero. The 40-pin socket would have 10mm pins to allow more stacking.

Image

Image

I ordered a module like this to my PiZero. The plan is to order a small amount of boards too together with the sockets, spacers and screws.

My plan was to set up the Ethernet module on the 2nd SPI port CE0.

If someone want to join drop me a line. I am only buying the PCB's, sockets, spacers and screws. You have to do the soldering by yourself. The estimated price is around the same as PiZero. You still have to order one ENC28J60 board from ebay by yourself (they typically cost 3€) to get any functionality.

Disclaimer: I have no idea if this works or not. Theoretically you should be able to put a blob in the Device Tree and get this to work. Others have succeeded viewtopic.php?f=44&t=18397
Last edited by karrika on Fri Apr 08, 2016 7:07 pm, edited 1 time in total.

User avatar
DougieLawson
Posts: 36156
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: PiZero Ethernet pHAT

Mon Nov 30, 2015 4:50 pm

There's already an overlay in /boot/overlays for the ENC28J60.

Add

Code: Select all

dtoverlay=enc28j60,int_pin=25,speed=12000000
to /boot/config.txt
That uses CE0 on /dev/spidev0
https://github.com/raspberrypi/linux/bl ... verlay.dts
If you change things around you'll need to build a new DTS/DTB.

I like your design for an ethernet pHAT, looks good. Send me an early prototype and I'll beta test it for you.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Mon Nov 30, 2015 5:13 pm

Thanks. It will take a few days as I am still drawing the board.

The reason why I don't want to use SPI0 is that we are using it for RGB led strip control. I am using the Raspberries only for sound and light control in a theater. Naturally the PiZero sounds so fun that I would LOVE to make it capable of sound and light control also. And to keep the small kid compatible with big brothers I kind of need it to avoid SPI0.

Would it be a big job to rebuild DTS/DTB?

I probably make the default go to SPI0 and add an easy way to cut traces and add solder bridges for setting it up on SPI1. In that way it boots up correctly with no magic.

I will let you know when the protos arrive for testing.

User avatar
DougieLawson
Posts: 36156
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: PiZero Ethernet pHAT

Mon Nov 30, 2015 5:29 pm

karrika wrote: Would it be a big job to rebuild DTS/DTB?
Probably not, since we've got a good template from PhilE at the RPF and we can always ask Phil for help.

I've got a couple of ENC28J60s sitting on my bench, I've not used either one since I got a WiFi dongle for my A+. I'll wire one to my A+ tomorrow and see if I can get it running with the latest 4.1.13 kernel and that latest device tree overlay.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
adun
Posts: 102
Joined: Fri Mar 20, 2015 9:25 am
Location: Switzerland

Re: PiZero Ethernet pHAT

Mon Nov 30, 2015 9:46 pm

I just had a similar idea and found your post ;)
I also need SPI0 free and was looking to implement a ENC28J60 on SPI1.
What i found about SPI1 is:
jdb wrote:Not many. It's more limited than SPI0, though.

- The SPI1 clock is derived from the system clock therefore you have to be careful when over/underclocking to set the right divisor
- Limited IRQ support, no thresholding on the FIFO except "TX empty" or "done".
- No DMA support (no peripheral DREQ)
As mentioned there is an example for SPI0 from the Compute Module Attaching & Enabling Peripherals Guide at
https://www.raspberrypi.org/documentati ... w-guide.md (see example 2)
We could also move the GPIO12 for the falling edge interrupt to GPIO17 (SPI1 CE_1) too keep the used GPIOs together.

Let me know if you need an additional beta-tester
Regards

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:37 am

You are hired. I definitely need a beta tester to work on the SPI1 version. Thank you for the link. It really explains a lot of how the wiring should be made.

I have two pins I don't understand on the Ethernet module yet.

1 CLOCKOUT and 3 WOL. Should these be connected also?

Edit: WOL = Wake On LAN. You can wake up the PiZero through this line. CLOCKOUT = oscillator 25MHz output. I leave both unconnected.

I assume that 8 RESET can be floating as it has a pull-up on the board.

I also found out that the default settings for SPI0 is 8, 9, 10, 11 and 25 (not 12 as in the example).
For SPI1 we would use 18, 19, 20, 21 and 17.

I add a low profile SMD 10 position DIP switch. For SPI0 toggle 1,2,3,4,5 on and 6,7,8,9,10 off, For SPI1 1,2,3,4,5 off and 6,7,8,9,10 on. I put instructions on the silk screen ;)

For me these pins would be cool as it still leaves 12 (PWM0), 13 (PWM1) free for analog audio out in case I need it for my DiscoCAP.

If some more people want to have a proto drop me a line so I know how many to order. I will calculate the price later today. And if you cannot solder this project is not for you.

User avatar
DougieLawson
Posts: 36156
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 7:50 am

karrika wrote: I add a low profile SMD 10 position DIP switch. For SPI0 toggle 1,2,3,4,5 on and 6,7,8,9,10 off, For SPI1 1,2,3,4,5 off and 6,7,8,9,10 on. I put instructions on the silk screen ;)
Good idea.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 2:38 pm

After the revealing of a 3-port USB plus Ethernet for €6 with free shipping it is a bit pointless to continue with the PiZero Ethernet pHAT. I mean the shipping charge for a mini-parcel alone from Finland to UK is €6.50. And this does not include the envelope.

I have no clue of how it is even possible to create electronics for nothing and ship stuff over the planet for free. Reminds me of that fat guy. What was his name?

Aah... Santa Claus!

Merry Xmas

PS. If you feel like this would have been a nice idea for some other reasons I could make a small run of just the plain PCB's without any connectors, screws etc.

User avatar
adun
Posts: 102
Joined: Fri Mar 20, 2015 9:25 am
Location: Switzerland

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 2:47 pm

I think there could still be a need for the Ethernet pHAT as people want to keep the USB port free.
And there could be problems about USB drivers with so cheap devices.
The Eth pHAT would also fit better in a enclosure...

PS: Or we could start a new project: A HAT like expansion board for the Zero that includes an ENC28J60 with rj45 jack and analog audio out

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7304
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:16 pm

Where have you found this €6 adapter? It sounds quite useful, even if it does under cut your project as originally conceived.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:21 pm

6by9 wrote:Where have you found this €6 adapter? It sounds quite useful, even if it does under cut your project as originally conceived.
http://www.dx.com/p/micro-usb-to-3-port ... ite-407265

$6.50 (USD)
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

gregeric
Posts: 1509
Joined: Mon Nov 28, 2011 10:08 am

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:22 pm

See: viewtopic.php?f=63&t=127071&start=50#p853785

Also available on ebay for £3 - avoid the similar looking ones with full sized USB if you want to plug straight into the Zero without adapters.

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:31 pm

I have pretty much designed the board. Adding audio here is ok. I will also add it to my DiscoCAP board.

My wife took my laptop to listen on some 2 hour UK webinar. I am stuck with a Raspberry and a tablet. So no hardware designs tonight-sigh.

I really need to port KiCad to RPi (or buy a 2nd laptop).

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7304
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:33 pm

Ta. That is an impressively cheap price! It does make you wonder how they make any money at all.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:38 pm

6by9 wrote:Ta. That is an impressively cheap price! It does make you wonder how they make any money at all.
I thought exactly the same about the Pi zero :D

Laurens

User avatar
mikronauts
Posts: 2722
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:50 pm

Cheap electronics =

Buying parts on the spot / grey market in huge quantities +
Cheap labour +
spare factory capacity +
super cheap shipping

Which leads to many posts about "why can't you sell XYZ for <$MIN when I can get <widget> from Ebay for <MIN"

from people who do not understand NRE's and above.
karrika wrote:After the revealing of a 3-port USB plus Ethernet for €6 with free shipping it is a bit pointless to continue with the PiZero Ethernet pHAT. I mean the shipping charge for a mini-parcel alone from Finland to UK is €6.50. And this does not include the envelope.

I have no clue of how it is even possible to create electronics for nothing and ship stuff over the planet for free. Reminds me of that fat guy. What was his name?

Aah... Santa Claus!

Merry Xmas

PS. If you feel like this would have been a nice idea for some other reasons I could make a small run of just the plain PCB's without any connectors, screws etc.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Tue Dec 01, 2015 4:52 pm

The Raspberry Pi is such an amazing computer. I had no interest in it when it launched. And now I am suddenly creating hardware for it.

It has been a real life saver in our theater. The external GPIO pins combined with QLC+ is actually a perfect setup for computerized sound and light control. In a few days my DiscoHAT will be available for other performing groups also
<shameless plug on>
http://discohat.com
<shameless plug off>

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 6:14 am

Here is my attempt for the Ethernet pHAT. Now spiced with audio. Comments?

I decided to put in an eeprom also as nobody understands the dt blobs anyway. So perhaps the board could set up the Device Tree at boot time and be plug-and-play.

Image Image

What would be a good name for this board?

Ethernet Audio HAT based something? Or a snappy marketing name that makes everyone say "ooohhh".
Last edited by karrika on Wed Dec 02, 2015 7:32 am, edited 3 times in total.

ame
Posts: 3172
Joined: Sat Aug 18, 2012 1:21 am
Location: Korea

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 6:18 am

6by9 wrote:Ta. That is an impressively cheap price! It does make you wonder how they make any money at all.
They don't, but it stops you spending that money elsewhere.

ripat
Posts: 191
Joined: Tue Jul 31, 2012 11:51 am
Location: Belgium

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 7:30 am

karrika wrote:What would be a good name for this board?
Why not MyHATtoKarrika, you deserve it. Nice job. Looking forward to seeing the first production units.
Using Linux command line usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

User avatar
adun
Posts: 102
Joined: Fri Mar 20, 2015 9:25 am
Location: Switzerland

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 7:38 am

Very nice work :)
Can't wait to start testing it.

I would call it Audio-Lan HAT or ZeroHAT.

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 8:11 am

ZeroHAT, I like it.

It sound less evil than OneHAT.

"OneHAT to rule them all, OneHAT to find them,
OneHAT to bring them all and in the darkness bind them"

User avatar
rpdom
Posts: 15209
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 8:15 am

Should a HAT that is destined for the Zero have a different name? As the form factor is smaller, perhaps a PiCap or Raspberet?

User avatar
adun
Posts: 102
Joined: Fri Mar 20, 2015 9:25 am
Location: Switzerland

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 9:20 am

+1

"ZeroHAT to bind them all" sounds good ;)
karrika wrote:ZeroHAT, I like it.

It sound less evil than OneHAT.

"OneHAT to rule them all, OneHAT to find them,
OneHAT to bring them all and in the darkness bind them"

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: PiZero Ethernet pHAT

Wed Dec 02, 2015 9:57 am

There is a point in not calling it a HAT.

What about Miscap?

For the missing functions in PiZero.

Modded Internet Sound CAP

Return to “HATs and other add-ons”