Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/08/02 09:16
Read: times


 
#32144 - 8051 and MBUS
I wrote a program in 8051 assembly language, and I'm testing this code on RIDE 8051 simulator. (http://www.raisonance.com/) This program
sends data to the NOKIA 5110 phone through data cable (MBUS data cable) connected to the serial port of the PC.

This program writes data to the phone which I checked using Portmon utility (which is used to snoop the communication over the PC's COM ports.) The main problem with this program is that it is not receiving
any data from the NOKIA phone.

Following is the code which I wrote:
------- Serial.asm --------------
include REG_51.PDF ;8051 Register definition for use in RIDE.

org 00h
START :
mov a,00h
mov pcon,a
mov tmod,#20h ; timer1 mode2
mov th1,#0fdh ; reload value
mov tcon,#20h ; start timer1
;setb ren
setb tr1
mov scon,#052h ; serial mode
setb EA
setb ES
; Start writing One Frame to Phone
mov SBUF,#01FH
JNB TI,$
clr TI
mov SBUF,#00H
JNB TI,$
clr TI
mov SBUF,#10H
JNB TI,$
clr TI
mov SBUF,#0aH
JNB TI,$
clr TI
mov SBUF,#00H
JNB TI,$
clr TI
mov SBUF,#04H
JNB TI,$
clr TI
mov SBUF,#00H
JNB TI,$
clr TI
mov SBUF,#01H
JNB TI,$
clr TI
mov SBUF,#00H
JNB TI,$
clr TI
mov SBUF,#70H
clr TI
mov SBUF,#00H
JNB TI,$
clr TI
mov SBUF,#01H
JNB TI,$
clr TI
mov SBUF,#00H
JNB TI,$
clr TI
mov SBUF,#70H
JNB TI,$
clr TI
mov SBUF,#01H
JNB TI,$
clr TI
mov SBUF,#0f6H
JNB TI,$
clr TI
; Start Reading from Serial Port as soon as we finished ;writing and continuously read/poll phone.
JNB RI,$
MOV A,SBUF
CLR RI
MOV A,SBUF
movx @dptr,A
inc dptr
END
------- End of Serial.asm --------------

The problem is in the second part where I start Reading, the program only echos back the data/frame which I write in starting after that it doesn't read anything.

The same logic I used for a C program which opens serial port and writes the same frame and after that in select() it polls the serial port and after that any activity on the phone causes select to return and phone gives some frames to the program, here everything works fine but the same logic doesnot work in my assembly code.
Please can anyone help.


No replies in thread

Back to Subject List