Serial communication, FLip and BlocklyProp
Automaxion
Posts: 26
I am frustrated. I wanted to use a FLiP connected to a weighing balance, hoping to use USB (and an RS232 to USB converter). Apparently, that is not feasible.
I then thought I could directly use RS232 since that is what the balance uses. In Blockly under Communicate Protocols there are serial blocks but I cannot determine how to physically wire the FliP to the RS232 so that I can do anything with these. Attached is the Serial Initialize block description but I don't see how that relates to wiring CD, RxD, TxD, DTR, DSR, RTS, CTS RI which are standard cable connections for RS232 (I know some of these are not always needed)
Can anyone help?
I then thought I could directly use RS232 since that is what the balance uses. In Blockly under Communicate Protocols there are serial blocks but I cannot determine how to physically wire the FliP to the RS232 so that I can do anything with these. Attached is the Serial Initialize block description but I don't see how that relates to wiring CD, RxD, TxD, DTR, DSR, RTS, CTS RI which are standard cable connections for RS232 (I know some of these are not always needed)
Can anyone help?
Comments
I'm unclear here - do you want the FLiP project to finally look like standard RS232 to some host, or does the weighing balance use RS232 ?
It may be simplest to first define what pins the weighing balance actually needs to operate ?
I used an appropriate RS232 chip to translate the voltage levels. Apparently there are ways to keep the Propeller safe without the special chip but I wanted to play it safe.
Often the RTS and CTS lines are only needed if you want to push the communication speeds up to near the limit of the device.
Edit: I just reread your post. What do you mean by this: Does the balance have a USB port or a RS232 port?
Edit again: I don't see any reason to involve USB is the balance has a RS232 port. The Propeller can not easily be a USB host device.
Now, if you just use a series resistor to connect to RS232 you will need to set mode to invert.
So, what is the scale you intend to use (provide a link)? From this we can see what RS232 pins are required - it may just be Rx and Gnd. Also we can see what RS232 voltage it is using, and then recommend resistors to protect the prop without using an RS232 chip. Otherwise use the Sparkfun board that Duane linked to.
This is from those balance instructions ( _ represents a space character):
Command SI Send the current net weight value, irrespective of balance stability.
Response S_S_WeightValue_Unit (Stable weight value in unit actually set under unit 1)
S_D_WeightValue_Unit (Nonstable (dynamic) weight value in unit actually set under unit 1)
S_I (Command not executable (balance is currently executing another command, e.g. taring))
S_+ (Balance in overload range)
S_- (Balance in underload range)
An example of what I should get is S D 0.0021 g, but all I get is S or 0.0021
I plan to continue trying things out but any tips and pointers would be helpful.
So how do I find out (and increase) the buffer size in Blockly?
I'm chemist as well. I started using microcontrollers to make it easier to record data. I soon found microcontrollers were more fun than chemistry and now I do more microcontroller work (designing PCBs and programming) than I do chemistry work.
Add the ability to record balance data was a huge help when I worked as a chemist. An even bigger help was putting barcodes and all the containers. When samples were transferred, the original container and the new container where both scanned. This was all recorded to a csv file which made record keeping much easier and much more accurate.
Here's the thread discussing the barcode scanner.
I don't know the answer to this myself. I don't use Blockly much.
Blockly can work much better if you take advantage of the Propeller's multiple cogs.
How many "new processor" blocks do you have in your program? If the answer is zero, you're doing it wrong.
If you post your code, someone here might be able to help optimize it.
With help from MatzElectronics, the attached works well for getting data from a Sartorius balance. Maybe others will find it useful.