Shiftout help
SeanRo
Posts: 2
Hi,
Im new to programming with the propeller.· Ive previously used the basic stamp to write a program and now im trying to switch it over to the propeller.· Im having a hard time figuring out how to output a 24 bit serial command word on a single pin.· The code i previously used on the basic stamp is listed below.
shiftout P14, P13, 0, [noparse][[/noparse]%000000001010001000000000\24]
This is from the Basic Stamp manual:
SHIFTIN Dpin, Cpin, Mode, [noparse][[/noparse] Variable { \Bits } {, Variable { \Bits }…} ]
Function
Shift data in from a synchronous serial device.
• Dpin is a variable/constant/expression (0 – 15) that specifies the I/O
pin that will be connected to the synchronous serial device’s data
output. This pin will be set to input mode.
• Cpin is a variable/constant/expression (0 – 15) that specifies the I/O
pin that will be connected to the synchronous serial device’s clock
input. This pin will be set to output mode.
• Mode is a variable/constant/expression (0 – 3), or one of four
predefined symbols, that tells SHIFTIN the order in which data bits
are to be arranged and the relationship of clock pulses to valid data.
See Table 5.115 for value and symbol definitions.
• Variable is a variable in which incoming data bits will be stored.
• Bits is an optional variable/constant/expression (1 – 16) specifying
how many bits are to be input by SHIFTIN. If no Bits argument is
given, SHIFTIN defaults to 8 bits.
How would·i do something like this on the propeller?
Thanks
Im new to programming with the propeller.· Ive previously used the basic stamp to write a program and now im trying to switch it over to the propeller.· Im having a hard time figuring out how to output a 24 bit serial command word on a single pin.· The code i previously used on the basic stamp is listed below.
shiftout P14, P13, 0, [noparse][[/noparse]%000000001010001000000000\24]
This is from the Basic Stamp manual:
SHIFTIN Dpin, Cpin, Mode, [noparse][[/noparse] Variable { \Bits } {, Variable { \Bits }…} ]
Function
Shift data in from a synchronous serial device.
• Dpin is a variable/constant/expression (0 – 15) that specifies the I/O
pin that will be connected to the synchronous serial device’s data
output. This pin will be set to input mode.
• Cpin is a variable/constant/expression (0 – 15) that specifies the I/O
pin that will be connected to the synchronous serial device’s clock
input. This pin will be set to output mode.
• Mode is a variable/constant/expression (0 – 3), or one of four
predefined symbols, that tells SHIFTIN the order in which data bits
are to be arranged and the relationship of clock pulses to valid data.
See Table 5.115 for value and symbol definitions.
• Variable is a variable in which incoming data bits will be stored.
• Bits is an optional variable/constant/expression (1 – 16) specifying
how many bits are to be input by SHIFTIN. If no Bits argument is
given, SHIFTIN defaults to 8 bits.
How would·i do something like this on the propeller?
Thanks
Comments
There are comments just before each routine that explain and demonstrate how to use it.