Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CODE TO TEST 8051 + HYPERTERMINA

Status
Not open for further replies.

fatima_just

Junior Member level 1
Joined
Sep 13, 2008
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,419
m tech distance education

Sallam.
Please gime code to test 8051 with hyperterminal in c language .
(I use xtall 11.0592 MHZ and buad rate 9600)
using Kiel spftware .
thanks.
 

hypertermina

simplest example (read & write from RS232 using Hyperterminal baud rate 1200) 8051

char getCharacter (void)
{
char chr; // variable to hold the new character
while (RI != 1) {;}
chr = SBUF;
RI = 0;
return(chr);
}


void send (char a)
{
SBUF = a;
while (TI != 1);
TI=0;
}




void main (void)
{




SCON = 0x50; // mode 1, 8-bit uart, enable receiver
TMOD = 0x20; // timer 1, mode 2, 8-bit reload
TH1 = 0XE6; // for 9600 baud rate 0XFD
TL1 = 0XE6;
TR1 = 1;
TI = 0;
SBUF =0;


while (1)
{
your code



}//end of while
}//end of main

Added after 19 seconds:
 

teste 8051

Rember to switch of hard ware and software flow control
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top