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 / 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 13 years, 2 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

  • Please confirm monostable does not need reset? December 15, 2025
  • Multiple photodiodes for single ADC read December 15, 2025
  • Bringing a Siemens W-48 and Ericsson Model 1951 back to life December 15, 2025
  • Hitachi SuperScan Elite 802 CRT Monitor Issues (Model CM802U) December 15, 2025
  • Sound not working on Laptop December 15, 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