BASIC Stamp Code coversion project
lamarjordan
Posts: 1
I've got the BS2px chip.
I need to Take in HEX data outputted by a control joystick.
I then need to take that HEX data and translate it, maybe through a table.
E.G.
Input (RS-232, 9600 8N1) 'pan left at normal speed Pelco P
A0 00 00 04 20 00 AF
Needs to then be output as
(RS-232, 900 8N1) 'pan left at normal speed SONY VISCA
81 01 06 01 05 03 02 FF
Am I even using the right hardware to get this done?
I need to Take in HEX data outputted by a control joystick.
I then need to take that HEX data and translate it, maybe through a table.
E.G.
Input (RS-232, 9600 8N1) 'pan left at normal speed Pelco P
A0 00 00 04 20 00 AF
Needs to then be output as
(RS-232, 900 8N1) 'pan left at normal speed SONY VISCA
81 01 06 01 05 03 02 FF
Am I even using the right hardware to get this done?
Comments
One issue is that all Stamps are "single threaded" processors. When they're doing one thing (like sending RS232 serial data), they can't do anything else at exactly the same time (like receive new position information). For many applications, this isn't a problem and different actions can be interleaved. In your case, you might miss some joystick information. There are some 3rd party serial buffers that you can add that will eliminate this issue (like from Protean Logic: www.proteanlogic.com/product_periph_rs232.shtml).
This should be a very interestring table. I see no relationship between the input data and the output data, particularly since the output data is one byte longer than the input data. What does the data translation table look like?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
will get this job done. The buffer is 11 bytes, which should be big enough to hold one complete "message".
The problem with the BS2 is that it is a single-tasking processor -- so while it's sending the data, it can't also recieve the data. Now, this co-processor WILL recieve the data -- but you'll still have to 'read' it with the BS2 at some point, then 'send' it from the BS2 on.
The co-processor only needs one resistor to be able to recieve RS-232 signal levels, which cuts down on the number of components you need to use.