#include <At89x52.h> /* special function register declarations */ #include <stdio.h> /* prototype declarations for I/O functions */
void main (void) { /*------------------------------------------------ Setup the serial port for 9600 baud at 11.0592MHz. ------------------------------------------------*/
TR1 = 0; SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */ TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */ PCON &= 0x7F; TH1 = 0xFD; /* TH1: reload value for 9600 baud @ 11.0592MHz */ // EA = 1; // ES = 1; RI = 1; TI = 1; TR1 = 1; /*------------------------------------------------ Note that an embedded program never exits (because there is no operating system to return to). It must loop and execute forever. ------------------------------------------------*/
printf ("hallo\r"); <=- with this line it doesn't work anymore !!!!!!!!!!!!!!!!! while (1) { TI = 0; SBUF = 'A'; while (!TI); P1 ^= 0xFF; TI=0; SBUF = '*'; while (!TI); TI=0; SBUF = '\r'; while (!TI); } }
i dont understand the program below the haloo line. plz give the details
this program
Incorrect verbiage. it should mbe these scribbles
NOTHING without comments is 'a program"
Erik
Please read the instruction on how to post code - they're right above the 'Message' box when you make your post!