Shop OBEX P1 Docs P2 Docs Learn Events
Conversion of "W5100_drv_011.spin" for Spinneret? — Parallax Forums

Conversion of "W5100_drv_011.spin" for Spinneret?

Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
edited 2010-11-19 16:56 in Accessories
Has anyone done a conversion of "W5100_drv_011.spin" for the Spinneret?

There are some interesting demos here which appear to be compatible.

OBC

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-11-17 18:13
    I'm guessing these are the pins in question:
      'Constants used to make the code more readable
      SPI_RD = 1
      SPI_WR = 2
      SPI_DONE = 0
    

    I don't understand the reference to SPI_DONE, and that may be holding me up.

    OBC
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2010-11-17 18:28
    SPI_DONE is likely the SPI ENABLE pin on the chip.

    I looked at the web page demo that goes with that driver and it was incredibly basic, only waiting for a connection and then outputting a fixed string of data that produces a single static page.

    A proper web page demo should handle HTTP more correctly, and serve requested files.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-11-17 18:48
    Because it's basic, it might make a good starting point..

    Examining the code a little more it appears there are some additional details to handle.
    PUB mode(opmode) | temp
    
      '' Call this function with the value wanted for opmode before
      '' the start function is called. If the start function has
      '' already been called then this function will do nothing.
    
      if (cogon == 0)               'Be sure driver not already running
        DIRA |= $70000              'Set pins 16-18 to output
        temp := opmode << 16        'Shift our arg 16 bits left
        OUTA &= $FFF8FFFF           'Clear all outputs on pins 16-18
        OUTA |= opmode              'Set only required pins on pins 16-18
     
    

    OBC
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2010-11-19 04:03
    So I made a more proper HTTP demo. I'll post the code Friday night.

    I'm serving files from the sd card, and I was even able to download a PDF file from the spinneret via a link on a page.

    Anyway it's still very basic, but it's a start.

    Now I sleep!
  • Mike GMike G Posts: 2,702
    edited 2010-11-19 06:36
    Cool Roy I did the same, request a file from the SD card. Code is still very raw. I hope to have some time this weekend to clean things up and post the source.

    I also created a simple internet service to grab the current time. Values are separated by commas.
    http://www.agaverobotics.com/spinneret/datetime.aspx?gmtoffset=-7
  • CassLanCassLan Posts: 586
    edited 2010-11-19 16:56
    @Roy - I'm eagerly awaiting your code
Sign In or Register to comment.