Need help with MCP23S08


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    A couple of things ....

    Don't REV (reverse) the bit order, both the MSSP and MCP23S08 use MSB first transfers.

    And, the CS (chip select) should be taken low before each command, then made high again when the command is complete. Otherwise it thinks you're next command is consecutive bytes to the first one.
    <br>
    DT

  2. #2
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Thank you for your suggestion. I will change the code tomorrow and I will post the results.
    Had a thought i should be deselecting with each new command, but thought Microchip might have accounted for that. Also, I was reversing the bit order because I thought (incorrectly) the SSPBUF sent out the bits in reverse.
    So glad I joined this community of experts
    Nukte

  3. #3
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel
    Your suggestion worked just right, and now the LEDS's light up just as I thought (hoped) they would. So thanks ever so much for the help.
    Just one more item if you can. I actually have 4 of the 23so8 chips and 32 LED's. The 23s08's have a common chip select line, all tied to my pic output port at RA1. I have set each of the addresses for each 23s08 from 00 to 11, but all of the LED's are coming on at the same time. I tried changing the addresses in my code but that did not change the problem. What do you think I can do now?
    Thanks Nukte

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by nukte View Post
    Hi Darrel
    Your suggestion worked just right, and now the LEDS's light up just as I thought (hoped) they would. So thanks ever so much for the help.
    Great! One step down.

    For step 2, you'll just need to set the HAEN bit (bit3), in the IOCON register (address 5). Which enables the Hardware Address pins. Without it, all chips respond to address 00.

    hth,
    DT

  5. #5
    Join Date
    Nov 2007
    Posts
    11


    Did you find this post helpful? Yes | No

    Smile Thanks

    Project working .. Nuke is happy now
    Had the right code for setting HAEN but I was sending it to the wrong address.
    Thank you very much This helps me alot

  6. #6
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Thanks

    Only one thread on the 23S08. Well, maybe someone can help.

    I believe my problem is in the hardware but if someone can check the command below, that would be great. I took the attached file in the first thread and believe only the write command needed to be changed. I modified it to this but I still get nothing out of the 23S08. I'm using the PICkit serial SPI board.

    MCP_WRITE:
    low CS
    SSPBUF=0
    GOSUB CLOCK_BIT
    SSPBUF = spout
    high CS
    return

    I feel like something is missing in there. Also, to rule out the board, I was toggling one pin at a time. When I toggle the MOSI or MISO pins, the both appear to be connected because both pins go high and low at the same time. In other words, I pulse the MOSI with a 2 Hz signal and the MISO pin appears to be in parallel.

    Confused....

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Thanks

    After loading SSPBUF the second time, you need to wait for it to finish the transfer before taking CS high again.
    DT

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