Maker Pro
Maker Pro

Serial transfer problem

E

Ed

I am using a DS89C440 flash micro running at 29.491Mhz with 64k of external
RAM and no external ROM.
I am running my serial port using timer-1 for baud rate generator at
19200baud.
My source computer is a P4-3Ghz running winxp-pro and my program for sending
data to the micro is Visual C++ 6.0
For some reason I dont under stand, not all the data I send to the micro
gets there.
My serial receive code for the micro is below:
;
; ***** Get job data from PC *****
;
getpc: mov dptr,#1000h ;set dptr to data area
getpc1: jnb ri,getpc1
mov a,sbuf ;get char from port
clr ri
movx @dptr,a ;save data to memory
inc dptr
mov a,dph
cjne a,#20h,getpc1 ;receive 8319 bytes
mov a,dpl
cjne a,#7fh,getpc1
ljmp loop ;top of program

Any ideas???
 
E

Ed

I am allways expecting to receive 207Fh bytes because that is how many are
allways transmitted by the PC program.
The number of bytes missing seems random. Sometimes I only miss a few bytes
and other times I am missing quite a few.
 
E

Ed

I am sure of the number of bytes transferred and tested with 2nd pc using
hyperterm.
I am using no interrupts on the micro, my serial uses polling only.
I dont see how making the serial routing interrupt driven would help.
I think it would increase the possibility of missing bytes more possible due
to the extra instructions.
I am doing nothing else while receiving data from the pc.
 
Top