Which board should I use?

I need to control a device from my computer using a standard usb2.0 interface. I will need to issue commands to the device from a program I am writing in Visual Basic. The device is fully controlled by receiving any of four simple TTL-level signals (00, 01, 11, 10). The device generates TTL-level pulses (at about 360 Hz) that must be sent over the usb connection to the computer where they will be counted by the software and used for feedback and control.
Question: Which Arduino board will best accomplish this? The board will need to:
a) Provide TTL-level output to the device via usb from my computer
b) Convert the TTL-level pulses to an appropriate usb signal readable from my computer
c) And I need to control the board functions via Visual Basic.

Thanks for any advice
Dave

dfemery:
The device generates TTL-level pulses (at about 360 Hz) that must be sent over the usb connection

As written this sounds totally impractical and does not take account of how USB works. You cannot use USB for time sensitive data. You cannot send TTL signals over USB.

What you can do is send data which the receiving device can use to construct the signals that you need.

If you tell us what you are trying to achieve we may be able to give useful advice.

...R

If you interact with it via serial, that should work well. All Arduino boards (except the Pro mini, where the USB adapter is external) are able to communicate with a computer using the on-board USB serial adapter.

Visual Basic is a mickey mouse language, but I'm sure you can interface with serial ports from it. I've seen other topics with people writing VB apps to interface with arduino, so there's info around on it.

Just about any arduino board is capable of the other tasks - since you sound new to Arduino, get an Uno, since that's the most "standard" of the Arduinos. You should do any timing of the pulses on the Arduino, not the computer, and then send that information to the computer.

To ROBIN2: I have never used an Arduino board before, so that's why I'm asking how best to proceed. I understand that you can't send TTL over usb... but I assumed it was clear enough that I needed to read the occurrence of a pulse via the usb interface, and that the Arduino board would translate the TTL pulse into something that could be properly translated and read at the computer end. That's what I need to do. I seems that there are two approaches that might be possible: either read and count the pulses at the software end, or read and count them on the board and send the count (as it updates) via usb to the computer. Either way should do what I need... but which method is best?

To DrAzzy: I'll get a Uno and play with it. My software project is written in VB and it works just fine, so as long as there is a software driver/interface that will allow me program the board from either VB or C# I will be in good shape. The question I am considering is whether to use the board to count pulses, or if it makes more sense to send pulses to the program and count them there.

I appreciate both responses I have seen so far... thanks!

Dave.

If the timing is critical, I'd do it on the Arduino. But you can defer that decision until you have the hardware in hand and can start getting some practice working with Arduino.

Timing is not critical... the pulse is simply the output of a led sensor that reads the rotation of a motor shaft. The pulse rate is approximately 360Hz, which (I assume) is slow enough to be read easily via a usb2.0 line. Moreover, the occasional lost pulse would be inconsequential for this application.

dfemery:
but I assumed it was clear enough that I needed to read the occurrence of a pulse via the usb interface, and that the Arduino board would translate the TTL pulse into something that could be properly translated and read at the computer end.

Sorry, but it is still not clear to me.

It would be easy to write an Arduino program that would detect a pulse and send a message to your PC using (for example Serial.println("pulse just detected"); and maybe that is all you want.

But that process CANNOT be used to send messages in such a way that the time intervals between messages received on the PC are the exact same as the intervals between the pulses. That is because of latency in the USB system. USB can send large quantities of data at high speed. But it cannot send small quantities of data at high speed. If you are old enough to know what the PC parallel port was you will know that it could send individual bytes in real time. USB can't do that - as I found to my own cost when I tried to resurrect a project I had originally built for the parallel port.

At the moment you are trying to explain to us how you think something might be implemented. If you tell us what that something is we will be much better able to help. For example are you trying to control a coffee-maker or the door of a chicken-coop ?

...R

In simple terms, I need to count motor shaft revolutions and shut the motor off after so many revolutions. This is not a stepper or servo motor. The motor control circuit exists and control is provided through a digital TTL interface where line A turns the motor on or off, and line B determines the rotational direction: 00 and 01 shut the motor off; 10 activates the motor in a cw direction; and 11 activates the motor in a ccw direction. There is a shaft encoder that produces 6 pulses per revolution and the motor spins at approximately 3600 rpm... hence the 360Hz pulse rate I mentioned.

I do not need a time-critical, real-time, single-pulse response which is not possible to achieve in any event.

So back to my question... what is the best way to count the pulses and send the commands?

It has occurred to me that I might be better off if I perform the entire operation on the Uno board; that way, I can simply send the required count (the number of pulses I need) and the direction (10 or 11) to the board; let the board execute the rotation, count, and then shut the motor off after the count has been reached. That way, I am merely sending numbers to the Uno with no concern about transmitting pulses while the board is executing.

Does this make sense?

dfemery:
It has occurred to me that I might be better off if I perform the entire operation on the Uno board; that way, I can simply send the required count (the number of pulses I need) and the direction (10 or 11) to the board; let the board execute the rotation, count, and then shut the motor off after the count has been reached. That way, I am merely sending numbers to the Uno with no concern about transmitting pulses while the board is executing.

Does this make sense?

This actually makes more sense than the approach originally described. Arduino (microcontrollers in general) excel at things like "time-critical, real-time, single-pulse responses" which are not possible to achieve in general purpose computers that use things like USB buffers and preemptive multitasking at the expense of real time operation.

(Edit) Your scenario then would be something like 1) host computer sends command string via USB serial port to Arduino, 2) Arduino interprets command string, starts motor running in specified direction, stops after specified number of pulse counts, 3) Arduino sends "mission accomplished" message back to host, repeat as necessary.

Thanks, MrMark... This seems like a workable approach and now I'll see if I can implement it in practice!

Dave.

I agree with what @MrMark has said.

I had not understood your requirement prior to Reply #8

You may find the examples in serial input basics useful for receiving data in your Arduino.

I no longer know Visual Basic but the general principles in the Python - Arduino demo apply in any language.

...R

Perfect! Thanks!