Keil Logo Arm Logo

8051 Pulse Width Measurement Example

This example program shows how to compute the width of a pulse using timer0 in mode 1. Port 3.2 is used as an external gate for the timer. An interrupt is used to accumulate timer overflow. The width of each pulse is output to the serial port.

To test this program...

  1. Start the debugger.
  2. View the Serial window.
  3. View the Toolbox.
  4. Run the program.
  5. Click a pulse button to generate a pulse on P3.2.

The width of the pulse generated displays in the serial window each time you repeat this process.

Be sure to check the debug.ini file to see how the debugger buttons are created. A signal function is used to generate pulses.

8051_TIMER0_PULSE.ZIP (14K)
Tuesday, June 18, 2002

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

ARM’s Privacy Policy has been updated. By continuing to use our site, you consent to ARM’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.

Acquisition of ARM Holdings plc. by SoftBank Group Corp.

We are pleased to inform you that on 5 September 2016, SoftBank Group Corp. acquired ARM Holdings Plc. ARM will continue to operate as an independent business within the SoftBank group.

Any current agreements between ARM Ltd (or other ARM group companies, as applicable) you / your company remain in effect as between the parties, and the parties will continue to be bound by and perform the obligations in such agreements. If you have any queries please direct these to ARMSoftbank-Notifications@arm.com.