USB control of ARC-32 with outside program

Has anybody done IO through the ARC-32’s USB port to a PC without using the IDE? I am able to send/recieve through the Basic Micro Studio’s Terminal, but I can’t get anything to work using the windows hyperterminal or Matlab.

I know there are problems with doing this oustide the IDE throught the DB9 connector on the Bot Board II with the BAP because of the reset lines. Is this still the case with the ARC-32’s USB?

The reason I ask is that I’m building a research project where I’m controlling servos on a stationary device and I want to send commands to the ARC-32 from programs like MatLab and LabView. Guess I should have just gotten the SSC-32 since it’s pretty much meant for this sort of communication control, but I thought I’d have no problem with the ARC-32 and have a lot of added functionality.

My porting of the Phoenix code to the Arc32, does setup sort-of a debug monitor on the USB port. I have been been able to talk to it without any problems using a VB application.

But again there is a huge difference between using the SSC-32 and the Arc-32. That is the SSC-32 has code in to handle servo commands that are passed to it through the serial port, where as the Arc-32 is general purpose processor board that can do this, but you have to write a program on it to make it do anything.

While I was playing with porting the code, I toyed with the idea writing an SSC-32 emulator for it, but the only part I did was to write enough code for it to emulate enough of the GP sequencer, that I could download sequences and run them…

Good Luck
Kurt

Thanks for the response Kurte! I have the ARC32 set up and running but haven’t been able to communicate with it outside of the IDE. I have a lot of PC based automation planned for the USB port. Could I take a look at your VB code? I’m not new to programming, but I’m very new to writing any kind of USB communication.

Thanks again,
Curt

Hi Curt,

I have a few things up on the forum right now. I have one thread talking about porting the phoenix code to the arc32. In this I developed a program that allows me to download sequences to the arc32 (Bap28) as well. All of this code is up at:
viewtopic.php?f=8&t=6042&start=35

Note: the phoenix code has been updated since then as part of my fun of updating the DIY XBee code to use the Xbees in Packet mode. This code also has a VB app, that talks through the XBees, so may not be as much interest. The latest code for all of this was uploaded yesterday. It is in the thread: viewtopic.php?f=21&t=5447&p=64741#p64741

Probably the most interesting stuff is in the phoenix arc32 code file: phoenix_arc32_extras.bas. Note: my program uses the hardware serial port to talk USB… HSERIN/HSEROUT. I am using a hack to know if I have any input waiting for me as well.

Good Luck
Kurt

Hey, kurt, another trick to see if you have data waiting in the hserial buffer is to send a 0 timeout to the hserin command. If there is no data it will immediately jump to the label specified.

So you can do somethign like this:

hserin 0,nodata,[data] gosub gotdata nodata:

Thanks Nathan,

Obviously in most cases you would then want to do something with the data variable you read in.

Kurt

I hope you are talking about communicating via a virtual serial port established by your board connecting via the USB port. USB communications themselves are very involved.

Ya, Zoomkat, I’m pretty sure thats what he means. He’s talking about using the USB port on the ARC-32 which is a virtual comport. At least thats what I got form his posts. :slight_smile:

Hi everybody, thanks so much for the comments & help!

Yes, I should have been more clear, I plan on using straight serial commands and just taking advantage of the USB port as a physical connection.

I’m going to try this today, I may have been mixing code up between the BAP and the ARC 32 (I am using both right now). I was using “serin” on the BAP and could only get it to work through the IDE terminal.

I’ll try “hserin” on the ARC-32 and see if I can get anything.

I’ll post up soon - and some pictures of this contraption :slight_smile:

Hi everyone, I’m new on this forum, My name is Daniel From México City. I just bought my ARC32 and want to use it via serial port sending some information from Labview something similar as cboirum said. I tried a lot of times with no reading from my serial port. Anyone could help me finding the specs of the serial communication of the board so I can tune my Labview progam? I appreciate your time and help.

Daniel

Have you looked at the datasheet for the Arc32? downloads.basicmicro.com/downloa … _B0010.pdf
Lot easier than BAP28 as S_IN/S_OUT are on UART 0.

So you need to initialze the hardware serial port at a minimum with the baud rate…
like: sethserial1 H38400

You can then use hserin 1, [data]
To read in data. Note the hardware serial port uses hardware support and interrupts and buffers up data. You can set time outs on how long you will wait for a character, there are also commands to peek ahead in the queue…

Kurt