Crackler
Newbie level 1
m68hc11 code
I need some help with 2 problems for my microcontrollers class. We use the Motorola M68HC11 microcontroller. I need the code to generate a single 5ms pulse on port line PA4 and I need the code to generate 5ms pulses every 8ms on port line PA5. Something like this:
I need some help with 2 problems for my microcontrollers class. We use the Motorola M68HC11 microcontroller. I need the code to generate a single 5ms pulse on port line PA4 and I need the code to generate 5ms pulses every 8ms on port line PA5. Something like this:
One of the easiest uses of an output-compare function is to produce a pulse of a specific
duration. First, a value corresponding to the leading edge of the pulse is written
to the output-compare register. The output compare is configured to automatically set
the corresponding output either high or low, depending on the polarity of the pulse being
produced. After this compare occurs, the output compare is reprogrammed to automatically
change the output pin back to its inactive level at the next compare. A value
corresponding to the width of the pulse is added to the original output-compare register
value, and this result is written to the output-compare register. Since the pin-state
changes occur automatically at specific values of the free-running counter, the pulse
width can be controlled accurately to the resolution of the free-running counter independent
of software latencies. By repeating the actions for generating pulses, an output
signal of a specific frequency and duty cycle can be generated.