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:
#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.