Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Hanoush on March 16, 2009, 05:35:02 AM

Title: UART on Axon
Post by: Hanoush on March 16, 2009, 05:35:02 AM
I have a blueSMirf gold and GPS mirco-mini.I connected the blueSMIRF and was able to configure it on hypeterminal. but when I connected the GPS ,I wasn't able to configure it or get datastream out of it even Recieve_echo() didn't work.
I think that is because I don't directly connect to the gps ,I connect to it through the USB. do I have to do anything before using UART3 ?
Title: Re: UART on Axon
Post by: Admin on March 16, 2009, 11:12:40 AM
Ummmm you need to clarify more . . . whats the GPS micro-mini?

I really don't understand what you programmed or how you wired it up . . .

Are you using the Axon as a go-between for your GPS (that uses TTL) and USB? Just rprintf what UART3 sees to UART1 on USB.

Here is a quick and dirty way to do it:

Code: [Select]
uartSetBaudRate(1, 38400);

while(1)
    rprintf("%c\n\r",uart3GetByte());
Title: Re: UART on Axon
Post by: Hanoush on March 16, 2009, 01:31:30 PM
I think  you mean uartSetBaudRate(3, 38400); instead of uartSetBaudRate(1, 38400);
or you want me to change the Baud Rate of the usb and make it the same as the GPS ?
I am using this GPS http://www.sparkfun.com/commerce/product_info.php?products_id=8936 (http://www.sparkfun.com/commerce/product_info.php?products_id=8936).
Title: Re: UART on Axon
Post by: Admin on March 16, 2009, 09:20:10 PM
oops, actually I meant to do this below. I also added data checking for you.

Code: [Select]
int data;
rprintfInit(uart1SendByte);

while(1)
    {
    data=uart3GetByte();
    if (data!=-1)
        rprintf("%c",data);
    }


edit: meant to use int, not char
Title: Re: UART on Axon
Post by: Hanoush on March 17, 2009, 02:54:36 AM
Thanks a lot.If I want to print the output of Recieve_Echo(),do I have to make a while loop and go char by char or there is an eaiser way ?
Title: Re: UART on Axon
Post by: Admin on March 17, 2009, 11:08:51 AM
The way I did it for the Blackfin is the easiest way I know . . . store the data into an array, then read it back out position by position.
Title: Re: UART on Axon
Post by: Hanoush on March 17, 2009, 11:17:39 AM
So,the 1st For-loop to store it and the 2nd For-loop to print it.
Thanks a lot
Title: Re: UART on Axon
Post by: Hanoush on March 19, 2009, 11:17:05 AM
The Hyperterminal is Giving me wierd characters  :'(
Title: Re: UART on Axon
Post by: Admin on March 19, 2009, 11:26:46 AM
Quote
The Hyperterminal is Giving me wierd characters  :'(
That means you got the baud rates wrong :P


ps - I accidentally hit the modify button instead of reply on your previous post . . . my brain wasn't working again . . .
Title: Re: UART on Axon
Post by: superchiku on March 19, 2009, 11:29:01 AM
serial communications give so much problem all the time...thre needs to be a replacemnt
Title: Re: UART on Axon
Post by: Hanoush on March 19, 2009, 06:01:50 PM
I tried to set it correctly but also not working.
The USB works on 115200 and the GPS by default 9600.I made everything 9600 but didn't work.I also have BlueSmirf Gold and tried to use the Axon as TTL to USB converter to perform a software Factory Reset but also didn't work.  ???
Title: Re: UART on Axon
Post by: Admin on March 25, 2009, 01:21:34 AM
I tried to set it correctly but also not working.
The USB works on 115200 and the GPS by default 9600.I made everything 9600 but didn't work.I also have BlueSmirf Gold and tried to use the Axon as TTL to USB converter to perform a software Factory Reset but also didn't work.  ???
All I can say is that you aren't doing something right . . . look around for mistakes in code and wiring . . . remember to do the loop-back test and to measure tx/rx pins with a multimeter (frequency setting).
Title: Re: UART on Axon
Post by: Hanoush on March 25, 2009, 02:21:47 AM
Well,I was going to try it again after I test it with FTDI usb to serial converter to check if the GPS works fine or not.