Thursday, November 17, 2011

Informative and Nice FPGA Tutorial for beginners

Posted by Omkar on May 20, 2009

I stumbled upon following FPGA Tutorial while surfing the web. It is great for beginners, who don’t know what FPGAs are. This Tutorial covers basic concepts of PLDs,CPLDs and FPGAs. It then gives overview of internal architecture of FPGA. Tutorial also gives overview about design considerations, use of Xilinx tools. In short it covers all basics of FPGAs based design flow using Xilinx FPGAs and software tools.

Click here to watch.

Be the first to like this post.This entry was posted on May 20, 2009 at 10:28 am and is filed under Programmable Logic. Tagged: FPGA Tutorial. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

EAGLE Library – List of most commonly used electronics components

Posted by Omkar on October 9, 2009

12 Nov 2009 – Post Updated

EAGLE is preferred by many hobbyists and professionals all over the world. EAGLE comes with huge component library, however to find the desired part in this library is really difficult for beginners. Generally we need resistors, capacitors, voltage regulators, pin headers, connectors, etc when designing any electronic PCB. Following is the list of EAGLE library part names of most commonly used electronics components. This list will be very handy when you have just started using the EAGLE and don’t know which part to select and from which library.

Passive components:

PH_1X8

Ceramic disc capacitors
having 2.54mm lead spacing
(e.g.: 27pf, 100nf)

CAP-003D

Ceramic disc capacitors
having 5.08mm lead spacing
(e.g.: 220nf)

cap-2

Electrolytic capacitors, values less than 10uF and voltage rating upto 50V

10 uf electrolytic capacitor 220ufCaps XTAL_HC49-Ub 32768 Xtal

78xx Voltage regulator – Vertical

7805 1n5408-diode Pot-3296 PH_2X1J PH_2X2J ARK_5MM_2 ARK_5MM_3 Button Buzzer micro_switch Mini Slide Switch

D type 9 pin Serial connector, PCB Mountable

D9_PCB_conn

Passive components SMD:

LL4148 BC847

Be the first to like this post.This entry was posted on October 9, 2009 at 11:18 pm and is filed under Electronics. Tagged: component library, EAGLE, Electronic Components, library. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

AVR fuse bits settings

Posted by Omkar on April 3, 2010

Setting AVR fuse bits correctly is most important and equally confusing part for many beginners. In this post I have presented some of the ready to use fuse bit settings and corresponding batch files, which can be used with AVRdude.

Link for downloading avrdude batch files (to be used with USBasp) is given at the end of this post.


Factory Default Settings for ATmega16/32.

H fuse:
JTAG            : Enabled
OCD             : Disabled
SPI Programming : Enabled
CKOPT           : Unprogrammed
EEPROM Preserve : Unprogrammed (EEPROM not preserved)
BOOT size       : 1024 words
Reset Vector    : User flash code

L fuse:
Brown-out level : 2.7V
Brown-out detect: Disabled
Startup timing  : Default
Clock Source    : Internal, 1MHz

External Crystal upto 16MHz, JTAG disabled. Rest of the options : Default.Internal 8MHz oscillator, JTAG disabled. Rest of the options : Default.
Factory Default Settings for ATmega8.

H fuse:
Reset Disabled  : Unprogrammed (Reset pin is enabled)
Watchdog        : Off
SPI Programming : Enabled
CKOPT           : Unprogrammed
EEPROM Preserve : Unprogrammed (EEPROM not preserved)
BOOT size       : 1024 words
Reset Vector    : User flash code

L fuse:
Brown-out level : 2.7V
Brown-out detect: Disabled
Startup timing  : Default
Clock Source    : Internal, 1MHz

External Crystal upto 16MHz. Rest of the options : Default.Factory Default Settings for ATtiny13.

H fuse:
Self programming: Disabled
debugWire       : Disabled
Brown-out detect: Disabled
Reset Disabled  : Unprogrammed (Reset pin is enabled)

L fuse:
SPI Programming : Enabled
EEPROM Preserve : Unprogrammed (EEPROM not preserved)
Watchdog        : Off
Clock div by 8  : Enabled
Startup timing  : Default
Clock Source    : Internal, 9.6MHz

Internal 4.8MHz oscillator, Divide clock by 8. Rest of the options : DefaultInternal 9.6MHz oscillator, clock is not divided by 8. Rest of the options : Default.

Fuse programming is most crucial and any mistake might lead to non-functioning AVR controller. I have also made DOS batch files, which can be used to apply above mentioned settings with AVRdude and USBasp. You can download these files from :

AVR Dude – DOS batch files for fuse bit settings using USBasp. Archive password : mega16

http://www.megaupload.com/?d=S9BCR2RJ

Be the first to like this post.This entry was posted on April 3, 2010 at 7:43 pm and is filed under AVR microcontroller. Tagged: AVR Micocontroller, avrdude, Fuse bits. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

2010 in review

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads Wow.

Featured image

The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 130,000 times in 2010. If it were an exhibit at The Louvre Museum, it would take 6 days for that many people to see it.

In 2010, there were 3 new posts, growing the total archive of this blog to 36 posts. There were 77 pictures uploaded, taking up a total of 5mb. That’s about 1 pictures per week.

The busiest day of the year was March 5th with 570 views. The most popular post that day was How to make simple Infrared Sensor Modules.

The top referring sites in 2010 were sonsivri.com, ashishd.wordpress.com, google.co.in, robotix.in, and roboticsindia.com.

Some visitors came searching, mostly for infrared sensor, ir transmitter and receiver, usbasp driver, led cathode, and usbasp.

These are the posts and pages that got the most views in 2010.

How to make simple Infrared Sensor Modules February 2008
184 comments

AVR : Tutorial 2 : AVR – Input / Output February 2008
45 comments and 1 Like on WordPress.com,

Make your own, ultra simple, universal AVR programmer !! October 2007
95 comments

AVRDude Tutorial : Burning hex files using USBasp and AVRdude April 2009
7 comments

Anode and Cathode of LED ! March 2008
14 comments

Be the first to like this post.This entry was posted on January 2, 2011 at 11:13 pm and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

Alert: Using RealView MDK 3.22 ? Switch to latest version

Posted by Omkar on July 11, 2009

I recently started working on ARM controllers. I have been using RealView MDK 3.22. However I noticed that, when I was trying to run my simple program involving UART peripheral, it was getting compiled but was not running when downloaded on uC.

The same program started working when I downloaded MDK 3.7. So if your programs are driving you nuts because of some strange reasons, which you are not able to figure out, then update to latest version.

Be the first to like this post.This entry was posted on July 11, 2009 at 10:23 pm and is filed under ARM. Tagged: ARM, RealView MDK. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

AVR Development Board – mega16

Posted by Omkar on March 25, 2008

AVR Development Board
Low Cost AVR Development Board – ATmega16 / ATmega32v4.1IMG_0866-m16-B

28 April 2011 – Prices updated

Board Features :

supports : mega16A/32A AVR uC. With easy to use ZIF socket.Pins headers are provided for all ports of uC, so that any signal can be tapped and board’s functionality can be extended.slot for crystal, so it can be changed. Default crystal 16MHz.LCD connector on PORTB with contrast control pot. 8 LEDs are also connected on PORTB for debugging purpose.On Board TSOP 1738 on PORTC.6, thus one can use remote control and get benefit of 30keys at the expense of single microcontroller pin.MAX232 provided for serial interface with PC.Two L293D motor driver ICs. Each one has 4 H bridges and capacity of 500mA per bridge. This can be used for driving 4 DC motors or 2 Stepper motor.One of the two L293D IC, is connected to PWM out pins (OC1A,OC1B). This can be used for motor control using PWM.Separate voltage regulator is provided for L293D. This helps you to provide any customary voltage to load.6 Voltage dividers for 6 ADC inputs. Helps you to measure almost any voltage levels even in excess of 5V. Best for robotics infra-red sensors.4 Tact switches(buttons) for user input.One Speaker for audio generation. By default connected on PORTC.6, but jumper can be opened and then speaker can be connected to any other pin using external wire.SPI bus connector with on board 3.3V supply generation. So that you can easily interface MMC/SD cards / flash memories or any other SPI device to uC.Supports In System Programming (ISP) using cable provided. PonyProg2000 can be used for burning programs into uC.NO SMD COMPONENTS. So that you can replace any component on the board with your desired ones.

Board Accessories:

In System Programming cable. Connects to printer port of PC.Serial cable, to connect to SERIAL port of PC.

FREE CD:

Contains…
- Evaluation version of CodeVisionAVR C compiler.(Supports upto 2KB of hex code).
- WinAVR Compiler
- Eclipse IDE with WinAVR plug-in
- PonyProg2000. For burning your hex files into microcontroller.
- Easy to understand and well commented sample programs.
- Datasheets of all components.
- Other useful resources like ATMEL’s application notes, etc.

USES :

- Best for project development.
- Best for autonomous robotics.
- For embedded system product development. In ready to ship projects, blank PCB can be ordered and only required components can be soldered.

PRICING:

UPDATE : 22 Dec 2010 :
Due to recent increase in electronics component prices and manufacturing costs, I have to increase the prices to sustain the activity. Still today, these boards are the cheapest ones compared to features and prices of other similar products.

IMG_0865-m16-0IMG_0864-m16-AIMG_0866-m16-BIMG_0867-m16-CIMG_0870-m16-DIMG_0868-m16-EIMG_0869-m16-F

** Board with custom combination of components, other than mentioned in above list, are also available.
* For board with ATmega32, add 50/- to above cost.
^ 10% or more, discount on the regular price will be given for students depending on the order quantity.

NOTE :
-  Shipping and handling charges will be from Rs. 90 to Rs. 150 depending on the location within India.
- Tutorials for C programming for AVR are not provided. However many sample programs are provided. They are easy to understand and self explanatory.

How to Buy :

- Drop me a mail at elecrom [a t] gmail [ d o t ] c o m

Snaps :

IMG_0867-m16-C

mega16_board_Info_CARD_v4_1


Protected under Creative Commons – Attribution Non-Commercial No Derivatives Works 2.5:
Creative Commons License
(Link for only Indian version of the license is given. If you are not from India, kindly refer to legal code of the license of respective country)

Be the first to like this post.This entry was posted on March 25, 2008 at 11:57 pm and is filed under AVR microcontroller, My Products. Tagged: ATmega16, Atmel AVR microcontroller, AVR Development Board, Development Board, embedded. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

USBasp tutorial: USBasp driver installation

Posted by Omkar on April 19, 2009

In this post we will see how to install windows driver for USBasp. Steps explained below are applicable for WindowsXP:

Download driver:

If you don’t have driver, windows drivers for USBasp can be downloaded from:
http://www.fischl.de/usbasp/usbasp.2009-02-28.tar.gz

Extract the downloaded archive into some directory.

Installing driver:

Step1:
Connect USBasp to USB port of your computer. New hardware found dialog box will appear.
-In this select ‘Install from a list or specific location’.
-Click ‘Next’.

step1

Step2: 
- Select ‘Don’t search …’
- Click Next

step2

Step3:
- Click ‘Have Disk’

step3 

Step4:
‘Install from disk’ dialog box will appear.
- Click ‘Browse’

step4

Step5:
Now browse for ‘usbasp.inf’ file. This fill will be located in : \bin\win-driver.
- Browse and select the file and click ‘Open’.
- Click ‘OK’ to close the ‘Install from disk’ dialog box

step5

Step6:
Now you should see ‘USBasp’  model list.
- Select ‘USBasp’ from model list.
- Click ‘Next’

then windows will install the given driver.

step6 step7

Now your USBasp is ready for use.

To know how to use AVRdude and USBasp for writing hex files into microcontroller see the following post :
AVRDude Tutorial : Burning hex files using USBasp and AVRdude

Be the first to like this post.This entry was posted on April 19, 2009 at 6:37 pm and is filed under AVR microcontroller, Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

Mega16 Development Board : Sample Programs – Source Codes

Posted by Omkar on April 3, 2009

Mega16 Development board comes with sample programs. On this post I will be posting updated versions of sample codes and related documentation. You can download this sample programs, modify and use them free of cost. All programs are written for CodeVisionAVR Compiler, unless otherwise specified.

Following table summarizes the provided sample programs :
(Link for the .RAR file is provided at the end of the post)

Example Number/ Name of the folder

Program demonstrates use of  input/output registers in AVR.
- It will monitor SW1 and SW2 on the kit
- When SW1 is pressed, LEDs will be flashed in one pattern.
When SW2 is pressed, LEDs will be flashed in another pattern- Blinks the LED on PB3 at 31Hz using Timer0.
- Timer0 is configured in CTC mode. Timer resets when compare match  occurs between OCR0 and TCNT0.
- Also output toggle is enabled  in  this mode.  This makes pin OC0 (i.e. PB3 in mega16)  toggle on every compare match.- Blinks the LED on PB0 at 1Hz using Timer1 CTC Interrupt.
- Timer1 is configured to run in CTC mode. Timer resets when compare match occurs between OCR1A and TCNT1. And interrupt is generated.
- State of the PB0 is toggled on every interrupt.- Demonstrates the PWM using Timer0.
- LED connected on PB3 will faded in and faded out continuously using PWM.- Generates sound using the CTC mode of timer 1.
- By changing the OCR1A value, we can generate square waves of different frequencies.
- Output is available on PD5(OC1A) pin.
- Connect this pin to on speaker using external wire to listen the sound.
- Press SW1 or SW2 to start melody.
- Program also prints the frequency being generated on serial interface.- Demonstration of simple edge detector robo-car code- Demonstration of simple line follower- Demo program for the development board. Shows how to use printf, ADC, LCD, I2C, Infrared remote.- Demonstares the use of L293D connected on PD.
- Press SW0 to stop the motors
- Press SW1 to start the motors in one direction
- Press SW2 to start the motors in reverse direction- LED Blinking using RTOS threads. FreeRTOS based. WinAVR compiler.
- Use eclipse IDE and select File> Switch Workspace> Other …, and select this folder.- Toggles all I/O lines of uC at the rate of 1Hz. Helpful for debugging the board.

DOWNLOAD here

Be the first to like this post.This entry was posted on April 3, 2009 at 3:01 pm and is filed under AVR microcontroller. Tagged: ATmega16, AVR Micocontroller, CodeVisionAVR, sample source code. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


View the original article here

AVRDude Tutorial : Burning hex files using USBasp and AVRdude

AVRDude is excellent program for burning hex code into microcontroller. USBasp is awesome USB based programmer for the AVR. In this tutorial we will see how to use AVRdude for burning hex files into AVR microcontroller using USBasp.

AVRdude is not readily available for windows installation. Windows version of AVRdude is bundled with WinAVR compiler. Before we start : Download WinAVR from here.

Introduction:

In order to program any microcontroller you need the .HEX file. It is nothing but the machine code for the microcontroller. This file is generated by the corresponding assembler software, which converts assembly code into machine code. Assembly can be  produced by third party cross compiler software or can be handwritten.

After you finish the installation of WinAVR, AVRdude executables can be found at :
\bin

Complete documentation of AVRdude can be found at:
\doc\avrdude\avrdude.pdf

Connections:

- Connect the USBasp to PC.
- Connect SPI programming pins of USBasp to the AVR microcontroller. Following figure shows sample schematic diagram, if you have different AVR, then connect MOSI,MISO, SCK, RESET and GND pins of that uC to corresponding pins of USBasp.

USBaspandAVRconnections 

- Give +5V supply to the microcontroller.
- VIMP: If you are burning a fresh microcontroller, close the Slow Serial Clock jumper of USBasp. Since many brand new microcontroller are factory programmed for internal 1MHz oscillator. USBasp uses very high speed serial clock for faster programming. Thus you will have to specifically tell USBasp to use slow serial clock. This setting is done by above mentioned jumper.

NOTE: If you have uC which has internal oscillator enabled and after the programming you are not planning to change its fuse bits back to external clock setting, then you can skip the crystal.

Executing AVRdude:

Fortunately AVRdude is command line tool, so that you can be very sure of what you are doing with your uC Or Unfortunately AVRdude is command line tool, so you will have to spend little time to get familiar with it :)

- Open the command prompt. (Press WinKey + R. Run dialogbox will appear. Type cmd and press enter.)
fig1-commandPrompt

- Navigate to the directory where .hex file is located. For example :

> cd D:\mega16_kitCD\sample code\ex01_simple_input_output\Exe
> d:

fig2-navigate

- To burn the hex file enter following command. Consider for example name of my hex file is io.hex :

> avrdude –c usbasp –p m16 –u –U flash:w:io.hex

You should see something like this :

fig3-pgmdone

Thats all !!! It is as simple as that ! :)

Explanation for command :

avrdude –c usbasp –p m16 –u –U flash:w:io.hex

-c : Indicates the programmer type. Since we are using the USBasp programmer, argument “usbasp” is mentioned.

-p : Processor. We are using ATmega16, hence “m16”. Note ATmega16 has two variants, one is “ATmega16L” (slow speed version) and “ATmega16” normal 16MHz version. However their device signature is same and hence you will have to use “m16” as parameter for both the AVRs. This applies to all AVRs having “L” variants.

-u : Disables the default behavior of reading out the fuses three times before programming, then verifying at the end of programming that the fuses have not changed. Always use this option. Many times it happens that we forget to switch on the AVR’s +5V power supply, then at the end of programming cycle, avrdude detects inconsistent fuses and tries to reprogram them. Since there is no power supply, fuses gets programmed incorrectly and entire microcontroller gets screwed up(means becomes useless). Thus always use this option.

-U  :  memtype:op:filename[:format]

Perform a memory operation. Multiple ‘-U’ options can be speci?ed in order to operate on multiple memories on the same command-line invocation. 

    memtype

The memtype ?eld speci?es the memory type to operate on. 

calibration   One or more bytes of RC oscillator calibration data.
eeprom       The EEPROM of the device.
efuse         The extended fuse byte.
flash          The ?ash ROM of the device.
fuse           The fuse byte in devices that have only a single fuse byte.
hfuse          The high fuse byte.
lfuse           The low fuse byte.
lock            The lock byte.

    op

The op ?eld speci?es what operation to perform:

r        read the speci?ed device memory and write to the speci?ed ?le
w       read the speci?ed ?le and write it to the speci?ed device memory
v       read the speci?ed device memory and the speci?ed ?le and perform a verify operation

    filename

Specify the hex file name. If file is not in current directory specify file name with appropriate path.

    format

Format need not be specified, for hex files, avrdude will automatically detect the format.

The trick to do it quickly : The Batch file :

It is extremely boring to type such a long command every time you program the uC. Therefore to avoid this you can create something called as Batch file. It is a text file which contains series of commands which will be executed by dos command processor. To create batch file follow these steps :

- Open notepad
- Type our avrdude command. i.e. copy paste following line into notepad.
avrdude –c usbasp –p m16 –u –U flash:w:io.hex
- Save the file with filename “burn.bat” and put it into the directory, which has the hex file.

Now whenever you recompile your program and want to burn it, simply double click on burn.bat. This will execute avrdude command that we have typed in it.

Possible errors:


1)couldn’t find usbasp:

found 5 busses
found 5 busses
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

This happens when USBasp is not connected or not recognized by the PC. Try to connect it to different USBport. Make sure that “Self programming” jumper of USBasp is open. Always disconnect AVR from USBasp, before plugging USBasp to the PC.

2)target does not answer

found 5 busses

avrdude: error: programm enable: target doesn’t answer. 1
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done.  Thank you.

Check the connections of USBasp with uC. Check the  power supply of the uC. Check whether you have connected the crystal and decoupling capacitors. If everything is fine and still you are getting this error, then it indicates that either ur uC is dead or its fuse bits have got screwed up.

I hope this post will help you to get started with AVRdude. Feedback is welcome.

Be the first to like this post.

View the original article here

Xilinx ChipScope Tutorial

Introduction:

Simulation based method is widely used for debugging the FPGA design on computers. Time required for simulating complex design for all possible test cases becomes prohibitively large and simulation approach fails. For rapid testing, such designs can be loaded on to the target FPGAs and tested by applying test inputs and directly observing their outputs. As the complexity of the design under test increases, so does the impracticality of attaching test equipment probes to these devices under test. The ChipScope Pro tools integrate key logic analyzer and other test and measurement hardware components with the target design inside the FPGA. Computer based software tool communicate with these hardware components and provide a designer robust logic analyzer solution.

In this tutorial we will use simple UP counter design and test it using ChipScope.

You can download the PDF file of this tutorial from here.

NOTE: For more detailed information on various settings and parameters of ChipScope Pro, refer to ‘ChipScope Pro 10.1 Software and Cores User Guide’.

Couter Design:

Create a new project in the Xilinx ISE and paste the following counter code in top module (cntr.v):

module cntr(
input rst,
input clk,
output [3:0] count
);

reg [25:0] cnt;
assign count[3:0] = cnt[25:22];

always @(posedge clk) begin
  if(rst)
    cnt <= 0;
  else
    cnt <= cnt + 1;
end
endmodule

To assign the constraints to the design, create new file named ‘cntr.ucf’ and add it to ISE project. Paste following constrains in ‘cntr.ucf’ file. These constraints are applicable for XUP-V2P Development board.

NET "count<0>" LOC = AC4;
NET "count<1>" LOC = AC3;
NET "count<2>" LOC = AA6;
NET "count<3>" LOC = AA5;
NET "clk" LOC = AJ15;
NET "rst" LOC = AG5;

These constraints connect the ‘rst’ signal to ENTER button on the development board. Output nets are connected to on board LEDs.

Configuring the logic analyzer core:

In order to test the counter design we have to configure and insert the logic analyzer core in our design. Follow these steps:

· In the ‘Sources’ view right click on the top module (cntr.v) and select ‘New Source’.

clip_image002

· In the ‘New Source Wizard’ window, select ‘ChipScope Definition and Connection File’ and specify the filename as ‘debug’. Click ‘Next’.

clip_image004

· Now we have to associate this debug.cdc file with our desired top module. Thus select ‘cntr’ from list of the modules. If there are multiple modules shown, select the one which you wish to test. Click ‘Next’ and then click ‘Finish’.

clip_image006

Note that ‘debug.cdc’ file has been added to your ‘Sources’ list and is listed below the selected top module (cntr).

clip_image008

· Double click on ‘debug.cdc’ to launch the ChipScope Pro Core Inserter application. This application will integrate the logic analyzer core into our counter design. Do not alter any settings on the first screen. Click ‘Next’.

clip_image010

· To observe any signal, we have to specify the trigger. Logic analyzer core will start capturing the desired signal upon activation of trigger signal. In this example we want to monitor the counter’s counting action as soon as ‘rst’ signal is deactivated. So we will create two trigger ports. One port will be ‘rst’ signal and another port will be counter’s eight least significant bits.

Set ‘Number of trigger ports’ to 2.

In ‘TRIG0’ frame set ‘Trigger Width’ as 1 (since ‘rst’ is one bit signal).

In ‘TRIG1’ frame set ‘Trigger Width’ as 8 (as we want to observe counter’s 8 least significant bits).

clip_image012

Click ‘Next’.

· Now in this window we will specify capture parameters. We want to use our trigger ports as data ports which will be recorded by logic analyzer. We also want to sample data on rising clock edge.

In ‘Sample On’ list select ‘Rising’.

Set Number of samples to be recorded by changing ‘Data Depth’ to 1024 samples. This will record 1024 samples from the trigger event. You can at the most record 16K samples.

Select both check boxes in ‘Trigger Ports Used As Data’ frame.

clip_image014

Click ‘Next’.

· Now we will specify which signal(s) to be used as Clock and Trigger.

Click on ‘Modify Connections’.

clip_image016

· Select the ‘Clock signals’ Pane, then select ‘clk_BUFG’ signal from the left hand side list and then click on ‘Make Connection’. This will add ‘clk’ signal as the clock signal for logic analyzer.

clip_image018

· Now select ‘Trigger/Data signals’ pane. Select ‘TP0’ and connect ‘rst_IBUF’ signal to CH0 channel.

clip_image020

· Similarly click on ‘TP1’ pane and add connect counter’s lowe eight bits to eight channels.

clip_image022

Click ‘OK’ once you finish making connections.

· Now in the main window click on ‘Return to Project Navigator’. It will ask for saving the project, click ‘Yes’.

clip_image024

Now we are ready to compile the entire counter design along with the logic analyzer core.

· In the ISE, select top level module ‘cntr’ and in the ‘Processes’ pane double click on ‘Analyze Design Using ChipScope’. This will start the process to synthesize combined unit consisting of design under test (in this case counter) and the ChipScope cores.

clip_image026

Debugging the design using ChipScope Analyzer tool:

Once the synthesis gets over, ISE will launch the Analyzer tool. Make sure that FPGA board is connected to PC.

· Once the analyzer tool is running, click on ‘Initialize JTAG Chain’ clip_image028 icon located at the top right corner of the window. This will initialize the JTAG chain and identify the devices found in the chain. A dialog box will appear showing the devices discovered. Click ‘OK’.

clip_image030

· Now select the FPGA device from the JTAG chain, right click and then select ‘Configure’ to specify the configuration bit stream file.

clip_image032

· Select the bit stream file ‘cntr.bit’ from the bit stream folder. Then click ‘OK’.

clip_image034

· IMPORTANT: After clicking ‘OK’, tool will load the bit stream file into FPGA and check the availability of debugging cores. If debugging core is found tool will show ‘INFO: Found 1 Core Unit in the JTAG device Chain.’ Message in status window.

If you see ‘Found 0 Core …’ message instead, then either you have selected wrong bit stream file or something has gone wrong in one of the previous steps and debugging core has not been inserted properly into the design.

If everything is fine then you will see options for Logic Analyzer core inserted in our design. Now double click on the ‘Trigger Setup’ element to launch trigger setup window. And for trigger port 0 (i.e. ‘rst’ signal) specify the trigger Value 0.

clip_image036

This will make logic analyzer to trigger as soon as ‘rst’ become zero and record 1024 samples on successive clock edges. Note that trigger signals are sampled on rising clock edge.

Double click on ‘Waveform’ element to see the waveform.

· Now everything is ready. To apply the settings and ARM the trigger click on clip_image038 button. After that press the ‘Down’ button on the development board to release the ‘rst’ signal. This will trigger the logic analyzer. Once 1024 samples are recorded, this data will be transferred to PC and will be displayed in the waveform window.

clip_image040

Final data is uploaded on PC and displayed in waveform window.

clip_image042

NOTE: To see the names of the trigger ports, you can import the ‘debug.cdc’ file in analyzer tool. Click on File>Import and then select ‘debug.cdc’

NOTE: For more detailed information on various settings and parameters of ChipScope Pro, refer to ‘ChipScope Pro 10.1 Software and Cores User Guide’.

Be the first to like this post.

View the original article here