LAB1X sample code not working with 25LC640.


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: LAB1X sample code not working with 25LC640.

    Aren't ports automatically set to required state by apropriate statement, when needed?
    maybe if you
    high cs or low cs

    but
    cs=0 or c=1
    I don't think so

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: LAB1X sample code not working with 25LC640.

    Quote Originally Posted by richard View Post
    maybe if you
    high cs or low cs

    but
    cs=0 or c=1
    I don't think so
    So the first program will work if this line is included

    TRISB.3 = 0 ' Set CS to output

  3. #3
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: LAB1X sample code not working with 25LC640.

    The difference is that SI and SO pins are tied together in 2nd code, via 1k resistor.

  4. #4
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: LAB1X sample code not working with 25LC640.

    Quote Originally Posted by CuriousOne View Post
    The difference is that SI and SO pins are tied together in 2nd code, via 1k resistor.
    From the first code

    ' Subroutine to write data at addr in serial EEPROM
    eewrite:
    CS = 0 ' Enable serial EEPROM
    Shiftout SI, SCK, MSBFIRST, [$06] ' Send write enable command
    CS = 1 ' Disable to execute command
    CS = 0 ' Enable
    Shiftout SI, SCK, MSBFIRST, [$02, addr.byte1, addr.byte0, B0] ' Send address and data
    CS = 1 ' Disable
    Return

    You are shifting out on the data in pin? Which is the same in the original SPIX.htm so I guess I am confused.
    Last edited by EarlyBird2; - 22nd July 2014 at 21:07.

Similar Threads

  1. BH1750FVI sample code available?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 17th May 2022, 07:38
  2. Please help with sample code on 12f675
    By critix in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th June 2013, 03:08
  3. please who can help me for sample code
    By jasem700 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd February 2009, 20:41
  4. USBJADEM sample code
    By SterlingY in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th March 2007, 00:57
  5. Sample code for pwm
    By Md.Shah in forum mel PIC BASIC
    Replies: 1
    Last Post: - 10th October 2006, 16:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts