thx.

I'm ignorant ignorant, who moved to step 2 of the production practice, hardware design, through trial and error.

Second time this time! This is a story about designing hardware in Verilog HDL.

 

* Click here for the previous <Specifications/Board Creation>.

table of contents

Verilog HDL description (7-segment LED clock, dot matrix LED)

Things that were dangerous not to know

It was a good point to do this

Next notice

Verilog HDL Description

A hardware language that has taken a distance as good as soldering.

As expected, I will design a 7-segment LED clock (hereinafter referred to as 7seg clock) in Verilog HDL.

7seg watch

In order to make a clock, it was necessary to use an externally input clock frequency of 50MHz to create a "pulse signal at intervals of 1 second" on the FPGA.

First, I made an up-counter that operates at the clock frequency of 50 MHz that is mounted on the Cyclone ® 10 LP evaluation kit board.

Now if you count 50,000,000 then for 1 second.

I reset the counter and generated a pulse for one clock period at the same time.

If this pulse signal is used as the clock enable signal for the counter for seconds,

A counter that works in 1 second is ready!

 

Next, prepare counters for the first and second digits for the hours, minutes, and seconds.

The second and minute counters generate a pulse for one clock period when these two digits become 60.

As shown in the figure below, I used it to enable clocks for the minute and hour counters.

 

After that, depending on whether the push button is pressed or not, I let the user select which of the hours, minutes, and seconds should be displayed on the 7seg.

dot matrix LED

Applying the dynamic lighting adopted when describing the 7seg clock in Verilg HDL, using a counter, while 50000ns passes

I wrote a description to control the lighting and extinguishing of all LEDs on one dot matrix LED.

In this way, to the human eye, the illuminated areas appear to be lit at the same time!

change facial expression

Two variables were used to change the lighting pattern depending on the time on the 7seg clock and the state of the push button being pressed.

By combining two variables, we were able to create four patterns of facial expressions.

That's it, you've completed Step 2.

in retrospect...

back to table of contents

What I didn't know was crazy

1. What is a decoder?

In the previous #1 <Specifications/Board Creation>, I thought, "Well, let's go (laughs)."

Finishing the clock circuit with Verilog HDL, I thought "Yoshi! I defeated a powerful enemy!"
When I thought about assigning that output signal to a pin... Huh? how should i connect it?
For ignorant ignorant kun, what should be done after that to turn on/off the LED? mystery was.

 

When I consulted with seniors, the term "decoder" came up.

After that, I did some research on my own and when I found out that the process was completely different, I shouted, "Seriously! That's what it is!!!"

I never thought there was such a powerful item. And I didn't know that.

At that time, there was nothing but despair for myself Ozn

2. How to use dynamic lighting & case statement

In the previous #1 <Specifications/Board Creation>, how to use the 7-segment LED was dynamic lighting.

I figured it would work, but had no idea how to actually do it.

 

 

This is the conclusion that I somehow arrived at after asking Go*ru-sensei and my seniors.

For example, to display 1230, each LED must be lit as shown in the figure below.

But the 4-digit 7seg LED pin specification is not one-to-one connection with each LED, so it cannot be lit at the same time. Therefore, I decided to make the 7seg LED of each digit turn on sequentially for a certain period of time.

If you look it up on Google Sensei
It seems that the speed of blinking that can be tracked by human eyes is about 50ms to 100ms.
I set the lighting time to 10000ns.

in particular
Create a counter (cnt) that counts up 40000 times in a 1ns cycle,
I used a case statement to control it like this:

seg1 lights up from 0 ns to 9999 ns

10000 ns ~ 19999 ns seg2 is lit

seg3 lights up from 20000 ns to 29999 ns

seg4 lights up from 30000 ns to 39999 ns

[The 10000ns interval is too fast for the human eye to follow = it appears to be lit at the same time]!

I have successfully enabled dynamic lighting.

back to table of contents

Good point

There were a few things in the hardware design (step 2) that made me feel like I should have done this.

 

I should have understood the overall structure of my design (digital logic circuit)

… I wish I had written the contents of the specification document more firmly.

 

Before suddenly describing your circuit in Verilog HDL description,
I should have practiced the assignments given in the language course during the new employee training.

back to table of contents

Next time preview

Ignorance ignorance-kun, who became cautious after step 2 was immediately broken after step 1 got on track.

"I won't make the same mistake again!"

 

Next time, we will talk about software design (feat. Nios ® II).

back to table of contents