Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
Serial transfer problem
- 12-22-2006
December 22, 2006, 3:08 pm

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???

Re: Serial transfer problem
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.


Re: Serial transfer problem

Make the code an interrupt service routine......
RXint:
mov a,sbuf ;get char from port
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
set complete flag here
disable rx interrupts
get1pc rti
Site Timeline
- » keypad and 7segment LEDs
- — Next thread in » Microcontroller Discussions
-
- » crc-ccitt
- — Previous thread in » Microcontroller Discussions
-
- » New(ish) assembler for PIC16 microcontrollers (asm1825)
- — Newest thread in » Microcontroller Discussions
-
- » (PDF) Essentials of Anatomy & Physiology 2nd Ed by Kenneth Saladin
- — The site's Newest Thread. Posted in » Electronics (Polish)
-
- » Cortex-Mx MCUs with SWD access locked
- — The site's Last Updated Thread. Posted in » Embedded Programming
-