Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: KRGrindley on February 01, 2010, 06:15:11 PM
-
I have an AXON 1 and I have been having some UART troubles.
1) If I use just UART1 (the USB) it sends data just fine, but it won't receive it. I have tried putting all the original source code on (only commenting out all the timers because I get a badISR called error and constant resetting if I don't). Then I deleted the original control() and replace it with the following code:
void control(void)
{
char temp;
rprintf("type_stuff");
while(1)
{
temp=uart1GetByte();//returns -1 if no data present
if (temp == 'r')//if data received
rprintf("stuff");
}
}
The out put goes until it hits the uart1GetByte(), then it waits but never gets anything.
2) When trying to use one of the other UART ports I just get a bunch of "4"s displaying on the screen. I am using RS232 with the Axon "T" Pin to RS232 Pin 2, Axon "R" Pin to RS232 Pin 3 and Axon "G" Pin to RS232 Pin 5. This configuration also does not show any noticeable response to input. I am pretty user I have all my ports configured properly at 115200 Baud.
Any hits you can offer would be greatly appreciated.
-
When you say RS232 (for uarts other than UART1) then I'm assuming you mean TTL level (ie +5v) and that your not connecting it straight to a PC RS232 port without a level shifter?
-
Ouch, it sounds like you connected to directly to a serial port (since the pin number you mentioned are correct to a DB9 serial port) without a level shifter. This will fry your Axon's Uart port.
-
Any possible chance you yanked too hard on the USB connector?
Measure the 5 pins on the USB connector while sending data (have someone type really fast into HyperTerminal while you do this). Oscilloscope preferred, but a multimeter might pick up blips, especially if you use the frequency setting.
Two pins should be 0V, one should be 5V, and the last two should carry a signal.
-
When you say RS232 (for uarts other than UART1) then I'm assuming you mean TTL level (ie +5v) and that your not connecting it straight to a PC RS232 port without a level shifter?
Ya that's what I was doing...fortunately nothing got fried, just wasted a few hours.
Thanks