Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: silo_xtreme on May 20, 2009, 12:32:17 PM
-
I have a Syren25 and when the S1 wire is not connected to the Syren the motor is off.
When the Syren25 has a S1 wire connected to it, and the other end of the S1 wire is not connected to anything , the motor runs.
It's also not responsive to any commands.
I have it in Simple Serial mode. I'm thinking my Syren has a short in it ..... would this be a correct thought? ???
-
lol sounds like the wire is somehow acting as an antenna . . . check to make sure your grounds are common, and that your other wiring is correct.
-
LoL, I know it's an interesting problem.
My 5V source and 24V source are separate power sources, isolated from each other. I had another interesting problem when I tried to use the 5V output on the Syren ... I ended up with 33V as an input into the Syren.
I think there's something wrong with my Syren's ... but I need a sanity check.
-
My 5V source and 24V source are separate power sources, isolated from each other.
As I suspected, you need to keep grounds common. :P
-
Haha, That looks like it fixed the noise problem! Thanks!!! ;D
Now how come my code won't turn it off after it starts?
// USART2 initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART2 Receiver: Off
// USART2 Transmitter: On
// USART2 Mode: Asynchronous
// USART2 Baud Rate: 38400
UCSR2A=0x00;
UCSR2B=0x08;
UCSR2C=0x06;
UBRR2H=0x00;
UBRR2L=0x19;
UDR2=190;
delay_ms(1000);
UDR2=127;
while(1);
I'm a bit confused on that one.
-
What mcu you using? :P
-
Heh, Sorry.
ATMEGA 1280
I don't get any response or change in direction either ... I can just turn it on with a signal. It's weird.
-
Reverse the 190 and 127 . . . that'll offer a clue to what isn't working.
-
The motor turns on as soon as I hit the program chip button.
In order for me to get the motor to stop, I erase the chip and cycle the power to both the chip and Syren.
???
-
This means either your wiring still isn't correct, or your UART isn't working as you thought.
Got an oscope?
Also, attach your uart to hyperterminal to see the actual output.
-
No Oscope, suppose I should buy one.
Will try to get the USART to hypertem soon.
I've been trying to do everything on the JTAG interface ,.... I can debug the chip..
-
What should I look for with an Oscope or USART to Hyperterm?
-
What should I look for with an Oscope or USART to Hyperterm?
If its hyperterminal, you should see numbers representing what you sent to serial of your Syren.
If an oscope, you'll see a TTL binary of the number (square wave, high for 1, low for 0). Just use the trigger setting to capture it.
-
If its hyperterminal, you should see numbers representing what you sent to serial of your Syren.
you should see the equivalent ascii character not number. you will have to convert to see the equivalent number.
-
Just thinking.
I could try packetized serial mode with address 128.
Would this be the correct code to send 1 packet and test this concept?
UDR2=128;
UDR2=127;
UDR2=64;
UDR2=((128 + 127 + 64) & 0b01111111);
-
I personally recommend just using AVRlib. Its code that you know works, and its user friendly.