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 / Mobile Keypad in Assembly

Mobile Keypad in Assembly

|

Microcontroller › 8051 › Mobile Keypad in Assembly

  • This topic has 0 replies, 1 voice, and was last updated 12 years, 10 months ago by Rushdiey.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • March 7, 2013 at 2:22 am #2165
    Rushdiey
    Participant

    Who know how to make mobile keypad in assembly?
    All i found only in c program

     

     

     

    <code>EN EQU P1.1

    RW EQU P1.3
    RS EQU P1.2
    DP1 EQU P3.0

    ORG 00H 
    START: ACALL DELAY
    MOV R5,#28H
    ACALL COMMAND
    MOV R5,#0EH
    ACALL COMMAND
    MOV R5,#01H
    ACALL COMMAND
    MOV R5,#06H
    ACALL COMMAND
    MOV R5,#80H
    ACALL COMMAND
    ;MOV R5,#9

    ;DJNZ R5,LOOP


    ;MOV R5,#82H 
    ;ACALL COMMAND
    ;MOV R5,#9
    ;ACALL TULIS
    ;MOV R5,#0C0H
    ;ACALL COMMAND
    ;MOV R4,#’A’
    ;ACALL HURUF
    ;LOOP: 
    MOV P3,#0F0H
    SCAN: MOV P3,#0FEH
    JB P3.4, NEXT1;0
    JNB P3.4, $
    MOV R5,#’0′
    ACALL TULIS
    JMP SCAN
    NEXT1: JB P3.5, NEXT2;1
    JNB P3.5, $
    MOV R5,#’4′
    ACALL TULIS
    JMP SCAN
    NEXT2: JB P3.6, NEXT3;2
    JNB P3.6, $
    MOV R5,#’8′
    ACALL TULIS
    JMP SCAN
    NEXT3: JB P3.7, NEXT4;3
    JNB P3.7, $
    MOV R5,#’C’
    ACALL TULIS
    JMP SCAN
    NEXT4: MOV P3,#0FDH
    JB P3.4, NEXT11;4
    JNB P3.4, $
    MOV R5,#’1′
    ACALL TULIS
    JMP SCAN
    NEXT11: JB P3.5, NEXT12;5
    JNB P3.5, $
    MOV R5,#’5′
    ACALL TULIS
    JMP SCAN
    NEXT12: JB P3.6, NEXT13;6
    JNB P3.6, $
    MOV R5,#’9′
    ACALL TULIS
    JMP SCAN
    NEXT13: JB P3.7, NEXT14;7
    JNB P3.7, $
    MOV R5,#’D’
    ACALL TULIS
    JMP SCAN
    NEXT14: MOV P3,#0FBH
    JB P3.4, NEXT21;8
    JNB P3.4, $
    MOV R5,#’2′
    ACALL TULIS
    JMP SCAN
    NEXT21: JB P3.5, NEXT22;9
    JNB P3.5, $
    MOV R5,#’6′
    ACALL TULIS
    JMP SCAN
    NEXT22: JB P3.6, NEXT23;A
    JNB P3.6, $
    MOV R5,#’A’
    ACALL TULIS
    JMP SCAN
    NEXT23: JB P3.7, NEXT24;B
    JNB P3.7, $
    MOV R5,#’E’
    ACALL TULIS
    JMP SCAN
    NEXT24: MOV P3,#0F7H
    JB P3.4, NEXT31;C
    JNB P3.4, $
    MOV R5,#’3′
    ACALL TULIS
    JMP SCAN
    NEXT31: JB P3.5, NEXT32;D
    JNB P3.5, $
    MOV R5,#’7′
    ACALL TULIS
    JMP SCAN
    NEXT32: JB P3.6, NEXT33;E
    JNB P3.6, $
    MOV R5,#’B’
    ACALL TULIS
    JMP SCAN
    NEXT33: JB P3.7, SCAN2;F
    JNB P3.7, $
    MOV R5, #01H
    ACALL COMMAND
    MOV R5,#’=’
    ACALL TULIS
    SCAN2: JMP SCAN

    ;DJNZ R5, TEST
    ;TEST: LJMP LOOP




    HERE: SJMP HERE



    MOV DPTR,#0150H
    ;MOV R1,#0
    NEXT_CHAR: MOV A,#0
    MOVC A,@A+DPTR

    JZ STRING_END
    ;ACALL DELAY
    MOV R5,A
    ACALL TULIS
    ;MOV R4,A
    ;ACALL HURUF
    INC DPTR
    AJMP NEXT_CHAR



    STRING_END: SJMP $

    CLOCK: SETB EN
    ACALL DELAY_INIT
    CLR EN
    ACALL DELAY_INIT
    NOP
    RET

    TULIS: MOV A,R5
    ;ORL A,#30H
    ;ANL A,#0F0H
    MOV P1,A
    SETB RS
    CLR RW
    ACALL CLOCK
    MOV A,R5
    ;ORL A,#30H
    ;ANL A,#0F0H
    SWAP A
    MOV P1,A
    SETB RS
    CLR RW
    ACALL CLOCK
    RET

    ;HURUF: MOV A,R4
    ;ORL A,#30H
    ;ANL A,#0F0H
    ;MOV P1,A
    ;SETB RS
    ;CLR RW
    ;ACALL CLOCK
    ;MOV A,R4
    ;ORL A,#30H
    ;ANL A,#0F0H
    ;SWAP A
    ;MOV P1,A
    ;SETB RS
    ;CLR RW
    ;ACALL CLOCK
    ;RET 

    COMMAND: MOV A,R5
    ANL A,#0F0H
    MOV P1,A
    CLR RS
    CLR RW
    ACALL CLOCK
    MOV A,R5
    SWAP A
    MOV P1,A
    CLR RS
    CLR RW
    ACALL CLOCK
    RET

    DELAY: MOV R7,#0FFH
    DEL: NOP
    NOP
    DJNZ R7,DEL
    RET

    DELAY_INIT: MOV R7,#0FFH
    DEL1: NOP
    NOP
    NOP
    NOP
    NOP
    NOP
    NOP
    DJNZ R7,DEL1
    STOP: RET

    ORG 0150H
    TABLE: DB ‘0’,0

    END</code>

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

RSS Recent Posts

  • factory device from 2017'ish with web ui - too old to function with Microsoft Edge ? January 14, 2026
  • flexible copper cable January 14, 2026
  • renewed interest in old project I call it WICKED 8 January 14, 2026
  • updating circuit with power on off switching January 14, 2026
  • Steering angle sensor question January 13, 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