I can't seem to figure this one out. I have written a program that controls a motor speed controller (the Roboteq AX-3500) and it works fantastic when I load it in the Mega 2560 but when I load it in any of the other Arduinos I have (Duemilanove, Professional and Uno) it does not work at all.
When talking to the motor speed controller all I am doing is setting the output pin High or Low to send 10 bits to the controller. I have tried different pins but none seem to work. However, all the pins I have tried work with the Mega 2560. Again the software is working perfectly with the Mega 2560 but I get nothing happening on the other Arduinos (not even wrong behavior) just no movement at all from the motors connected to the AX-3500.
An interesting thought but somehow I don't think I am running out of RAM. I was able to run the program on an UNO and using print statements view the output values in the Serial monitor and they looks exactly like the output from the Mega.
So it looks like the output is happening but I just get no response from the AX-3500.
// To use the Arduino Uno, or Profesional or other Arduino boards that have only a single
// UART you will need to set the requied pins as serial rx and tx pins.
//SoftwareSerial mySerial(rx, tx); // Sets up an additional set of rx & tx serial pins (6 & 7)
I don't see where you setup the SoftwareSerial. How do you differentiate when talking to Serial and the Xbee?
Actually I thought that I needed the software serial for a second serial port on the Uno, or professional but I really don't. That is just an old comment I forgot to take out.
I use the one hardware serial port to receive data from the XBee but when talking to the AX-3500 I simply set a single pin High/Low to send the data in the DigitalWrite() function.
bmanncsci:
I use the one serial port to receive data from the XBee but when talking to the AX-3500
Thanks for explaining what the AX-3500 is and posting a link to it. It was very clear it was a motor controller and that everyone who reads this board knows what it is.
bmanncsci:
simply set a single pin High/Low to send the data in the DigitalWrite() function.
It's a real shame the compiler doesn't allow for more descriptive names. It would be much easier for others to read your code if it did.
bmanncsci:
I use the one hardware serial port to receive data from the XBee but when talking to the AX-3500 I simply set a single pin High/Low to send the data in the DigitalWrite() function.
Yes the XBee is definitely communicating (i.e. the Arduino is receiving the data from the XBee) I know because I can see the comm light come on on the XBee carrier board and also from running the Serial monitor I can see the incoming data. It just seems like the output to the AX-3500 via the DigitalWrite function is not working but at the same time that also seems to be working from the Serial monitor output. So I am stumped as to what is wrong.
That gives me a return after printing the output character. It just makes the output in the Serial monitor easier to read. In any case the final version running in both the Mega and the Uno or profesional has that print statement commented out. In the final version the only thing I use for timing is the delay().
I'm thinking it has something to do with the hardware differences between the Mega and the other Arduinos.