OpenSprinkler › Forums › Hardware Questions › Applying Opensprinkler to arduino
Hi,
I like very much your project and want to use it thru standard arduino components.
I have an Arduino mega 2560 LCD, Keypad shield and ENC28j60 Network module.
I have hookd up all the thingd and got display to work by modifiyng the pins needte. My LCD forks with folowing statement LCD(8,9,4,5,6,7)
This colides with CS pin of Ethernet controler in your project.
Can you please tell me where I can modify the CS pin for Ethernet ENC28j60 to be for exaple pin 10 as I will not use RF Unit.
Thanks!
There are two places you need to change:
1. the call to ENC28J60::initialize takes csPin as a parameter, so find where that function is called and change that to your desired number.
2. inside ENC28J60::initialize function, notice there is a line where selectBit is calculated. This is hackish way to compute selectBit assuming the csPin is a PORB pin. The author of the library probably did this to speed up changing pin values, but you need to verify if this is valid with the csPin you selected. The simplest way is probably to find where selectBit appears, and just change them to use digitalWrite.
Thanks you very much for the fast answer. I will try to find it.
Hello, I just started with my mega and it looks to work.
The only thing I made was to connect this pins in mega:
50: MISO
51: MOSI
52: SCK
53: CS
here you can see the mesh:

Cool, nice to hear that it’s working. Thanks for the update.
OpenSprinkler › Forums › Hardware Questions › Applying Opensprinkler to arduino