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
You are here: Home / Topics / How to count milliseconds with PIC18F4550?

How to count milliseconds with PIC18F4550?

|

Microcontroller › PIC › How to count milliseconds with PIC18F4550?

  • This topic has 1 reply, 2 voices, and was last updated 9 years, 10 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 20, 2012 at 3:26 pm #1959
    Alisson
    Participant

    Hi,

     

    I need a way to calculate the time in milliseconds. I’ve been tried to work with the PIC’s Timers but I don’t understood.

    But I also need a way to stop and restart the countage: stop when an event occurs and restart when that event stop.

    I heard that the interrupts plays a role in cases like this, but I don’t know how to use them.

     

    Please, any suggestion is very helpful.

    Thanks for your time (literally).

    September 25, 2012 at 6:48 pm #8615
    AJISH ALFRED
    Participant

    Hi Alison,

    Try these algorithm for your “stop when an event occurs and restart when that event stop”

     

    1) Configure external interrupt as positive edge triggered

    2) Enable external interrupt

    3) When interrupt occurs do the step 4) to 7)

    4) In interrupt ISR, disable the external interrupt

    5) Reconfigure the external interrupt as negative edge triggerd

    6) Enable external interrupt again

    7) If the count is stopped already, then restart count, otherwise stop the count

     

    There is a lot to learn about interrupts, ISR and how to implemnt them in your microcontroller.

     

     

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

RSS Recent Posts

  • Looking for amplifier ic August 12, 2022
  • alternate of 80386/486 microprocessor August 12, 2022
  • Trying to troubleshot 1960s Panasonic transistor radio August 12, 2022
  • Company name: any suggestions? August 12, 2022
  • uc3843 Buck-boost August 11, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

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