bhanot.manik90
Junior Member level 1
guys ,
I want to interface 8051(at89s52) with nokia 6070...when I connect the fbus with the pc's db-9 connector and through hyper terminal, if a send 'at', i get back an 'ok' response from the mobile on hyper terminal...as fbus is ttl-to-rs232 level converter, so i decided to directly connect the tx,rx pins of mc with the tx ,rx of the mobile and also interfaced an 16*2 lcd with mc,,,Now when i send 'at' to mobile phone, then it does not send an 'ok' on the lcd screen,,,what could be the problem then,,,i guess could it be:: since sbuf is an 8-bit reg but mobile sends 'ok' which is a 16-bit word ,so is the sbuf overrun??,,,,,plzzzzzzzzzzzz tell me what could be the problem, guide me friends,,,also below i have given the code which i am using ,,what could be the problem guys???????
$MOD51
ORG 0000H
; INDICATE FOR SERIAL TRANSMISSION
MOV TMOD,#20H ; TIMER 1 MODE 2
MOV TH1,#-3 ; FOR Baud rate
MOV SCON,#50H
start: clr P2.0
mov dptr,#100h
setb tr1
back: clr a
movc a,@a+dptr
jz here_2
acall send
inc dptr
sjmp back
send: mov sbuf,a;////transmit
here: jnb ti,here
clr ti
ret
here_2: jnb ri,here_2 ;/////receive
clr ri
mov r1,sbuf
mov a,#38h ; 16 x 2 LCD 5 x 7 Matrix
acall command
acall ready
mov a,#0fh ; Disply on,Cursor Blinking
acall command
acall ready
mov a,#06h ; Increment Cursor
acall command
acall ready
mov a,#01h ; Clear Disply
acall command
acall ready
mov a,#80h ; Force Cursor to Begining of First Line
acall command
acall ready
lcd: mov a,r1
acall display
acall ready
here6: sjmp here6
command:
mov P1,a
clr P2.5 ;RS=0 For COMMAND REGISTER
clr P2.6 ; READ/WRITE
setb P2.7
acall ready
clr P2.7
ret
display:
mov P1,a
setb P2.5 ;RS=1 For DATA REGISTER
clr P2.6 ; READ/WRITE
setb P2.7
acall ready
clr P2.7
ret
; Approx. 20ms Delay
ready:
mov tmod,#01h ;timer0,mode1(16-bit mode)
mov th0,#03eh
mov tl0,#0b8h
setb tr0
again: jnb tf0,again
clr tr0
clr tf0
RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%
org 100h
db 'a','t',0h
END
---------- Post added at 09:37 ---------- Previous post was at 09:02 ----------
I want to interface 8051(at89s52) with nokia 6070...when I connect the fbus with the pc's db-9 connector and through hyper terminal, if a send 'at', i get back an 'ok' response from the mobile on hyper terminal...as fbus is ttl-to-rs232 level converter, so i decided to directly connect the tx,rx pins of mc with the tx ,rx of the mobile and also interfaced an 16*2 lcd with mc,,,Now when i send 'at' to mobile phone, then it does not send an 'ok' on the lcd screen,,,what could be the problem then,,,i guess could it be:: since sbuf is an 8-bit reg but mobile sends 'ok' which is a 16-bit word ,so is the sbuf overrun??,,,,,plzzzzzzzzzzzz tell me what could be the problem, guide me friends,,,also below i have given the code which i am using ,,what could be the problem guys???????
$MOD51
ORG 0000H
; INDICATE FOR SERIAL TRANSMISSION
MOV TMOD,#20H ; TIMER 1 MODE 2
MOV TH1,#-3 ; FOR Baud rate
MOV SCON,#50H
start: clr P2.0
mov dptr,#100h
setb tr1
back: clr a
movc a,@a+dptr
jz here_2
acall send
inc dptr
sjmp back
send: mov sbuf,a;////transmit
here: jnb ti,here
clr ti
ret
here_2: jnb ri,here_2 ;/////receive
clr ri
mov r1,sbuf
mov a,#38h ; 16 x 2 LCD 5 x 7 Matrix
acall command
acall ready
mov a,#0fh ; Disply on,Cursor Blinking
acall command
acall ready
mov a,#06h ; Increment Cursor
acall command
acall ready
mov a,#01h ; Clear Disply
acall command
acall ready
mov a,#80h ; Force Cursor to Begining of First Line
acall command
acall ready
lcd: mov a,r1
acall display
acall ready
here6: sjmp here6
command:
mov P1,a
clr P2.5 ;RS=0 For COMMAND REGISTER
clr P2.6 ; READ/WRITE
setb P2.7
acall ready
clr P2.7
ret
display:
mov P1,a
setb P2.5 ;RS=1 For DATA REGISTER
clr P2.6 ; READ/WRITE
setb P2.7
acall ready
clr P2.7
ret
; Approx. 20ms Delay
ready:
mov tmod,#01h ;timer0,mode1(16-bit mode)
mov th0,#03eh
mov tl0,#0b8h
setb tr0
again: jnb tf0,again
clr tr0
clr tf0
RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%
org 100h
db 'a','t',0h
END
---------- Post added at 09:37 ---------- Previous post was at 09:02 ----------