Author Topic: Are some Uarts on the Axon better then others?  (Read 3230 times)

0 Members and 1 Guest are viewing this topic.

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Are some Uarts on the Axon better then others?
« on: January 16, 2010, 12:40:20 PM »
I have been trying to interface my custom motor controller with my Axon. Basically, whenever the Axon sends a motor command, the controller responds back with sensor data (distance traveled, battery voltage and current).

 I spent hours trying to figure out why I was getting garbage, The controller could 'hear' the Axon fine, but i was getting back garbage from it.

I wrote this
Code: [Select]

while (temp_b = uart3GetByte(), temp_b != -1)
{
process[motor_index++] = temp_b;
         }

//check data
if (motor_index == 8 && process[0] == 'S' && process[7] == '*')
{
good++;
done = 1;
}
else
bad++;

To tell me if the received message matched what it was suppose to get. (Header, footer, and length)
The results showed that i was getting around 50% bad messages.

Then I changed nothing else, except moving the plug to another Uart header (Uart 2) and changed the code to match the new uart. PRESTO! 0% bad messages. Then I tried Uart 1 (I removed the USB chip and have a regular header) and got 2% bad messages.

Why would Uart 3 behave so badly, with nothing else changed?

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Are some Uarts on the Axon better then others?
« Reply #1 on: January 16, 2010, 12:53:42 PM »
Seeing how your usb chip was bad, have you ever considered that your axon chip might be defective?
It's a bit uncommon, but so is a 50% error rate difference on the identical devices.
Save yourself the typing. Just call me Zach.

Offline little-c

  • Robot Overlord
  • ****
  • Posts: 186
  • Helpful? 1
Re: Are some Uarts on the Axon better then others?
« Reply #2 on: January 16, 2010, 01:24:21 PM »
you haven't shorted the uart 3? or damaged one of the traces or connectors?


Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Are some Uarts on the Axon better then others?
« Reply #3 on: January 16, 2010, 02:29:19 PM »
physically it looks fine. At this point i think my Axon is just a lemon,

smashed power LED on delivery,
USB gave out for no reason
and now a Uart is misbehaving

I don't remember what company i directly bought the Axon from, but i'm gonna stick to direct from SOR from now on, and i have an Axon 2 on the way.

Offline z.s.tar.gz

  • Supreme Robot
  • *****
  • Posts: 540
  • Helpful? 5
  • Linux Guru
Re: Are some Uarts on the Axon better then others?
« Reply #4 on: January 16, 2010, 03:05:23 PM »
Hope you remember, as it sounds like a serious "heads up" thing for people trying to buy the axon from somewhere else.
Save yourself the typing. Just call me Zach.

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Are some Uarts on the Axon better then others?
« Reply #5 on: January 16, 2010, 05:19:21 PM »
Is everybody ready to laugh at me? It's been one of those days.

So, this method

while (temp_b = uart3GetByte(), temp_b != -1)
   {
      process[motor_index++] = temp_b;
         }

works great, EXCEPT when the data byte from the Uart is 11111110, otherwise know as -1, when the compiler thinks it's a signed char.
So my motor controller was passing two byte unsigned ints, like 00011100  11111110 , the Least significant byte was tricking the while loop into thinking the uart receive buffer was empty, when it really wasn't. This made it look like a bad message. It was just coincidence it coordinated with me trying different Uarts.

So, this

while (!uartReceiveBufferIsEmpty(MOTOR_COM))

works 100% on all uarts.

good grief.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Are some Uarts on the Axon better then others?
« Reply #6 on: January 16, 2010, 09:57:26 PM »
Good that you solved the problem.

Quote
USB gave out for no reason
Did you use the 3.3V output at all, for anything? Two other people have reported frying their USB by hooking up stuff that shouldn't go there.

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Are some Uarts on the Axon better then others?
« Reply #7 on: January 16, 2010, 10:19:10 PM »
I used it once to power my Venus GPS, but that was 5 months ago. Nothing has touched those pins since.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Are some Uarts on the Axon better then others?
« Reply #8 on: January 16, 2010, 10:22:09 PM »
Hmmm perhaps an accidental short? I guess no way to know . . .

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
Re: Are some Uarts on the Axon better then others?
« Reply #9 on: January 16, 2010, 10:51:45 PM »
Usually a UART problem is bad frequency calibration problem (check clocks etc etc etc)

And a GPS draws a lot of current for than 50mA for sure...
If I remember right that USB thingy can only give out 30mA... So, it may have been the reason.....
For whom the interrupts toll...

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Are some Uarts on the Axon better then others?
« Reply #10 on: January 16, 2010, 11:01:39 PM »
And a GPS draws a lot of current for than 50mA for sure...
If I remember right that USB thingy can only give out 30mA... So, it may have been the reason.....
The Venus, power wise, will work fine on the Axon 3.3V output.

It cannot supply more than about 73mA, or 90mA if you aren't using USB.

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Are some Uarts on the Axon better then others?
« Reply #11 on: January 17, 2010, 09:24:06 AM »
The only thing i can tell you is it was not a discrete, one day it worked, one day it didn't. There was a few hours where it would work on one computer but not another, and it would take a few tries. It was more of a slowly burning out.

I still get a steady 3.3V from that pin header.

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
Re: Are some Uarts on the Axon better then others?
« Reply #12 on: January 17, 2010, 09:34:24 AM »
Oooopsss... memory error, sorry Admin...

Have you tried to reflow your axon... Most electronics boards may have some flaws over time
but with a good rework it should be fine. Only thing you need is some hot air...
And it's a common tool at repairing shops
For whom the interrupts toll...

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Are some Uarts on the Axon better then others?
« Reply #13 on: January 17, 2010, 09:56:15 PM »
It sounds like a chip just slowly failing on its own. A whole host of possible reasons why . . .

It was reflowed on.

Offline madsci1016Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,450
  • Helpful? 43
    • Personal Website
Re: Are some Uarts on the Axon better then others?
« Reply #14 on: January 17, 2010, 10:03:36 PM »
LOL.

Well, if it was fixable by reflow, it isn't now. I cut the traces to the chip and glued on my own uart pinheader.

I also got my Axon2 in the mail. Haven't decided if i want to replace the modified Axon 1, as it works, and now gives me 4 uarts on board. I might give my Axon2 the same treatment.

I thought i remember reading the Axon2 was gonna have the upgrade to the 640, the 2460 or something, the same thing but more memory. I must be going crazy.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: Are some Uarts on the Axon better then others?
« Reply #15 on: January 17, 2010, 10:13:14 PM »
Quote
Well, if it was fixable by reflow, it isn't now. I cut the traces to the chip and glued on my own uart pinheader.
Yeap, you just reflow a $5 USB chip on it to replace the bad one, and you're set to go  :P
(but too late now, lol . . . easy, assuming you have l337 solder skills and/or a reflow oven)

Quote
I also got my Axon2 in the mail. Haven't decided if i want to replace the modified Axon 1, as it works, and now gives me 4 uarts on board. I might give my Axon2 the same treatment.
Nothing wrong with a software UART. You can also stack both Axons and have them communicate/work together - have one Axon process all the UART data and send the final result by UART to the other Axon.
[/quote]

Quote
I thought i remember reading the Axon2 was gonna have the upgrade to the 640, the 2460 or something, the same thing but more memory. I must be going crazy.
Not a single person has reported using up all the 640 memory. I'd be shocked if anyone does! My ERP has managed only 61% usage, and 24% RAM usage, tops.

 


Get Your Ad Here