Microbit Ring Oscillator

by Gammawave in Circuits > Microcontrollers

329 Views, 0 Favorites, 0 Comments

Microbit Ring Oscillator

title.png

In a previous Instructable Microbit PLD I described how a Microbit can be used to emulate the basic logic functions.

Using the same code without any modification you can create a Ring Oscillator.

This simply entails connecting the output of the NOT function back to its input whereupon it self oscillates.

Supplies

Microbit V1 or V2

Ring Oscillator

not1.png
ring.png
default_ring_2.png

A ring oscillator consists of an odd number of NOT gate(s), connected in a ring configuration with the output connected back to the input.

A single NOT gate constitutes an odd number.

An even number of gates would not work as a ring oscillator as the operation relies on the output being in the opposite state to the input. For an even number of gates the output would be in the same state as the input.

If the assumption is made that the input is low (0) the gate which is made up of the code running in a loop takes a finite time to read the digital input, process this and output the digital inversion, logic 1 (H).

The output is a square wave with alternating high (~3V), and low (0V), states being the inversion of the input with the vertical edges being the transition between states.

The time period of each half of the square wave is equal to the time delay (Td), through the gate.

Including more NOT gates (N), increases the overall time delay in the ring and a lower oscillation frequency.

The frequency = 1/(2NTd) where N = number of gates, & Td =Time delay,

The default frequency for Microbit, V1 = ~21Hz, V2 = ~25Hz

The frequency can be changed by varying the cycle time within the code and hence the time delay (Td).

A 1Hz ring oscillator is shown in the next step this complements the higher frequencies implemented in the previously published Microbit pulse generators, Variable & Stepped ranges.

1Hz Ring Oscillator

ring_osc.png
1Hzring_screenshot.png
1hz_ring.PNG

Simplifying the code to just contain the NOT function and a suitable time delay a ~1Hz ring oscillator is created.

Adjustment of the time delay can be accomplished by increasing or reducing the pause time should it be necessary due to variations between Microbits.

The LED at co-ordinate 2,2 flashes on and off according to the time delay for each output state.

Finally

Hope you found this addition to the previous projects informative and useful.