How to Correctly define Shiftout bits


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jul 2010
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: How to Correctly define Shiftout bits

    I'm shifting out 24 bits. The device I writing to is a I/O portexpander MCP23S17 from microchip. I've tried the other methods and the portexpander does not respond to them. The only way to get it to recognize any commands, was to send them out like this.

    WR_OPCODE_BYTE con $40
    INTCONA con $04

    Shiftout SDO,SCK,Msbfirst,[WR_OPCODE_BYTE,IOCONA,$A0\24]

    I don't know what the problem is with this. I know now it is incorrect but it works. The other ways do not.

    There are two programs I wrote using the portexpander in PicBasic Pro. The first one only works as stated above. The other one works correctly if I use
    Shiftout SDO,SCK,Msbfirst,[WR_OPCODE_BYTE,IOCONA,$A0]. Both use pretty much exactly the same code as it was copied and pasted from the first program into the second one. I can't put all the code on here as it was over 3000 lines of code.

    Thanks,
    Bryan

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: How to Correctly define Shiftout bits

    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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