Shiftout command


Results 1 to 5 of 5

Threaded View

  1. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Shiftout command

    Hi,
    SHIFTOUT/SHIFTIN are used for synchronous communications (unlike SEROUT/SERIN etc which are asyncrounous) which means that there one dataline and one clock line (and quite often a chip select). If you SHIFTOUT a byte variable there will be 8 pulses on the pin you specify as ClockPin. During each pulse the 8 indivdual bits of your byte variable will be present as a voltage on the DataPin. Depending on the MODE you specify with the SHIFTOUT command you can change the exact behaviour of the output ie. in which order the bits are shifted out and the "polarity" of the clock.

    Please do scope it and you'll see how it works.

    EDIT: Oh, the constant thing. That's just to be compatible with the BasicStamp2 syntax where the I/O's are labeled 0-15. Usually '0' is PortB.0 but it might differ depending on the actual PIC you're compiling for. Best is to just forget about that and use PortB.3 etc.
    Last edited by HenrikOlsson; - 16th January 2012 at 17:50.

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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