Microcontroller › 8051 › on the protues..Please check
- This topic has 5 replies, 3 voices, and was last updated 7 years, 9 months ago by Ashutosh Bhatt.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
February 15, 2017 at 3:15 pm #4612shaneParticipantORG 0000Hjmp startMessage1:db 'AT',13,0Message2:db 'AT+CMGF=1',13,0Message3:db 'AT+CNMI=2,1,0,0,0',13,0Message4:db 'AT+CMGR=2',13,0BUFFERLIMIT equ 16byteCount equ 20hbufferIn equ 21h //store incoming textstart:call serial_Initcall lcd_initmov byteCount,#0MOV r0,#bufferIn //buffer for messages//start mobilemov dptr,#Message1 ;address first messagecall serial_print_string //send messageACALL DELAY1mov dptr,#Message2 ;address first messagecall serial_print_string //send messageACALL DELAY1mov dptr,#Message3 ;address first messagecall serial_print_string //send messageACALL DELAY1mov dptr,#Message4 ;address first messagecall serial_print_string //send message//Wait for serial input ending 'X'H1:JNB RI,H1 //wait for charCLR RIMOV A,SBUF //get and store in bufferMOV @R0,Amov A,byteCountCJNE A,#BUFFERLIMIT,roomleft //check we have roomMOV @R0,#'X' //terminate stringjmp DISPLAY //print what we haveroomleft:MOV A,@R0 //recover charinc byteCountINC R0CJNE A,#'X',H1 //wait for X to end messageDISPLAY:MOV r0,#bufferIn //back to startdis:MOV A,@R0cjne A,#'X',Hwait:sjmp wait //stop at XH:acall datawrtacall delayinc r0sjmp dis //next charcomnwrt:mov P1,aclr P2.0; For commandclr P2.1 ;for writesetb P2.2 ; E=1 for high pulse//acall delayclr P2.2 ;H-to-L pulseretdatawrt:mov P1,asetb P2.0 ;for dataclr P2.1 ;for writesetb P2.2 ;E=1 for high pulse//acall delayclr p2.2 ; H-to-L pulseretdelay: mov R3,#50here2:mov R4,#255here:djnz R4,heredjnz R3,Here2retSEND:JNB TI,SENDCLR TI//clear flagMOV SBUF,ARETDELAY1:MOV R6,#15BACK:MOV TH0,#00000000BMOV TL0,#00000000BSETB TR0HERE1:JNB TF0,HERE1CLR TR0CLR TF0DJNZ R6,BACKRETserial_print_string: //dptr points to 0 terminated stringmov A,#0movc A,@A+dptr ;get a charcjne A,#0,sendchar //stop at 0retsendchar:acall SENDinc dptrjmp serial_print_stringSerial_Init:;Set timer 1 mode to 8-bit Auto-Reloadmov TMOD,#20H;Enable reception;Set Serial port mode to 8-bit UARTmov SCON,#50H;Set baudrate to 9600 at 11.0592MHzmov TH1,#0FDHmov TL1,#0FDH;Start Timersetb TR1CLR RI //clear recieved flagsetb TI //set all sentretlcd_init:mov A,#38hacall comnwrtacall delaymov a,#0EHacall comnwrtacall delaymov a,#01hacall comnwrtacall delaymov a,#06hacall comnwrt//acall delay//mov a,#84h//acall comnwrtretendalso why cant i stimulate using this code?February 15, 2017 at 3:17 pm #14443shaneParticipant
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.
February 15, 2017 at 4:18 pm #14444Hari Prasaath KParticipantWhere do you actually face the problem in uploading the code or somewhere else.
February 16, 2017 at 1:39 am #14446shaneParticipanthi Hari,
the lcd in the protues doesnot show any word..February 16, 2017 at 1:19 pm #14450Hari Prasaath KParticipantCheck with the lcd connection. I could not see the clear image of it
February 19, 2017 at 11:31 am #14461Ashutosh BhattParticipantwhat u want to do exactly?
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.