Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

on the protues..Please check

6 posts / 0 new
Last post
shane
shane's picture
Offline
Last seen: 5 days 20 hours ago
Joined: 13/02/2017 - 14:44
on the protues..Please check
ORG 0000H
jmp start
Message1:
db 'AT',13,0
Message2:
db 'AT+CMGF=1',13,0
Message3:
db 'AT+CNMI=2,1,0,0,0',13,0
Message4:
db 'AT+CMGR=2',13,0
 
BUFFERLIMIT equ 16
byteCount equ 20h
bufferIn equ 21h  //store incoming text
 
start:
 
call serial_Init
call lcd_init
mov byteCount,#0 
MOV r0,#bufferIn    //buffer for messages
  //start mobile
  
mov dptr,#Message1  ;address first message
call serial_print_string  //send message
ACALL DELAY1
mov dptr,#Message2  ;address first message
call serial_print_string  //send message
ACALL DELAY1
mov dptr,#Message3  ;address first message
call serial_print_string  //send message
ACALL DELAY1
mov dptr,#Message4  ;address first message
call serial_print_string  //send message
 
//Wait for serial input ending 'X'
H1: 
JNB RI,H1  //wait for char
CLR RI
MOV A,SBUF  //get and store in buffer
MOV @R0,A
mov A,byteCount
CJNE A,#BUFFERLIMIT,roomleft  //check we have room
MOV @R0,#'X' //terminate string
jmp DISPLAY  //print what we have
 
roomleft:
     MOV A,@R0  //recover char
    inc byteCount
INC R0
CJNE A,#'X',H1  //wait for X to end message
 
DISPLAY:
       MOV r0,#bufferIn    //back to start
dis:
       MOV A,@R0
       cjne A,#'X',H
wait:
       sjmp wait  //stop at X
H:
       acall datawrt
       acall delay
       inc r0
       sjmp   dis //next char
 
 
comnwrt:mov P1,a
        clr P2.0;  For command
clr P2.1   ;for  write
setb P2.2 ; E=1  for high pulse
//acall delay
clr P2.2 ;H-to-L pulse
ret
 
datawrt:mov P1,a
setb P2.0 ;for data
clr P2.1 ;for write
setb P2.2  ;E=1 for high pulse
//acall delay
clr p2.2 ; H-to-L pulse
ret
delay: mov R3,#50
here2:mov R4,#255
here:djnz R4,here
djnz R3,Here2
ret
 
 
 
 
SEND:
     JNB TI,SEND
     CLR TI//clear  flag
MOV SBUF,A
     RET
 
 
DELAY1:MOV R6,#15
BACK:MOV TH0,#00000000B
     MOV TL0,#00000000B
SETB TR0
HERE1:JNB TF0,HERE1
     CLR TR0
CLR TF0
DJNZ R6,BACK
RET
 
 
 
 
serial_print_string: //dptr points to 0 terminated string
 
     mov A,#0
     movc A,@A+dptr ;get a char
cjne A,#0,sendchar //stop at 0
ret
sendchar:
acall SEND
inc dptr    
jmp serial_print_string
 
 
 
Serial_Init:
;Set timer 1 mode to 8-bit Auto-Reload
mov TMOD,#20H
;Enable reception
;Set Serial port mode to 8-bit UART
mov SCON,#50H
;Set baudrate to 9600 at 11.0592MHz
mov TH1,#0FDH
mov TL1,#0FDH
;Start Timer
setb TR1
CLR RI  //clear recieved flag
setb TI //set all sent
ret
 
 
 
 
lcd_init:
mov A,#38h
acall comnwrt
acall delay
mov a,#0EH
acall comnwrt
acall delay
mov a,#01h
acall comnwrt
acall delay
mov a,#06h
acall comnwrt
//acall delay
//mov a,#84h
//acall comnwrt
ret
 
 
 
end
 
 
also why cant i stimulate using this code?
shane
shane's picture
Offline
Last seen: 5 days 20 hours ago
Joined: 13/02/2017 - 14:44
same person different question

can i know can i use max232 when i use sim900d or should i only use sim900d? this is just for learning thou..just curious why i cant get...been try others tutorial and see u-tube..but still cant see..help yea.. thanks in advance.

Hari Prasaath K
Hari Prasaath K's picture
Offline
Last seen: 1 day 18 hours ago
Joined: 20/01/2015 - 23:56
proteus problem

Where do you actually face the problem in uploading the code or somewhere else.

shane
shane's picture
Offline
Last seen: 5 days 20 hours ago
Joined: 13/02/2017 - 14:44
hi Hari,
hi Hari, the lcd in the protues doesnot show any word..
Hari Prasaath K
Hari Prasaath K's picture
Offline
Last seen: 1 day 18 hours ago
Joined: 20/01/2015 - 23:56
LCD Connection

Check with the lcd connection. I could not see the clear image of it

Ashutosh Bhatt
Ashutosh Bhatt's picture
Offline
Last seen: 1 week 3 days ago
Joined: 21/12/2010 - 15:59
what u want to do exactly?

what u want to do exactly?