go_away

Author Topic: UART Woes  (Read 658 times)

0 Members and 1 Guest are viewing this topic.

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
UART Woes
« on: December 30, 2010, 01:14:02 AM »
I've added UART to my $50 bot and it does a great job of sending information to my computer.  I can easily read sensor values and output them to hyperterminal flawlessly.  The problem is, I'm having a lot of trouble sending information in the other direction.  I'm trying to use hyperterminal to send information to my bot and nothing I do seems to work.  I think my problem is not in the bot or the code but rather in getting hyperterminal to send anything.  If I have my bot to constantly send something and then I bridge RX and TX, the bot receives the information its sending.  But no matter what I do, I can't get it to receive anything from hyperterminal.

I've read that all you have to do to send a character from hyperterminal is press a button and hit enter.  The problem is nothing happens when I do that.  TX on my UART module doesn't even flash.

Here's the code I'm using:

Code: [Select]
#include "interface.h"

void init (void);

u08 myReceivedByte;

int main()
{

  init();

  while(1)
  {
  if (uartReceiveByte(&myReceivedByte)) {
               rprintf("Pressed: %d\n", myReceivedByte);
   }
  }
  return 0;
}

UART gets initialized in interface.h.  I have no idea what to try at this point.  Everything works fine when I'm sending data from the bot to hyperterminal, and the bot works fine when I try a loopback by bridging rx and tx.

Offline hopslink

  • Robot Overlord
  • ****
  • Posts: 202
  • Helpful? 14
Re: UART Woes
« Reply #1 on: December 30, 2010, 08:20:28 AM »
How have you configured flow control for your port in Hyperterminal? This should be set to NONE for basic comms. Sounds like yours may be set to Hardware?

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
Re: UART Woes
« Reply #2 on: December 30, 2010, 01:33:08 PM »
Fixed.  +1.  Thanks.

 


Get Your Ad Here