Show Posts
Pages: 1 ... 31 32 [33] 34 35 ... 39
481  Using Arduino / Networking, Protocols, and Devices / Re: Teensy++2.0 with Circuits@Home USB Host Mini on: June 25, 2011, 02:08:04 am
It arrived this afternoon, only minutes after I posted that last message.   smiley-wink

I've been studying the 2.0 code this afternoon.  So far, I've added pin definitions at the end of avrpins.h and more cpu types to usbhost.h at line 47.  The hardware abstraction layer and its usage looks very good (if only the Arduino core were designed this well...) so I'm feeling pretty good.  So far, I've not touched line 38 in Usb.h, so I'll just use pins 10 and 9 for consistency.

How to connect the USB host power is a bit of a mystery so far.  I'm looking at the eagle file.  It has "Aug.21,2010" in the silk screen, but the board I received has "Oct.12,2010" printed.  The changes appear to be 3 configuration jumpers, which are a nice feature, and the extra pads nearby.

As wired, at least as nearly as I can tell using my ohm-meter, the USB host power is connected to the +3 volt power.  For use with a Teensy converted to 3 volts, but powered from a USB cable supplying 5 volts, I think the best option would be the cut the host power jumper and solder a wire from the 5 volt pad on the bottom of the Teensy board to the host power pad that becomes isolated if that jumper is cut.  Maybe?  Of course, this isn't really nice for mounting either board in a DIP socket.  The 5V power power pad is on the bottom side of Teensy, and the host power pad on the USB Mini Host Shield is so close the USB host connector shell that I'm not sure I can solder a wire in place without shorting the power.

I suppose I'll try it first with 3 volts to the USB host power.  Do many USB devices work with only 3.3 volts?

Will post again once I've actually got it hooked up....

I didn't see the board test example in version 2.0.  Did I miss it, or is it available somewhere for 2.0?
482  Using Arduino / Networking, Protocols, and Devices / Re: Teensy++2.0 with Circuits@Home USB Host Mini on: June 24, 2011, 01:37:54 pm
I'm planning to look at this when my hardware arrives.  It hasn't yet...
483  Using Arduino / Networking, Protocols, and Devices / Re: Teensy++2.0 with Circuits@Home USB Host Mini on: June 21, 2011, 02:14:49 pm
I'm not sure why it's not working.  Everything you wrote appears correct, at least on initial reading and without digging into the code.

I ordered one of those boards just now.  When it arrives, I'll hook it up and figure out how to get it working.

SPI ought to work fine with ordinary wires of reasonable length (eg, under a few inches or 10 cm).  Without digging into the code (and making some assumptions without working hardware on my bench) I can't verify what the specific DC voltages ought to be... as that depends on the specific SPI configuration used, and maybe other details.

There's not a lot more I can do until the board arrives, other than let you know I definitely did purchase one and when it gets here I'll investigate.
484  Using Arduino / Installation & Troubleshooting / Re: Arduino Uno & Mac no serial port on: June 19, 2011, 03:20:20 pm
Perhaps you had Parallels or Vmware running at the time you tried to use it from OS-X ?

Somehow (and I wish I knew how), the virtual machines are able to completely take control of newly attached USB devices, so that they are accessible to the guest OS and do not appear to programs running on the host OS.

If that happened, it would explain why OS-X could not see the device.  Perhaps after you got it working with Windows, your second attempt with OS-X was different because you'd shut down the virtual machine?
485  Using Arduino / Interfacing w/ Software on the Computer / Re: Reduce Serial Latency on: May 03, 2011, 04:48:07 pm
Arduino Uno on Linux, Ubuntu 10.10, 32 bit:

port /dev/ttyACM0 opened
waiting for board to be ready:
..ok
latency @ 1 bytes: 5.23 ms average, 10.04 maximum
latency @ 2 bytes: 5.16 ms average, 10.99 maximum
latency @ 12 bytes: 6.69 ms average, 13.23 maximum
latency @ 30 bytes: 8.68 ms average, 16.00 maximum
latency @ 62 bytes: 10.47 ms average, 14.56 maximum
latency @ 71 bytes: 11.69 ms average, 16.00 maximum
latency @ 128 bytes: 16.30 ms average, 20.50 maximum
latency @ 500 bytes: 48.28 ms average, 53.00 maximum
latency @ 1000 bytes: 90.53 ms average, 96.00 maximum
latency @ 2000 bytes: 175.15 ms average, 180.00 maximum
latency @ 4000 bytes: 344.12 ms average, 348.49 maximum
latency @ 8000 bytes: 686.79 ms average, 692.50 maximum



Teensy 2.0 on Linux, Ubuntu 10.10, 32 bit:

port /dev/ttyACM0 opened
waiting for board to be ready:
.ok
latency @ 1 bytes: 4.28 ms average, 8.00 maximum
latency @ 2 bytes: 4.02 ms average, 7.99 maximum
latency @ 12 bytes: 4.39 ms average, 8.01 maximum
latency @ 30 bytes: 4.55 ms average, 8.01 maximum
latency @ 62 bytes: 4.16 ms average, 8.00 maximum
latency @ 71 bytes: 4.71 ms average, 8.50 maximum
latency @ 128 bytes: 4.72 ms average, 8.01 maximum
latency @ 500 bytes: 7.41 ms average, 12.01 maximum
latency @ 1000 bytes: 9.07 ms average, 14.12 maximum
latency @ 2000 bytes: 16.20 ms average, 20.00 maximum
latency @ 4000 bytes: 27.68 ms average, 33.00 maximum
latency @ 8000 bytes: 49.24 ms average, 52.50 maximum
486  Using Arduino / Interfacing w/ Software on the Computer / Re: Reduce Serial Latency on: May 03, 2011, 04:42:20 pm
Teensy 2.0 on Windows 7 Home Premium, system idle:

port COM3: opened
waiting for board to be ready:
.ok
latency @ 1 bytes: 0.94 ms average, 15.60 maximum
latency @ 2 bytes: 0.94 ms average, 15.60 maximum
latency @ 12 bytes: 1.09 ms average, 15.60 maximum
latency @ 30 bytes: 0.94 ms average, 15.60 maximum
latency @ 62 bytes: 1.09 ms average, 15.60 maximum
latency @ 71 bytes: 0.94 ms average, 15.60 maximum
latency @ 128 bytes: 1.56 ms average, 15.60 maximum
latency @ 500 bytes: 3.90 ms average, 15.60 maximum
latency @ 1000 bytes: 6.55 ms average, 15.60 maximum
latency @ 2000 bytes: 12.01 ms average, 15.60 maximum
latency @ 4000 bytes: 24.18 ms average, 46.80 maximum
latency @ 8000 bytes: 46.96 ms average, 62.40 maximum


Arduino Uno on Windows 7 Home Premium, system idle:

port COM4: opened
waiting for board to be ready:
..ok
latency @ 1 bytes: 4.06 ms average, 15.60 maximum
latency @ 2 bytes: 4.06 ms average, 15.60 maximum
latency @ 12 bytes: 4.21 ms average, 15.60 maximum
latency @ 30 bytes: 4.37 ms average, 15.60 maximum
latency @ 62 bytes: 8.27 ms average, 15.60 maximum
latency @ 71 bytes: 8.11 ms average, 15.60 maximum
latency @ 128 bytes: 14.04 ms average, 46.80 maximum
latency @ 500 bytes: 45.08 ms average, 46.80 maximum
latency @ 1000 bytes: 87.52 ms average, 93.60 maximum
latency @ 2000 bytes: 172.07 ms average, 187.20 maximum
latency @ 4000 bytes: 343.98 ms average, 358.80 maximum
latency @ 8000 bytes: 683.90 ms average, 686.40 maximum

487  Using Arduino / Interfacing w/ Software on the Computer / Re: Reduce Serial Latency on: May 03, 2011, 04:14:11 pm
Arduino Uno on Windows XP, system idle:

port com5 opened
waiting for board to be ready:
..ok
latency @ 1 bytes: 4.06 ms average, 15.63 maximum
latency @ 2 bytes: 4.22 ms average, 15.63 maximum
latency @ 12 bytes: 4.22 ms average, 15.63 maximum
latency @ 30 bytes: 4.53 ms average, 15.63 maximum
latency @ 62 bytes: 8.13 ms average, 15.63 maximum
latency @ 71 bytes: 8.28 ms average, 15.63 maximum
latency @ 128 bytes: 13.13 ms average, 15.63 maximum
latency @ 500 bytes: 45.00 ms average, 46.88 maximum
latency @ 1000 bytes: 87.34 ms average, 93.75 maximum
latency @ 2000 bytes: 172.19 ms average, 187.50 maximum
latency @ 4000 bytes: 344.06 ms average, 359.38 maximum
latency @ 8000 bytes: 684.06 ms average, 687.50 maximum



Teensy 2.0 on Windows XP, system idle:

port com4 opened
waiting for board to be ready:
.ok
latency @ 1 bytes: 0.94 ms average, 15.63 maximum
latency @ 2 bytes: 1.09 ms average, 15.63 maximum
latency @ 12 bytes: 1.09 ms average, 15.63 maximum
latency @ 30 bytes: 0.94 ms average, 15.63 maximum
latency @ 62 bytes: 1.09 ms average, 15.63 maximum
latency @ 71 bytes: 0.94 ms average, 15.63 maximum
latency @ 128 bytes: 1.25 ms average, 15.63 maximum
latency @ 500 bytes: 3.91 ms average, 15.63 maximum
latency @ 1000 bytes: 6.56 ms average, 15.63 maximum
latency @ 2000 bytes: 12.19 ms average, 15.63 maximum
latency @ 4000 bytes: 23.91 ms average, 31.25 maximum
latency @ 8000 bytes: 47.19 ms average, 62.50 maximum
488  Using Arduino / Interfacing w/ Software on the Computer / Re: Reduce Serial Latency on: May 03, 2011, 04:07:48 pm
I ported the code to Windows (so it works on Mac, Linux and Windows).  Here it is:

http://www.pjrc.com/teensy/beta/latency_test.zip

To run the test, just program the latency_test.pde sketch onto your Arduino, Teensy or other Arduino compatible board.

The in a terminal or command prompt window, run the latency_test program.  I included a pre-built copy for Windows.  To compile, edit the Makefile and make sure your platform is selected, then compile with "make".

I'll post some results in a few minutes....


489  Using Arduino / Interfacing w/ Software on the Computer / Re: Reduce Serial Latency on: May 03, 2011, 11:39:46 am
It would be much better to run the benchmark and post actual latency measurements, rather than toss around wild speculation based on intuition or guesswork.  Even if you don't have all 3 types of boards, running it on at least 1 board would be FAR better than zero.

You could even run the benchmark on an otherwise idle system, and with various other programs running.  The code measures average and worst case latency.  If you really wanted to make a point about multitasking, it'd be possible to modify the code to print each test run and put the results into a histogram or something.

Of course, the "native" code is written with Mac OS-X.  Maybe someone could port it to WIN32?  Maybe I'll do it... I did write the OS-X version afterall.

Does the java benchmark work on Windows?  I didn't see the java code in the zip file.  Did I just miss it?
490  Using Arduino / Programming Questions / Re: How to tell if pin is on when using analogWrite? on: April 30, 2011, 07:07:47 pm
Is there no way to read the state?

There is indeed, but you'll have to go to the not-as-easy-to-use hardware registers.

In fact, there are 2 ways to read the state.  You can read what was written from the PORTx register, or you can read the actual voltage from the pin with the PINx register.  Normally these would be the same... but if you short the pin directly to ground and write it high (which is very stressful on the pin and might even damage it) reading the PORTx register would give you a 1, but the PINx register would give you 0 or 1 depending on the actual voltage at the pin.

If that sounds easy, well, first the "x" in PORTx is actually a letter, probably B, C or D.  You'll need to look up with actual AVR pin it used.  For example, if it's PD3, then you would read PIND.  Reading that register also gives you all 8 "D" pins (or if the chip doesn't have all 8, the unused bits could be random).  You'll have to use a logical AND to remove the other 7 bits you don't want.

The digitalRead function does all this for you, and if the pin is not a PWM capable pin, it should be able to read it (maybe).  But if the pin has PWM, even if it's not currently in use, digitalRead won't work.

491  Using Arduino / Audio / Re: MIDI plus USB serial on: April 06, 2011, 07:26:50 am
You could also use Teensy, at $16, which uses native USB for very fast Serial.print(), and completely separate serial port you can use for MIDI.

It also has USB MIDI, and can do Serial.print() to the serial montitor window while sending MIDI at USB speed (in that mode it acts as a USB multifunction device for 2 communication channels on a single USB), and those are both separate from the serial port, so you can simultaneously send/receive MIDI there there too.  But there is only 1 serial port capable of 31250 baud MIDI, so if you want 2 actual serial ports, Arduino Mega and Sanguino are the only choices.

For full disclosure, I am involved with PJRC and Teensy.
492  Using Arduino / Audio / Re: MIDI plus USB serial on: March 22, 2011, 07:25:25 pm
I recently added USB MIDI to Teensyduino.  It requires a AVR chip with native USB, like the one on Teensy.  Regular Arduino doesn't have this, unless you try using the 8u2 chip on Uno (which probably doesn't have enough memory, but if you compile for Teensy 1.0 and get a .HEX file under 4k, it might work).  If you have a compatible board, you should get latency of 1ms or less, and lots of bandwidth, since it's direct 12 Mbit/sec USB.  There's a send_now() function which forces any buffered data USB packet to be immediately made available to the USB host controller.  If you don't call send_now() after sending MIDI messages, the packet gets sent within the next 1ms USB frame.

This USB MIDI code is pretty new.  A few people have used it with success, and I sent and received a bunch of messages to/from Puredata.  If you give it a try, please let me know how it works for you.

493  Development / Other Software Development / Re: Convert string to long integer on Arduino on: March 03, 2011, 09:15:05 am
Float numbers work fine.  How Arduino handles them is pretty much like any other number, just put a variable in your code and give it "float" type.

As for printing to the Serial Monitor, just use Serial.print() like you would with an int or any other variable.

How Arduino actually handles floats could be answered in terms Arduino core code, avr-libc library code, the build process as implemented by Compiler.java, internal gcc compiler details, numerical formats (mantissa, exponent, normalization, rounding strategies, etc), binary data representations, logic circuitry, transistor-level CMOS logic implementation, analog characteristics of digital logic circuitry, propagation of electrons and changes in their energy states, electric and magnetic fields, semiconductor material physics, sub-atomic particles, and as-yet-to-be-discovered scientific understanding of matter and energy (eg, "grand unified theory").  But if you're at a beginner level, where you're not sure how to print a float (exactly the same as any other type of variable), learning exactly how Arduino handles floats would only distract you from learning the most basic skills to simply make use of them in your sketch.
494  Development / Other Software Development / Re: Convert string to long integer on Arduino on: February 21, 2011, 05:28:26 am
Why not just use the toInt function, like this?


String strSteps = String();
strSteps = "1600";
long steps2move = strSteps.toInt();


Also, if you're using the string objects, you might want to copy these 3 files into your hardware/arduino/cores/arduino directory.  They fix many bugs in the string class.

http://code.google.com/p/arduino/issues/detail?id=468

495  Forum 2005-2010 (read only) / Troubleshooting / Re: Firmata example not compiling on: January 08, 2011, 03:56:17 pm
Arduino 0023 is scheduled to bring in this fix.

http://code.google.com/p/arduino/issues/detail?id=447
Pages: 1 ... 31 32 [33] 34 35 ... 39