Show Posts
Pages: 1 2 [3] 4 5 ... 30
31  Using Arduino / Audio / Re: MIDI: Std Serial works, but not SoftSerial on: April 07, 2013, 05:36:48 pm
Well, I don't see why SoftwareSerial should behave differently from HardwareSerial as far as logic inversion is concerned, but you may try to initialize mySerial with a third argument, a flag indicating inverted logic. So you may try:

SoftwareSerial mySerial(rxMIDIpin, txMIDIpin, true);
(assuming this option was already implemented in version 1.0.1).

I would also remove the pinMode statements in setup(), which are managed by SoftwareSerial itself. Then I would try different pairs of digital pins, and would also measure their voltage, just rule out the possibility of different levels between pins 0, 1 and the rest.
32  Using Arduino / Installation & Troubleshooting / Re: 3 days did not find a solution, please help me thank you on: April 07, 2013, 03:25:54 pm
Please do not double post. You were offered some suggestions, how did they go?
33  Using Arduino / Audio / Re: MIDI: Std Serial works, but not SoftSerial on: April 07, 2013, 03:19:59 pm
Hi, I can't see anything wrong in your code, except that there *may* be problems in the implicit conversion from signed integer (the three arguments to noteOn() are ints) to byte (the type expected by write()). Although I don't think it should make much difference I would redefine the arguments to noteOn() as byte or uint8_t (and the loop variable "int note" as well).
34  Using Arduino / Networking, Protocols, and Devices / Re: Official Documentation for Ethernet client.status() ? on: April 06, 2013, 07:50:00 pm
You may look at the source code, i.e. the file EthernetClient.cpp somewhere within the Arduino program directory, then the w5100.h / .cpp files in the utilities subdirectory. I'm afraid you won't be much enlightened, because it boils down to a socket register for which I couldn't find the allowed values and their meaning, but it could help restricting your search.
35  Using Arduino / Networking, Protocols, and Devices / Re: JY-MCU Bluetooth Module on: April 06, 2013, 03:40:04 pm
Technically, the Arduino<->bt-module (UART) and the bt<->bt (wireless) baud rates could be different, but this would result in malfunctions due to overflow: a continuous dataflow of, say, 115200 bits per second coming through the wireless interface could not be retransmitted to the Arduino over a 9600 baud UART interface, even if there were some buffering mechanism in between, and you would experience data loss. So I expect that setting the baud rate on the UART interface automatically changes the baud rate on the wireless interface, though I cannot tell for sure.

What I call "command mode" is a state of the module where you can send AT commands to the module through the UART interface. These commands are not retransmitted to the wireless interface. As far as I understand, this is the only way to change the baud rate on the module (the SoftwareSerial.begin(baudrate) in the Arduino sketch only sets the speed of the SoftwareSerial interface, on the Arduino side of the link). The AT+BAUD8 command sets the baud rate to 115200 on the UART, and should be followed by a new SoftwareSerial.begin(115200). This change should be persistent (preserved after reset).

In order to enter command mode a pin of the module should be set to high (connected to 3.3V) before power up. There may be a way to do that in software, but I think the sketch you used to set the baud rate just failed to change anything, and the module is still working at the default 9600. Did you try SoftwareSerial.begin(9600)? It should test my supposition pretty quickly.

Finally, do not connect the module to the PC Usb because the voltage coming out of the PC is higher than the 3.3 V used by the module, both for power and signal (tx/rx). The same applies to the RS-232 adapter. I think however that you can try this:
1. Load a simple sketch (such as blink) that does not use Serial (no, print(), read()). This may even be overkill given what follows, but doesn't hurt.
2. While the Arduino is disconnected from Usb, connect Arduino RX - BT TXD, Ard TX - BT RXD, Ard 3V3 - BT VCC, Ard GND - BT GND.
3. Connect the Arduino and press the RESET button (of the Arduino). Keep it pressed until the end of the test.
4. Open putty and try connecting to the serial port of the Arduino. See if you get something from the BT module.

The principle is the same used for the loopback test: do not let the Arduino take control of the UART (com interface). After that you may also try releasing the RESET button and see what happens. Perhaps, not using Serial, the sketch will just ignore what happens to the com interface.

Last point is an explanation of my phrase about buffers and interrupts: the hardware serial interface (UART) relies on interrupts to see if there are bytes to send or read. Interrupts are small routines that run independently from the main sketch and are activated by the processor itself when some event occurs. For example, if there is incoming transmission on the serial line the UART will notify the processor of the presence of data (in the UART buffer), and the processor will activate an interrupt service routine to read it. Once read, the character will be moved to the Serial input buffer (a memory location) and removed from the UART buffer. Finally, when the sketch executes (or something similar) the character is removed from the Serial input buffer and passed to the sketch. If you have two processes sharing the same serial line they will use the same UART, and interrupts, and buffers, but only the first one of them will be able to get the character using Actually it's a bit more complicated than that, but I hope it's more understandable.

[edit] I failed to notice that the module lists a VCC range of 3.6V--6V, so you should use the 5V of the Uno (you already use it, I guess), and the idea of dissecting a Usb cable may work. Sorry, there are variants based on the same chip and I happen to own one using 3.3V.
36  Using Arduino / Networking, Protocols, and Devices / Re: JY-MCU Bluetooth Module on: April 06, 2013, 09:35:32 am
I think that in order to set the BT module speed to 115200 you first need to put it into command mode (should pull a pin of the module up, or down  smiley-confuse ... better read the docs) and issue the corresponding AT command. So, with the module in command mode, you first connect via SoftwareSerial using the default baud rate (9600?), change the BT baud rate with AT command, then put the module back to data mode (in the meantime, SoftwareSerial would probably disconnect or start reading garbage). You should then be able to reconnect with SoftwareSerial using the new baud rate.

Your assumptions are (mostly) correct: you cannot share the hardware RX/TX pins between the BT module and the Usb, not just because they use different baud rates but because they would be sharing the same interrupts and underlying communications buffer and they would interfere between themselves. It is also correct that, when you connect via SoftwareSerial to the BT module, everything you write is sent to the remote BT device, and everything you read comes from the outside; this happens because the default state of the module is data mode and self-pairing is enabled.
37  Using Arduino / Installation & Troubleshooting / Re: Leonardo No Serial Output on: April 05, 2013, 07:19:19 pm
Look at the BIOS parameters before boot, there should be an option to enable/disable the Usb EHCI (enhanced host control interface). As far as I understand it is enabled by default, but a previous user may have disabled it.

You can obtain basic diagnostic information from the Windows event log, and since you have access to an oscilloscope you might want to try a tool for Usb electrical analysis (see
38  Using Arduino / Installation & Troubleshooting / Re: arduino will not run on: April 04, 2013, 10:47:44 pm
What might be the name of the directory that would be deleted? 

The folder should be "Arduino" in Documents and Settings\user\Documents. But if it's not in preferences.txt it is probably nowhere.

You may try setting it yourself in preferences.txt:
sketchbook.path=C:\Documents and Settings\user\Documents\Arduino
so that it tries to start from there instead of some other, maybe non-existent, location.
Then you may also delete preferences.txt -- it will be created the next time the program is run.

You can get more information by running arduino from its own program directory, using the command prompt with a debug option:
arduino.exe --l4j-debug

This should create a launch4j.log file with details about the attempt.
39  Using Arduino / Programming Questions / Re: Counting Functions on: April 04, 2013, 10:10:23 pm
There are two basic ways to preserve the value of a variable across function calls:
1. declare it globally, i.e. outside any function (usually you see global variables declared at the beginning of the file, before setup());
2. declare it static within the function that is called repeatedly (e.g. within loop(), static int rotation).

The main difference is that in 1 the variable will be globally accessible, which is usually considered bad practice (any function can modify it, so you don't know which function is responsible if something goes wrong).
40  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE SLOOWWW while verifying on: April 04, 2013, 09:43:02 pm
The most common issue I've seen around is that during startup the IDE picks up a 64bit JVM, while it should run on a 32bit JVM. The RXTXcomm.jar Java library is usually the source of conflict -- it's in the IDE's package but is also part of the standard Java distribution.

WhatIf I uninstall Java ?? I see "Java 17 update 11 (64 bit)" on my installed programs... Hmmm..

Well yes, I wouldn't dare suggest it because who knows, maybe your whole projects database and e-commerce website run on a Java application on that system. But if you have no use for the 64bit version you can safely uninstall it.
41  Using Arduino / Installation & Troubleshooting / Re: Getting started issue in blink tutorial on: April 04, 2013, 09:36:56 pm
Hi all, on a Mac the name of the port is usually something like /dev/tty.usbmodem<somenumber_and_letter>. It only shows up if (and when) the Arduino is connected. And there's no need to install drivers.

More details can be got from the System Profiler (in Applications/Utilities), under Hardware/USB. The Uno and most other Arduinos is seen as a communications device, the Leonardo can show something different (USB Prober is also a very good tool, and a USB-Serial controller is not what I would expect).

If the Arduino doesn't show up there may be different causes, but the first thing to do is try all the Usb ports available on the Mac, use different cables, and remove other Usb devices that can draw too much current from the Mac. Don't forget to watch the Arduino: is any LED on, or blinking, when connected? Which colors?
42  Using Arduino / Installation & Troubleshooting / Re: arduino will not run on: April 04, 2013, 09:05:43 pm
Maybe you already ran arduino as administrator, and it created a sketchbook directory in your home directory. If this is the case you can either delete the existing directory (should be empty) or continue running arduino as administrator. You can also look for the file preferences.txt (somewhere within your home directory, not the one in the arduino program directory) and see/change the property named sketchbook.path.
43  Using Arduino / Installation & Troubleshooting / Re: Leonardo No Serial Output on: April 04, 2013, 08:43:20 pm
No more ideas, but your latest observations would make me think of an error on the pc side. And then, some more clueless advice: change physical com port, change cable, change pc, install a different OS (some linux live distros can run from a usb pen drive). Also, there *might* be utilities that show if a port is taken by a process (say, the leonardo is seen as a modem and you have a fax service running on the pc). And it *could* be that some languages (say, python) show more detailed information about the I/O error.
44  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE SLOOWWW while verifying on: April 04, 2013, 08:15:08 pm
BTW, the log file (assuming it's created) should be named launch4j.log.
45  Using Arduino / Installation & Troubleshooting / Re: 3 days did not find a solution, please help me thank you on: April 04, 2013, 08:14:04 pm
Actually I would reinstall the whole Arduino package, since the Java it's using is the one that comes with the package.

If you are able to change directory and run programs from the command prompt, I would go into the java\bin directory under the Arduino directory and try to launch java -version from there, just to see if java is somehow corrupted. You can also get some informative message by running arduino.exe --l4j-debug. It *should* create a file launch4j.log in the current directory.
Pages: 1 2 [3] 4 5 ... 30