Programming FPGA boards in Verilog with TINACloud

Programming FPGA boards in Verilog with TINACloud

In our other videos, we have shown how you can create a digital circuit and download to an FPGA board by using TINACloud’s Schematic Editor: (Programming FPGA boards with TINACloud using Schematic Design Entry)

and the VHDL hardware description language: (Programming FPGA boards in VHDL with TINACloud).

Now, in this video tutorial, our circuit, a full adder, will be based on the Verilog hardware description language.

The textual description of the hardware greatly enhances portability and reusability. By using hardware description languages describing the fundamental operations, structures and connections, virtually any logical circuit can be defined.

As we stated earlier, TINACloud works with schematics, but we can also place HDL macros, including VHDL and Verilog, in the design.

First we will test our circuit with Verilog circuit simulation in TINACloud.

The circuit operates like a half adder while Carry_In value is low.
  • When both inputs are low while Carry_In is also low, then Sum and Carry_Out are also low.
  • When just one input is low while Carry_In is low, then Sum is high and Carry_Out is also low.
  • When both inputs are high when Carry_In is low, then Sum is low and Carry_Out is high.
Now, let’s see what happens when Carry_In is high.
  • When Carry_In is high while both inputs are low, then Sum is high too and Carry_Out is low.
  • When Carry_In is high while only one input is high, then Sum is low and Carry_Out is also high.
  • When Carry_In is high while both inputs are high, then Sum and Carry_Out are also high.

If Carry_in is high, then the output values change as if we had added one to the full adder.

Next we will export the Verilog to the Xilinx Vivado software, compile it and load the resulting bitstream into the Basys 3 FPGA development board.

Finally we will present how our simulated full adder circuit works along with the programmed Basys 3 hardware and show  that in all cases, the results are exactly the same.

Check our other video “Programming FPGA Boards in VHDL with TINACloud”, where we use a Verilog component in FPGA design.

To learn more please click  here.

You can learn more about TINA here: www.tina.com

You can learn more about TINACloud here: www.tinacloud.com

Programming FPGA boards in VHDL with TINACloud

Programming FPGA boards in VHDL with TINACloud

In our other videos, we have shown how you can create a digital circuit and download to an FPGA board by using TINACloud’s Schematic Editor. (Programming FPGA boards with TINACloud using Schematic Design Entry) and the Verilog hardware description language (Programming FPGA boards in Verilog with TINACloud).

Now, in this video tutorial  our circuit, a full adder, will be based on the VHDL   hardware description language.

As we stated earlier, TINACloud works with schematics, but we can also place HDL macros, including VHDL and Verilog, in the design.  

Now, let’s see an example, a full adder using the half-adder VHDL macros.

 Start TINACloud, then open the Full_Adder_VHDL.tsc from the TINA Examples folder.

Most digital circuits that perform addition or subtraction use full adder. This combinational circuit adds two binary digits and a carry-in to produce a sum and carry-out. This one-bit full-adder cell has three inputs (A, B, Carry_In) and two outputs (Sum, Carry_Out) by applying a half adder to accept the carry-in (Carry_In) input from the previous less-significant stage of a multiple bit adder. 

The circuit operates like a half adder while the Carry-In value is low. 

Start the simulation by pressing the Dig Interactive button. 

  • When both inputs are low while Carry_In is also low, then Sum and Carry_Out are also low. 
  • When just one input is low while Carry_In is low, then Sum is high and Carry_Out is also low. 
  • When both inputs are high when Carry_In is low, then Sum is low and Carry_Out is high.

Now, let’s see what happens when Carry_In is high.

  • When Carry_In is High while both inputs are low, then Sum is high too and Carry_Out is low. 
  • When Carry_In is High while only one input is high then Sum is low and Carry_Out is also high. 
  • When Carry_In is High while both inputs are high then Sum and Carry_Out are also high. 
If Carry_In is high, then the output values change as if we have added one to the full adder. 

In the following we will test our circuit in a real environment using the Digilent Basys 3 Artix-7 FPGA Trainer Board. 

As it can be seen, this circuit is already prepared for the FPGA Tool export. 

(See our previous video: Programming FPGA boards with TINACloud using Schematic Design Entry

In the following we will show how to  generate the source file for Xilinx Vivado 

Finally we will present how our simulated full adder circuit works along with the programmed Basys 3 hardware.

As you can see, in all cases, the results are exactly the same.

This is a great example of demonstrating the power of simulation, since you can test and debug circuits even before realizing them, and in our case before downloading to FPGA, where if there were any issues, it would be extremely hard to find the problem.

Check our other video “Programming FPGA Boards in Verilog with TINACloud”, where we use a Verilog component in FPGA design.

To learn more please click  here.

You can learn more about TINA here: www.tina.com

You can learn more about TINACloud here: www.tinacloud.com

Shields, Breakout Boards and Modules in TINACloud

Shields, Breakout Boards and Modules in TINACloud

Shields, Breakout Boards and Modules in TINACloud

Nowadays, there are many opportunities to extend the capabilities of a microcontroller board, for example, shields, breakout boards and modules. All of these are open-source hardware, which means that the boards have detailed descriptions, schematics, PCB files, hookup guides and examples.

In this video, we will explain what these hardware devices are and how to use them with an Arduino Uno in TINACloud.

Arduino Shields

Arduino shields are boards that can be plugged on top of Arduino boards. They have the same pinout as the main board, and these pin names are represented on the PCB. The different shields have different capabilities (DC motor control shield, relay shield, LCD shield, etc.). Using them is time and cost effective.

Breakout Boards

The basic concept of breakout boards is to use just a single electrical component on each board. The pins of the component are wired out, and their names are represented on the board. This concept allows for easy usage and reusability. Breakout boards are usually smaller than shields. Usually, a breakout board represents a small functional circuit. These can be sensors, drivers, displays, etc. Breakout boards can be used with any microcontroller.

Modules

Some manufacturers produce breakouts that use the same x-pin header or connector on every board. These breakout boards are called modules.

You can place shields, breakout boards and modules in TINACloud from TINACloud’s Logic ICs-MCUs toolbar.

Let’s see how some of these examples work.

4 Relays Shield

The 4 Relays Shield provides a solution to control high power loads that cannot be controlled by the Arduino itself because of the limitations of the digital IO-s. The 4 Relays Shield has four relays, which are 2-pole changeover contacts in order to increase the current limit of the output. The main advantage of the Arduino system is that with the following simple program, which is included in the example, we can operate the relays and light up the LEDs sequentially.

Click the TR button to start the simulation. As expected, the LEDs light up one by one and then turn off one by one. Now let’s see how this looks with the real hardware.

LCD keypad shield

Open the next example, “LCD keypad shield-Arduino Uno.tsc,” from the same folder.

The Arduino LCD shield is fit for the Arduino Uno board. It contains a 16×2 LCD display and six momentary push buttons. Pins 4, 5, 6, 7, 8, 9 and 10 are used to interface with the LCD. Analog pin 0 is used to read the five push buttons.

The next example is a module example. You can find it in the Grove Modules folder in TINACloud.

Grove LED module

The Grove – LED module contains an LED light source. In addition, it has a potentiometer on-board to manage the power requirements of the LED.

Our last example is a breakout board example. Open it from the SparkFun Breakouts folder.

SparkFun 74HC595 Breakout board

The SparkFun 74HC595 breakout board contains the SOIC version of the 74HC595 shift register IC. The pins of the IC are wired out and marked on the board. The serial in and out pins are located on the opposite side of the board to allow easy chainable functionality.

The code will write the word HELLO sequentially on the 8-segment display.

In this video tutorial, we demonstrated two basic shields, a module and a breakout board for Arduino. Stay tuned to our YouTube channel to learn more about Arduino and its accessories.

To learn more please click  here.

You can learn more about TINA here: www.tina.com

You can learn more about TINACloud here: www.tinacloud.com

Programming FPGA Boards with TINACloud using Schematic Design Entry

Programming FPGA Boards with TINACloud using Schematic Design Entry

In this tutorial video we will show how to create a digital circuit and download it to a Digilent Basys 3 FPGA board by using TINACloud’s Schematic Editor.

In a similar way it is also possible to download digital circuits to the FPGA of DesignSoft’s LabXplorer.

The schematic design may contain gates or other built-in digital components in TINACloud. Also it may contain macros defining digital components with hardware description languages such as VHDL or Verilog.

In this video, we use a free Xilinx tool, Vivado, which is required for the FPGA in Digilent Basys 3.

As demonstration we use a half adder circuit which you can find in the Example folder of TINACloud.

Getting ready to test the circuit in real FPGA development board environment

Before testing our circuit in a real FPGA development board environment, we need to extend our schematic with FPGA Pin connectors. We add 2 Pin connectors to the inputs and 2 Pins to the outputs.

Next, we rename the FPGA input and output Pins (including their labels) accordingly as those on the FPGA boards.

Next, we present how to generate the source file for Xilinx Vivado.

Note that TINACloud always creates  vhd file from any type of
representation of the digital circuit. That is, schematic diagrams, VHDL, Verilog codes or their mix are always translated into a vhd file for Vivado.

The xdc – Xilinx Design Constraints – guides the Xilinx software on which physical pins on the FPGA will be the inputs and outputs. The xdc is made from the FPGA pin settings we made previously.

Creating the Vivado project and programming the hardware

Next, we need to create the Vivado project to produce downloadable content.

As soon as we finish programming the hardware we can start testing our simulated Half Adder circuit and see how it works along with the programmed Basys 3 hardware.

We will change the virtual switches in TINACloud by clicking them on the screen, and at the same time we will also change the real switches on the Basys 3 board.

  • If both inputs are low, then Sum and Carry are also low. 
  • If just one input is high, then Sum is high and Carry is low.
  • If both inputs are high, then Sum is low and Carry is high.

As you can see, in all cases the results are exactly the same.

This is a great example of demonstrating the power of simulation since you can test and debug circuits even before realizing them, and in our case before downloading to FPGA, where if there were any issues it would be extremely hard to find the problem.

To watch our tutorial and learn more please click  here.

You can learn more about TINA here: www.tina.com

You can learn more about TINACloud here: www.tinacloud.com

How to use the Virtual Oscilloscope in TINACloud? (updated version)

How to use the Virtual Oscilloscope in TINACloud? (updated version)

In this tutorial we will demonstrate how to use the virtual oscilloscope in TINACloud.

In practice we very often use an oscilloscope to measure, analyze and debug circuits in the time domain. So, it seems obvious that a simulated oscilloscope can be used in circuit simulation as well. However there are a few important things you must know about.

Even if you analyze the circuits in the computer with a simulated oscilloscope it is still simulation. You should not consider it as measurement, unless you use real time data acquisition for obtaining the data.

The simulated oscilloscope is very useful when you want to adjust some component values of small circuits and want to see the effect of the changes immediately, in order to fine-tune your circuit.

We present the use of the virtual oscillator through an example: Collpitts Oscillator circuit.

  • First load the Colpitts.tsc circuit from the TINA Examples folder of TINACloud.
  • Next invoke the Oscilloscope from the T&M menu,
  • then press the Run button.

As a result , the Out1 signal appears. By default, the oscilloscope is in the “Auto” i. e., free running mode.

To get a steady state image you should enable triggering as follows:
  • Set the Trigger Mode to Normal
  • next, set Trigger Source to Out1
  • finally, set the Trigger Level to 300m.

Consequently, the waveform is stabilized.

With the controls of the Oscilloscope you can make a lot of changes on the displayed waveform.

Here are a few:

By default, on the Oscilloscope rising edge triggering is used, so the display starts when the signal rises above the Trigger level.

  • You can also set this to falling edge triggering where the display starts when the signal falls below the Trigger level.
  • You can also bring in the Vout signal by selecting Vout under Channel

Let’s have the same vertical settings for Vout as for Out1.

  • Finally, you can export the display into a diagram by pressing the Export to Diagram button under Data.

To watch our tutorial and learn more please click  here.

You can learn more about TINA here: www.tina.com

You can learn more about TINACloud here: www.tinacloud.com