Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/16/04 09:05
Read: times


 
Msg Score: +1
 +1 Good Question
#72571 - ADuC832 serial comms problem
Hi all,

I am trying to configure the serial port on a Futurlec ADuC832 controller board to talk to a PC. I am developing in C using Keil (evaluation version). I am using HyperTerminal to read data off the COM port.

This is my code...

#include <stdio.h>
#include <ADuC832.h>

void main(void)
{
SCON = 0x52; // mode 1, 8-bit uart, enable
TMOD = 0x20; // timer 1, mode 2, 8-bit reload TH1 = 0xFD; // reload value for 9600 baud
TR1 = 1; // start timer 1

while (1)
{
int j;
printf( "Hello world..!" );
for ( j = 0; j < 1000; j++ ) { }
}
}

When I run HyperTerminal I expect to get the string Hello World..! repeating over on the screen however all I get is the character '-' repeating over on the screen. If I comment out the printf statement, rebuild the HEX file and run that, the characters stop appearing in HyperTerminal so data is being sent, it's just always the same character.

If I change the text from Hello World to something else I get the same '-' character repeating over.

Interestingly, if I reset the board with HyperTerminal still running I get "ADI 832 V20" printed on the screen so the connection seems okay. I just can't get the board to send my text strings.

What is the problem here...?

Thanks in advance,
Lyndon.

List of 10 messages in thread
TopicAuthorDate
ADuC832 serial comms problem            01/01/70 00:00      
   RE: ADuC832 serial comms problem            01/01/70 00:00      
      RE: ADuC832 serial comms problem            01/01/70 00:00      
         RE: ADuC832 serial comms problem            01/01/70 00:00      
   RE: ADuC832 serial comms problem            01/01/70 00:00      
      Keil Example            01/01/70 00:00      
         More Keil Examples            01/01/70 00:00      
   RE: ADuC832 serial comms problem            01/01/70 00:00      
      RE: Keil putchar, getchar.            01/01/70 00:00      
   RE: ADuC832 serial comms problem            01/01/70 00:00      

Back to Subject List