FLiP Blockly USB and Serial
Automaxion
Posts: 26
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
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
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.