We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Sir, Here is my UART program... $ org 000h ljmp begin org 23h ljmp serial_IT ;/** ; * FUNCTION_PURPOSE: This file set up uart in mode 1 (8 bits uart) with ; * timer 1 in mode 2 (8 bits auto reload timer). ; * FUNCTION_INPUTS: void ; * FUNCTION_OUTPUTS: void ; */ org 0100h begin: MOV SCON, #50h; /* uart in mode 1 (8 bit), REN=1 */ ORL TMOD, #20h; /* Timer 1 in mode 2 */ MOV TH1, #0FDh; /* 9600 Bds at 11.059MHz */ MOV TL1, #0FDh; /* 9600 Bds at 11.059MHz */ SETB ES; /* Enable serial interrupt*/ SETB EA; /* Enable global interrupt */ SETB TR1; /* Timer 1 run */ JMP $; /* endless */ ;/** ; * FUNCTION_PURPOSE: serial interrupt, echo received data. ; * FUNCTION_INPUTS: P3.0(RXD) serial input ; * FUNCTION_OUTPUTS: P3.1(TXD) serial output ; */ serial_IT: JNB RI,EMIT_IT ; test if it is a reception CLR RI ; clear reception flag for next reception MOV A,SBUF ; read data from uart MOV SBUF,A ; write same data to uart LJMP END_IT EMIT_IT: CLR TI ; clear transmition flag for next transmition END_IT: RETI end This program is taken from ATMEL SITe.. when i simulate it....during simulation how do i give serial input? When u just run it,setting RI manually...check out SBUF value...no value in it??? How to give serial input?? Since port 3 (P3.0 (RXD) and P3.1 (TXD) ) is used for serial communication.. how to set p3.1 as output pin and p3.0 as input pin?? Thank you. Tushar
Please read the uVision Getting Started Guide, and work through the example projects in it. This will give you a proper introduction to the tools, how they work, and how to use them - rather than just jumping-in blindly at the deep end. (The uVision Getting Started Guide is available on the 'Books' tab in the 'Project' Window; The 'Books' window is also available via the 'Help' menu; failing all that, search for GS51.PDF in your Keil folder)