2

Author Topic: UART on Axon  (Read 2038 times)

0 Members and 1 Guest are viewing this topic.

Offline HanoushTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
UART on Axon
« 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 ?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: UART on Axon
« Reply #1 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());

Offline HanoushTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: UART on Axon
« Reply #2 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.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: UART on Axon
« Reply #3 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
« Last Edit: March 16, 2009, 10:36:39 PM by Admin »

Offline HanoushTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: UART on Axon
« Reply #4 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 ?

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: UART on Axon
« Reply #5 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.

Offline HanoushTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: UART on Axon
« Reply #6 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

Offline HanoushTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: UART on Axon
« Reply #7 on: March 19, 2009, 11:17:05 AM »
The Hyperterminal is Giving me wierd characters  :'(
« Last Edit: March 19, 2009, 11:25:38 AM by Admin »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: UART on Axon
« Reply #8 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 . . .

Offline superchiku

  • Supreme Robot
  • *****
  • Posts: 953
  • Helpful? 5
  • cooll
Re: UART on Axon
« Reply #9 on: March 19, 2009, 11:29:01 AM »
serial communications give so much problem all the time...thre needs to be a replacemnt
JAYDEEP ...

IT AND ROBOTICS ENGINEER

"IN THE END IT DOESNT EVEN MATTER"

Offline HanoushTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: UART on Axon
« Reply #10 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.  ???

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,657
  • Helpful? 169
    • Society of Robots
Re: UART on Axon
« Reply #11 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).

Offline HanoushTopic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: UART on Axon
« Reply #12 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.

 


Get Your Ad Here

data_list