Close
0%
0%

Hex logic signal generator w/ AVR128DB28

A 6-channel pulse and level generator with debouncing

Public Chat
Similar projects worth following
59 views
0 followers
The Hex Logic Level Generator uses all of the AVR128DB28’s IO-pins in the prototype-friendly 28-pins DIL package.
This construction goes hand in hand with the Hex Logic Detector project.

Features
-Six logic channels, each provided with a “trigger” button (TRIG)
-Static levels. TRIG can either toggle the level or work as (debounced) momentary switch
-Single pulses. A pulse is emitted when TRIG is pressed
-Free-running square waves. TRIG sets start phase of each channel
-Free-running pulse trains distributed over the channels, separated or overlapped
-Logic output levels displayed by red and green LEDs
-Supply voltage (and logic level) span: 2.5 – 5.0 V (UB – MCU and channels 3, 4 & 5)
-Three channels can operate at different voltage: 1.65 – 5.0 V (UA – channels 0, 1 & 2)
-System resets when primary supply voltage is too low (UB < 2.45 V)
-Indicator for insufficient secondary supply voltage (UA < 1.65 V)


Mode switches

Function

#

Set
Run

Level
Pulse

Single
Rep

Slow
Fast

Description

Action when pressing a TRIG button

1

Set

-

-

-

Set the INACTIVE level for each channel

Toggle the INACTIVE level of the channel
Each output follows the chosen INACTIVE level

2

Run

Level

Single

-

Output static levels
(INACTIVE level while TRIG is not pressed)

Change output to ACTIVE level while  TRIG is pressed

3

Run

Level

Rep

Slow

Square wave, 50 % duty cycle. Repetition period: 2 seconds. (f = 0.5 Hz)

Fire a single ACTIVE pulse when TRIG is pressed

4

Fast

Square wave, 50 % duty cycle. Repetition period: 10ms. (f = 100 Hz)

5

Run

Pulse

Single

Slow

Slow (1 millisecond) pulses on demand

Pressing TRIG restarts the waveform
(for this channel)

6

Fast

Fast (1 microsecond) pulses on demand

7

Run

Pulse

Rep

Slow

Train of overlapping, slow pulses (PW = 200 μs).
Each channel emits one pulse, delayed 100 μs withrespect to the previous.
Repetition period: 2 seconds. (f = 0.5 Hz)

TRIG sets start channel of the pulse train
(Channels wrap around from 5 to 0)
This also restarts the pulse train

8

Fast

Train of separated, fast pulses (PW = 1 μs).
Each channel emits one pulse,  delayed 2 us with respect to the previous.
Repetition period: 2 seconds. (f = 0.5 Hz)

Comments to the mode table

Trigger switch signals are debounced. In mode 2, for instance, minimum pulse width is 75 ms; in mode 5 & 6, the

minimum interval between pulses is 75 ms. (No matter how fast the trigger is tapped.)
The toggle switches are also debounced.
Modes 3, 4, 7 and 8 waveforms restart when entering these modes. Flipping the Set/Run (or Single/Rep) switch thus
provides a crude synchronization method.
Square waves (mode 3 & 4) are just slightly out of sync when entering these modes. The square waves are started in
channel order with around 2 μs between consecutive channels.
Pressing TRIG in mode 3 or 4 restarts the square wave for the channel involved. The start level is the channel’s
ACTIVE level. (For the “fast” square wave, all you can hope to accomplish with this is some random phase shift.)
The phase shifts between channels in mode 3 & 4 are not remembered after switching to another mode.
Pressing TRIG in mode 7 or 8 will immediately restart the pulse train with the (new) start channel first. This is always
the case, even if the start channel doesn't change its level.
The start channel for mode 7 & 8 is remembered when switching to another mode.
In mode 7, only neighbour channels have overlapping pulses. There is guaranteed to be a small gap (1-2 μs) between
e.g. the end of the pulse in channel 0 and the start of the pulse in channel 2. (Channels 5 and 0 are neighbours if
channel 0 isn’t the start channel.)
All times are approximate. Timing is performed in software and is subject to small amounts of jitter.

Behaviour when keeping one or more TRIG buttons pressed while changing mode in undefined.


Please visit the project web site (link to the left, below images) for a full description, including schematics and source code.

  • 1 × AVR128PB28 28-pin DIL package (any AVR DB processor is fine)
  • 6 × Momentary SPST push-buttons (Trigger buttons)
  • 4 × SPST toggle-switches (Mode switches)
  • 6 × Red LED, Ø 3 mm
  • 6 × Green LED, Ø 3 mm

View all 11 components

  • Bugfixes

    Henning Schou04/26/2022 at 14:41 0 comments

    Oops...

    Just discovered inconsistences regarding the labeling of mode switches, the table describing the different modes and the firmware.

    - Will update when it is fixed.

    2022-04-26: Inconsistencies are fixed now /HS

View project log

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates