Banana Pi + Enc28j60 (SPI Interface)

35 11934
Reply 19# tony_zhang

Tony,thanks for the clarification.
But even running as root,n3m get's the invalid argument error when exporting "25",so it seems there's some error in the fex configuration.
Can you confirm this part is ok...?
spi_dev_num = 1

modalias = "enc28j60"
max_speed_hz = 12000000
bus_num = 0
chip_select = 0
mode = 0
full_duplex = 0
manual_cs = 0
irq_gpio = 1

gpio_used = 1
gpio_num = 1
gpio_pin_1 = port:PI16<5><default><default><default>

The mux number should be 5 for PI16 EINT,isn't it?
One more thing...there already is a gpio_para in the fex file,so would adding another one like the above,create some conflict?
Can the mux_function number "5" be inserted in the original gpio_para at the correct place instead of creating a new gpio_para?

Now it is working as expected. my fex was truncated i fell back to the original gpio_para set irq_gpio = 25/24 and mode = 1 for dev interrupts and set for both the falling edge. thanks guys.
Did anybody ever try to overclock the spi clck / mclck? the encs won't get fully exploited since they support up to 100Mhz.

Reply 22# n3m

    the max spi clk up to 80M

tested. The enc28j60 supports connected to the bpi spi bus a maximum of 20MHz. Nevertheless the datasheet of enc28j60 tells you it supports up to 100MHz. Is there any workaround?

max_speed_hz = 80000000. Set it to this value

The enc is not working properly if i set the max_speed_hz above 20000000. The ifnodes will be created correctly but those will not work like before with wrong interrupts.

Reply 24# n3m

100MHz..which page in the datasheet?

My datasheet says...
Communication with the host controller is implemented via an interrupt pin and the SPI, with clock rates of up to 20 MHz.

I'm trying to get the enc28j60 working on a banana-pro. Having trouble, Did you re-compile the kernel with SPI support for the enc28j60?

I'm already using spidev and CH0 for the MCP3002 reading battery Voltage. Any Clues how to get them both working together?

So I've got the driver loading and eth1 in ifconfig, But unable to set the Gpio to 25 in /sys/class/gpio/export and cant ping the interface.

How did you set the edge and Gpio in /sys/class ?

Not every GPIO has the edge setting. Do you mean the GPIO25 is the physical pin 22 of the 40pins? So it is SPI1_CS0, yes? And I think if we export 25, we should have found the edge file under the gpio25.
What is it display when you ls?

You have to log in before you can reply Login | Sign Up

Points Rules