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 / qustions about 89c51 timers,8 bit value & 16 bit value in timers, use of DPTR instead of R0-R1

qustions about 89c51 timers,8 bit value & 16 bit value in timers, use of DPTR instead of R0-R1

|

Microcontroller › 8051 › qustions about 89c51 timers,8 bit value & 16 bit value in timers, use of DPTR instead of R0-R1

  • This topic has 0 replies, 1 voice, and was last updated 13 years, 9 months ago by ZOBI.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • July 25, 2011 at 12:42 pm #1223
    ZOBI
    Participant

    can any body tell me that can i use DPTR to store value of 16 bit tmer value,

     

    basically i want to save 16 bit timer value  and then i will use that value to compare with other values but problem is all the registers in 89c51 are 8 bit register and my timer value will come in 16 bit so is that possible to use DPTR to store that value because DPTR is 16 bit register for e.g.

     

    mov DPL,TL0          ;save the TL0 values to lower DPTR portion
    mov DPH,TH0         ;save the TH0 values to upper DPTR portion

     

    if it is not possible then tell me

     

     

    that is that possible when 16 bit value comes then i will divide that value by 2 and then save it in any 8 bit register (R0-R1) for e.g.

     

    1) divide lower value of timer 0 (i.e. TL0) by 2 and save it to accumulator “A”

    2) divide upper value of timer 0 (i.e. TH0) by 2 and then ADD it to accumulator “A”

    3) Now total value in will become 8 bit value then i will use it for further process

     

    if still is is also not possible then tell me another way to use that 16 Bit value

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

RSS Recent Posts

  • LED circuit for 1/6 scale diorama May 15, 2025
  • stud mount Schottky diodes May 15, 2025
  • Hi Guys May 15, 2025
  • using a RTC in SF basic May 14, 2025
  • Can I use this charger in every country? May 14, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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