FLiP Blockly USB and Serial

I am using FLiP and Blockly and want to interface to a weighing balance. I could use the Serial Protocols in Blockly and wire up pins on the FLiP to a serial cable. However, I wonder why I can't use the USB port on the FLiP which is normally connected to the PC for programming (and use a USB port on the balance or a USB-Serial converter)? Surely this is possible. It would be nice to have Blockly blocks that enabled this?

Comments

  • In that instance you need a USB chip that can be a master, not a slave. There is a correct name but cannot recall that atm.
  • This is extremely frustrating: I can't even find anywhere, how to connect a RS232 serial device to the FLiP and use Blockly Prop that makes sense to me. There is something in Blockly called Communicate Protocols but it does not work for me: I assume because is appears not use RxD and TxD wiring... but where is the wiring diagram or instructions that this block belongs to?
    1588 x 1065 - 239K
  • It really depends on your Device. Look at the Datasheet or measure the voltages.

    RS232 is for decades a slightly mess.

    The original one (on PCs) did Voltage swings from +12 to - 12 volts. To use those devices you will need something like a MAX232 chip to translate the levels down to +3.3volt and 0 volts.

    Later on a lot of devices where made with RS232 at TTL level (+5 Volts to 0 volts). Most of those Devices can accept +3.3 Volts as input (propeller TX to Device RX direct connected) and you need one simple Resistor ~4 k ohms to 10 k ohms between Device TX and Propeller RX to get the voltage down from 5 to 3.3 volts to protect your propeller pin.

    Some newer devices use RS232 with +3.3 volts to 0 volts. Those you can connect directly to the propeller pins.

    And then there is RS232 mingled with USB. That is another mess since you need to decide witch one is the HOST or the CLIENT.

    Usually the PC is the HOST and the device (or micro controller) is the CLIENT. There you need some USB to serial adapter (like the PropPlug or the USB on the FLIP).

    And finally there are devices (like USB sticks or so) who want to connect to the micro controller as a CLIENT and the MC acting as a HOST. That is what the great @Cluso99 mentioned.
    There you need something like the FTDI Vinculum.

    If your scale just provides a USB port that might be your only solution but is quite expensive. So look if the scale offers serial over some pins and not try to use the USB port if possible.

    The Propeller has no dedicated UART hardware, you can use any pins you want. Usually (as on the FLIP) pins 30/31 are used for serial over USB and 28/29 are used for the EEPROM.

    All other pins are free to grab.

    Enjoy!

    Mike
  • Whats the balance make and model? Many of them just output the weight using ascii characters when you take the reading by pressing the button on the balance.

    Do you know what baudrate RS232 its putting out? 9600?

    In an industrial environment you're going to want a MAX3232 or similar Chip as Mike says. But for testing on a desktop, if the baudrate is slow (9600) you might even get away with a single resistor to drop the voltage into a prop pin so you can take readings and gain some confidence.
  • Thank you. I am progressing but finding limitations.For example if I want to use Xon/Xoff flow control, Blockly does notoffer the charchters to send...
Sign In or Register to comment.