PULSEOUT

From MCS Wiki AVR
Revision as of 22:27, 11 February 2013 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Action

Generates a pulse on a pin of a PORT of specified period in 1uS units for 4 MHz.

 

 

Syntax

PULSEOUT PORT , PIN , PERIOD

 

 

Remarks

PORT

Name of the PORT. PORTB for example

PIN

Variable or constant with the pin number (0-7).

PERIOD

Number of periods the pulse will last. The periods are in uS when an XTAL of 4 MHz is used.

 

The pulse is generated by toggling the pin twice, thus the initial state of the pin determines the polarity.

The PIN must be configured as an output pin before this statement can be used.

 

 

See also

PULSEIN

 

 

Example


Dim A As Byte
Config Portb = Output 'PORTB all output pins
Portb = 0 'all pins 0
Do
For A = 0 To 7
Pulseout Portb , A , 60000 'generate pulse
Waitms 250 'wait a bit
Next
Loop 'loop for ever

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language