Page 1 of 4

Miscap - PiZero Ethernet pHAT

Posted: Mon Nov 30, 2015 4:33 pm
by karrika
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

Re: PiZero Ethernet pHAT

Posted: Mon Nov 30, 2015 4:50 pm
by DougieLawson
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.

Re: PiZero Ethernet pHAT

Posted: Mon Nov 30, 2015 5:13 pm
by karrika
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.

Re: PiZero Ethernet pHAT

Posted: Mon Nov 30, 2015 5:29 pm
by DougieLawson
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.

Re: PiZero Ethernet pHAT

Posted: Mon Nov 30, 2015 9:46 pm
by adun
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

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:37 am
by karrika
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.

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 7:50 am
by DougieLawson
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.

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 2:38 pm
by karrika
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.

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 2:47 pm
by adun
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

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:16 pm
by 6by9
Where have you found this €6 adapter? It sounds quite useful, even if it does under cut your project as originally conceived.

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:21 pm
by Joe Schmoe
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)

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:22 pm
by gregeric
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.

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:31 pm
by karrika
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).

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:33 pm
by 6by9
Ta. That is an impressively cheap price! It does make you wonder how they make any money at all.

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:38 pm
by Laurens-wuyts
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

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:50 pm
by mikronauts
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.

Re: PiZero Ethernet pHAT

Posted: Tue Dec 01, 2015 4:52 pm
by karrika
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>

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 6:14 am
by karrika
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".

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 6:18 am
by ame
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.

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 7:30 am
by ripat
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.

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 7:38 am
by adun
Very nice work :)
Can't wait to start testing it.

I would call it Audio-Lan HAT or ZeroHAT.

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 8:11 am
by karrika
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"

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 8:15 am
by rpdom
Should a HAT that is destined for the Zero have a different name? As the form factor is smaller, perhaps a PiCap or Raspberet?

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 9:20 am
by adun
+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"

Re: PiZero Ethernet pHAT

Posted: Wed Dec 02, 2015 9:57 am
by karrika
There is a point in not calling it a HAT.

What about Miscap?

For the missing functions in PiZero.

Modded Internet Sound CAP