Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > Microcontrollers 8bit > DS89C450 serial...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 775 of 862
Post > Topic >>

DS89C450 serial data transfer

by "Ed" <eddie@[EMAIL PROTECTED] > Mar 8, 2007 at 07:48 PM

I am having serial ****t communications problems. Below is
the simple code in the DS89C450 MCU that I am trying to get to
work properly. It is a simple routine to receive data via the
serial ****t at 38400baud. I am trying to receive 65536 bytes. It
allways drops some of the data like it is falling behind the
serial stream. Most the time the 1st 1000 bytes seem fine then
one is missed and the data in memory is short a byte. This
happens many times after the 1st 1k bytes. I am using Visual C++
6.0 as my pc software to send data from the pc to the DS89C450. I
did find that I had to buffer the ALE line to the latches for
more reliability. Do I need to buffer the WR & RD also or add
pull-ups on other pins? According to the data sheet the
Address/Data lines dont need pull-ups if thats all there used
for. My MCU circuit is very simple and uses 1-DS89C450MNL,
2-74F573 latches for address, 1-IS62C1024AL-35 Ram, 1-74HCT32
used as a buffer for ALE, 1-MAX233CPP Rs232. I have A16 tied low
on Ram chip. If I insert a 1ms delay between characters sent by
the pc, it works fine. But that defeats the speed-up in
communications. I can verify that data is missing by dumping the memory
contents with another routine in the micro to send the last 256 bytes of 
memory.
Out of 65536 bytes there is 7 bytes missing.
------------------------------------------------------------------------------

This is the code inside the DS89C450 MCU running at 29.491mhz


          pcon   equ 87h               ;address of PCON register
          scon1  equ 0c0h              ;address of SCON1 register
          sbuf1  equ 0c1h              ;address of SBUF1 register
          wdcon  equ 0d8h              ;address of WDCON register
          ckcon  equ 8eh               ;location of clock control
          org   0000h
          ljmp  start

          org   100h                   ;allways start ROM program at 0100h
   start: mov   scon,#50h              ;set serial ****t 0 to mode 1 with
rec 
enabled
          mov   tmod,#20h              ;set timer 1 as auto-reload 8-bit 
timer
          mov   th1,#0feh              ;baud rate equals 38400b at
29.491mhz 
w/smod=0
          mov   ie,#80h                ;do not enable serial interupt
          mov   tcon,#40h              ;start timer 1
          setb  ea                     ;global enable interrupts
          setb  p3.6                   ;set pull-up on WR
          setb  p3.7                   ;set pull-up on RD
          clr   ri                     ;ensure that receive interupt flag
is 
cleared
          clr   ti

    loop: jnb   ri,loop
          mov   a,sbuf
          clr   ri
          cjne  a,#01h,chka            ;01 = get job data from pc
          ljmp  getst
    chka: ljmp  loop

;
; ***** Get track / sector data from PC *****
;
   getst: clr   p1.0                   ;set RomA16 false
          clr   p1.4                   ;set RamA16 true
          setb  p1.2                   ;disable ROM
          clr   p1.3                   ;enable RAM
          mov   r1,#00h
          mov   dptr,#0000h
  getst1: mov   r2,#00h
  getst2: jnb   ri,getst1              ;wait for char from pc
          mov   a,sbuf
          clr   ri
          movx  @[EMAIL PROTECTED]
          inc   dptr
          djnz  r2,getst2
          djnz  r1,getst1              ;get 65536d bytes ff x ff
          ljmp  loop
 




 4 Posts in Topic:
DS89C450 serial data transfer
"Ed" <eddie@  2007-03-08 19:48:13 
Re: DS89C450 serial data transfer
"TT_Man" <So  2007-03-08 20:25:38 
Re: DS89C450 serial data transfer
"Ed" <eddie@  2007-03-08 21:36:57 
Re: DS89C450 serial data transfer
"TT_Man" <So  2007-03-08 21:40:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Nov 20 21:38:16 CST 2008.