OpenSprinkler Forums Hardware Questions Applying Opensprinkler to arduino

This topic contains 3 replies, has 0 voices, and was last updated by  Ray 6 years, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22346

    vladimird
    Member

    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!

    #23320

    Ray
    Keymaster

    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.

    #23321

    vladimird
    Member

    Thanks you very much for the fast answer. I will try to find it.

    #23322

    perico
    Member

    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:

    #23323

    Ray
    Keymaster

    Cool, nice to hear that it’s working. Thanks for the update.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions Applying Opensprinkler to arduino