Protocols

BlocklyProp reference for PROTOCOLS blocks

For Activity Board, FLiP, and Other board types. Not available for Badge or Scribbler Robot board types.

The PROTOCOLS blocks simplify communication between the Propeller microcontroller and other electronic devices that use a standardized method of communication.

I/O pin availability will vary with board type. Use care if accessing I/O pins connected to built-in accessory circuits on your board. Refer to your board’s product guide for I/O pin assignment details.


Serial initialize

This block launches a processor automatically, one processor per block. 

The serial initialize block sets up a serial connection. If you forget to use this block, other serial blocks will remind you with a triangle-shaped warning icon:

You may set up more than one serial connection by using a separate Serial initialize block for each.  If you set up more than one serial initialize block in a project, a drop-down menu will appear on the serial transmit and serial receive blocks to select the target serial connection’s Propeller I/O pin.

For each instance:

  • Set RX (Propeller I/O pin to receive data), and TX (Propeller I/O pin to transmit data) from the block’s drop-down fields.
  • Set the baud rate from the drop-down.  If the baud rate you need is not listed, choose Other, and type over the number shown (the menu then disappears). 
  • Set the mode; the default is Standard. If you choose Other, the block will expand to include four more checkboxes for mode configuration as shown below.


Serial transmit

The serial transmit block sends the value in the inserted block, converted to a zero-terminated text string.  Pre-format the value into one of the following forms with the drop-down menu:

  • text
  • decimal number
  • hexadecimal number
  • binary number
  • ASCII character

If using more than one serial initialize block, select the Propeller I/O pin for the target serial connection in the dropdown that will appear.

Note that the original blocks serial transmit text and serial transmit number have been deprecated. 


Serial receive

The serial receive block collects a string of characters until it receives a terminating zero.  The characters are then decoded into the type of value chosen in the drop-down menu, and that value is stored in the specified variable item.

  • text
  • decimal number
  • hexadecimal number
  • binary number
  • ASCII character

If using more than one serial initialize block, select the Propeller I/O pin for the target serial connection in the dropdown that will appear.

Note that the original blocks serial receive text and serial receive number have been deprecated.


 Serial send multiple

The Serial send multiple block is used to send attached values or text to the device connected to the specified pin.


Serial receive multiple

The Serial receive multiple block is used to receive numbers or characters from the specified pin and store them in the specified variables.


Serial status

The Serial status block returns true (1), false (0), or a character depending on the status of the serial connection and the type of status required.


shift in

The shift in block receives a value sent to the Propeller serially.  The DATA and CLK pins must be matched to the pins that are connected to the device sending the serial information.  The shift in block will receive the number of bits specified by the first drop-down menu, in the order specified by the second drop-down menu (MSB: Most significant bit first or LSB: Least significant bit first), and manner specified by the third drop-down menu: read the DATA pin before the clock, or read the DATA pin after the clock.

If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin:


shift out

The shift out block sends a value serially.  The DATA and CLK pins must be matched to the pins that are connected to the device receiving the serial information.  The shift out block will send the number of bits specified by the first drop-down menu, in the order specified by the second drop-down menu (MSB: Most significant bit first or LSB: Least significant bit first).

If you have defined a constant using the constant define block, the constant will show up in all of the pin menus and can be selected instead of a numbered pin: