EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / on the protues..Please check

on the protues..Please check

|

Microcontroller › 8051 › on the protues..Please check

  • This topic has 5 replies, 3 voices, and was last updated 9 years ago by Ashutosh Bhatt.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 15, 2017 at 3:15 pm #4612
    shane
    Participant
    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?
    February 15, 2017 at 3:17 pm #14443
    shane
    Participant

    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 #14444
    Hari Prasaath K
    Participant

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

    February 16, 2017 at 1:39 am #14446
    shane
    Participant

    hi Hari,
    the lcd in the protues doesnot show any word..

    February 16, 2017 at 1:19 pm #14450
    Hari Prasaath K
    Participant

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

    February 19, 2017 at 11:31 am #14461
    Ashutosh Bhatt
    Participant

    what u want to do exactly?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • My Advanced Realistic Humanoid Robots Project March 12, 2026
  • Very Curious Issue With DS3231 RTC Clock March 12, 2026
  • Motor Getting Hot March 11, 2026
  • LM741 alternatives? March 11, 2026
  • H bridge current direction logic March 11, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise