Shop OBEX P1 Docs P2 Docs Learn Events
Slow Down SHIFTOUT and SHIFTIN — Parallax Forums

Slow Down SHIFTOUT and SHIFTIN

ArchiverArchiver Posts: 46,084
edited 2004-05-10 00:02 in General Discussion
Hi Everyone:
I am using a BSII, but need the SHIFTOUT and SHIFTIN Commands to
function at a much slower speed than 16KBPS. Does anyone know how
to do this or possibly using a different set of commands to
duplicate SHIFTIN and SHIFTOUT and put pause commands in to slow
down the shift in and out of the Data? Reason for this: I am using
an SHT1X Temp/Humidity Sensor remotely located at the end of a 50
foot cable. The Cap and Ind of the cable is distorting the
waveforms at the high speed of 16KBPS.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-05-10 00:02
    >Hi Everyone:
    >I am using a BSII, but need the SHIFTOUT and SHIFTIN Commands to
    >function at a much slower speed than 16KBPS. Does anyone know how
    >to do this or possibly using a different set of commands to
    >duplicate SHIFTIN and SHIFTOUT and put pause commands in to slow
    >down the shift in and out of the Data? Reason for this: I am using
    >an SHT1X Temp/Humidity Sensor remotely located at the end of a 50
    >foot cable. The Cap and Ind of the cable is distorting the
    >waveforms at the high speed of 16KBPS.


    ' equivalent to SHIFTOUT sdaPin,sclk,msbfirst,[noparse][[/noparse]command]
    ' after chip select or start:
    ' but slow clocking
    FOR ix=7 TO 0 ' 7 TO 0 is msbfirst
    sdaPin = command.bit0(ix)
    PULSOUT sclk,8192 ' ~8 millisecond clock pulse
    NEXT


    ' equivalent to SHIFTIN sdaPin,sclk,msbpre,[noparse][[/noparse]result]
    ' after chip select or start:
    ' but slow clocking
    FOR ix=7 TO 0 ' 7 TO 0 is msb
    result.bit0(ix) = sdaPin ' result valid pre clock pulse
    PULSOUT sclk,8192 ' ~8 millisecond clock pulse
    NEXT

    -- Tracy




    [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.