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.

data communication by computer

Status
Not open for further replies.

Noman Yousaf

Full Member level 4
Joined
Nov 19, 2003
Messages
208
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,298
Location
Lahore Pakistan
Activity points
1,763
i want to interface the AT89C51 with computer either by serial or perellal port
i know Assambly lang.
i want to make the display on computer monitor which must show the number of pulses or data come from mcu.
or any readymade software which can do the required thing.
i can use rs232 too.
 

send this no. on UART in the correct format you want to display. Use hyper terminal to view this.

note:-In hyper terminal ascii values are printed only so you have to convrt it into ascii and send each digit saperately
 

HELLO THIS ASSEMPLY FILE DISPLAYES "AHMED" IN 9600 n-8-1 SERIAL COMMMUNICATION

Code:
#INCLUDE "8051EQU.INC"
; RESET                         ;reset routine
   .ORG   0H                    ;locate routine at 00H
    AJMP   START                ;jump to START 
;
;**************************************************************************
;
; INTERRUPTS  (not used)        ;place interrupt routines at appropriate
                                ;memory locations
   .ORG   03H                   ;external interrupt 0
    RETI
   .ORG   0BH                   ;timer 0 interrupt
    RETI
   .ORG   13H                   ;external interrupt 1
    RETI
   .ORG   1BH                   ;timer 1 interrupt
    RETI
   .ORG   23H                   ;serial port interrupt
    RETI
   .ORG   25H                   ;locate beginning of rest of program
;
;**************************************************************************
;
INITIALIZE:                     ;set up control registers
;
    MOV   TCON,#00H
    MOV   TMOD,#00H
    MOV   PSW,#00H             
    MOV   IE,#00H               ;disable interrupts
    RET
;
;**************************************************************************
;
;      Real code starts below. The first two routines are for delays so we
;      can slow down the blinking so we can see it. (Without a delay, it 
;      would blink so fast it would look like it was always on.
;
;**************************************************************************
;
DELAYMS:                        ;millisecond delay routine
;                               ;
   MOV   R7,#00H                ;put value of 0 in register R7
LOOPA:                          
   INC   R7                     ;increase R7 by one (R7 = R7 +1)
   MOV   A,R7                   ;move value in R7 to Accumlator (also known as A)
   CJNE   A,#0FFH,LOOPA         ;compare A to FF hex (256). If not equal go to LOOPA
   RET                          ;return to the point that this routine was called from
;
;**************************************************************************
;
DELAYHS:                        ;half second delay above millisecond delay
;                               ;
   MOV   R6,#00H                ;put 0 in register R6 (R6 = 0)
   MOV   R5,#002H               ;put 2 in register R5 (R5 = 2)
LOOPB:
   INC   R6                     ;increase R6 by one (R6 = R6 +1)
   ACALL   DELAYMS              ;call the routine above. It will run and return to here. 
   MOV   A,R6                   ;move value in R6 to A                    
   JNZ   LOOPB                  ;if A is not 0, go to LOOPB
   DEC   R5                     ;decrease R5 by one. (R5 = R5 -1)
   MOV   A,R5                   ;move value in R5 to A
   JNZ   LOOPB                  ;if A is not 0 then go to LOOPB. 
   RET
;
;**************************************************************************
;
START:                          ;main program (on power up, program starts at this point)
   ACALL INITIALIZE             ;set up control registers 
	MOV TMOD,#20H
	MOV TCON,#41H
	MOV TH1,#0FDH
	MOV SCON,#50H
LOOP:
;   CPL P1.1                     ;ComPLement (invert) P1.0 (this makes LED change)
;   ACALL DELAYHS                ;go to above routine that causes a delay
   CLR TI
   MOV SBUF,#'A'
   JNB TI,$
   CLR TI
   MOV SBUF,#'H'
   JNB TI,$
   CLR TI
   MOV SBUF,#'M'
   JNB TI,$
   CLR TI
   MOV SBUF,#'E'
   JNB TI,$
   CLR TI
   MOV SBUF,#'D'
   JNB TI,$
   CLR TI
   MOV SBUF,#' '
   JNB TI,$
   CLR TI
   MOV SBUF,#13
   JNB TI,$
   CLR TI
   MOV SBUF,#10
   JNB TI,$

   AJMP LOOP                    ;go to LOOP(always jump back to point labeled LOOP)
.END                            ;end program
 

thanks i know how to check the data from hyper termianl but i want to see tha coming data like whe pulses r come, a counter is displayed which shows the counter digits or so on
it could be done by LPT port
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top