Академический Документы
Профессиональный Документы
Культура Документы
Summer TrainingReport
ON
Rahul Srivastava
CERTIFICATE
This is to certify that Mr. Rahul Srivastava of Motilal Nehru National Institute of
Technology, Allahabad has participated in summer training programme on VLSI Design
& Embedded System (VDES-2016)at Motilal Nehru National Institute of Technology
Allahabad, organized by Department of Electronics and Communication Engineering from
15th June to 13th July 2016. The conduct of participant during the course was good.
Date:13-07-16
Course Coordinator
Place: Allahabad
(VDES 2016)
MNNIT, Allahabad
II
Acknowledgement
Engineering is not only a theoretical study but it is a implementation of all we study for creating something
new and making things more easy and useful through practical study. It is an art which can be gained with
systematic study , observation and practice. In the college curriculum we usually we get the theoretical
knowledge.
Along with a B.Tech degree , it is necessary to construct a bridge between the educational life and the
industry . I consider myself extremely fortunate to obtain the opportunity to be assigned the Project. I would
like to this opportunity to convey my sincere gratitude to Prof. V.K. Srivastava (HOD ECE department), Er.
Vadithya Narendar and Dr. Santosh Kumar Gupta , MNNIT Allahabad those who helped me to materialize
this project.
I sincerely thank VDES lab trainers , MNNIT Allahabad specially Mr. Aman Jain , Ms. Shreyashi Jaiswal ,
and Mr. Rupesh Shukla for assigning me the project and encouragement in carrying out the project
throughout.
I also thank my colleagues who helped me throughout the project. I enjoyed my time with
them and look forward to working with them again . Thanks all who have been associated with me some
way or the other.
Rahul Srivastava
Place: Allahabad
III
ABSTRACT
The first project that I have implemented is on Light intensity measurement on Microelectronica Kit
through an IC (TSL230 BR) which generates square wave frequency proportional to intensity. Accurate and
quantifiable measurement of light is essential in creating desired outcomes in practical day to day
applications as well as unique applications. From measuring the amount of light in a work space surface to
ensuring emergency exits have proper illumination, light measurement and analysis is an important step in
ensuring efficiency and safety.
In the second section of this report, FPGA based design of UART is implemented using FPGA kit.
The UART consists of two independent HDL modules. One module implements the transmitter, while the
other module implements the receiver. The transmitter and receiver modules can be combined at the top
level of the design, for any combination of transmitter and receiver channels required.
Data can be written to the transmitter and read out from the receiver, all through a single 8 bit bi-directional
CPU interface.
IV
TABLE OF CONTENTS
NO.
TOPICS
PAGE
NO.
1.
1.1
Introduction
1.2
1.3
11
1.4
Conclusion
12
2.
13
2.1
Introduction
13
2.2
15
2.3
20
2.4
Conclusion
23
3.
APPENDIX
24
LIST OF FIGURES
NO.
FIGURE
PAGE NO.
1.1
Microcontroller Architecture
1.2
1.3
1.4
1.5
10
1.6
11
2.1
13
2.2
UART module
14
2.3
15
2.4
16
2.5
Sequence of transmitter
16
2.6
Reciever module
17
2.7
18
2.8
18
2.9
RS-232 connector
19
2.10
19
2.11
20
2.12
Implementation of transmitter
20
2.13
Output
21
2.14
21
2.15
Implementation of receiver
22
2.16
Output
22
However, scientists don't usually talk about the amplitude of a light wave, since light isn't traveling in some
substance like water or air. Instead they talk about the intensity of the light. Intensity is like brightness, and
is measured as the rate at which light energy is delivered to a unit of surface, or energy per unit time per unit
area. For instance, the intensity of the sunlight on your solar panel, multiplied by the panel's area, would tell
you how much power (energy per unit time) you have available to run your solar water heater.
In doing lighting efficiency work, you need to measure light intensity. You also need to know how to
express light intensity for selecting lamps and for laying out the overall lighting configuration.
Unfortunately, lighting terminology tends to be confusing and somewhat inconsistent. This brief Note
introduces you to the terms that the lighting trade uses to communicate about light intensity, and it points out
which of these terms are important to know.
Lumens
Lumen is the unit of total light output from a light source. If a lamp or fixture were surrounded by a
transparent bubble, the total rate of light flow through the bubble is measured in lumens. Lumens indicate a
rate of energy flow. Thus, it is a power unit, like the watt or horsepower. Typical indoor lamps have light
outputs ranging from 50 to 10,000 lumens. You use lumens to order most types of lamps, to compare lamp
outputs, and to calculate lamp energy efficiencies (which are expressed as lumens per watt).Note that lumen
output is not related to the light distribution pattern of the lamp. A large fraction of a lamps lumen output
may be useless if it goes in the wrong directions.
3
You use footcandles or lux to measure the adequacy of lighting on the task. Foot candles and lux relate only
to the task area, not to the lighting equipment or to the geometry of the space. For example, you could create
an illumination level of 100 lux on a surface by using a single spotlight located far away, or by using many
covelights nearby. For energy conservation work in existing facilities, you need a light meter that measures
illuminance in footcandles or lux. You will use it continually as you lay out lighting, select fixtures to be
delamped, etc. Lightmeters have become inexpensive, so you can afford to spend the money to get a rugged
electronic unit of good quality, rather than the older type that uses a fragile meter movement. Figure 1 shows
a foot candle meter.
Candlepower
Candlepower is a measure of lighting concentration in a light beam. It is used primarily with lamps that
focus, such as spotlights and PAR lamps. In lamps where candlepower is specified, the candlepower rating
usually applies only to a small spot in the center of the beam.
4
The official unit of candlepower is the candela, which is equal to one lumen per steradian . (A steradian is
a fraction of the surface area of a sphere that is equal to the square of the radius divided by the total surface
area. This is approximately 8% of the total surface area.)This term is rarely used in practical work. Lamp
catalogs usually list candlepower rather than candelas. This is like using horsepower as both a general
term and a specific unit. To confuse matters further, candelas were earlier called candles.
Brightness
In general, brightness is an expression of the amount of light emitted from a surface per unit of
area.Brightness is not an official term of the lighting trade, and lighting designers may become huffy when
you use it. However, the concept is essential for understanding visual quality, especially in relation to
contrast and glare. Brightness does not inherently relate to lamps, or even to light sources. The light could be
reflected or transmitted. For example, the bright surface could be the surface of a fluorescent tube, a page of
a book, a window with a view of the sky, or a store window with reflections.
The closest official term is luminance, which is expressed as candelas per square meter of light emitting
surface. (Luminance used to be measured in foot lamberts, which is now an obsolete term.) For example,
the luminance of a heavily overcast sky is about1,000 candelas per square meter, and the luminance of a
typical frosted light bulb is about 100,000 candelas per square meter. Luminance is defined in terms of the
direction of light emission. The details get technical, and you probably will not need to deal with them. In
brief, the brightness of an object usually depends on the direction from which you look at it.
Note that luminance has nothing to do with size of the light emitting surface. The light source could be as
small as a lamp filament, or it could be as large as the whole sky, or it could be a task area, such as a desk
top. Measuring brightness (luminance) is tricky and requires specialized equipment. For practical work,
learn how to avoid excessive brightness, so you wont need to measure it. If you do a good job of laying
outlighting, people within the space will not be subjected to brightness that is severe enough to cause glare
.Luminance is the converse of illuminance. The former describes the intensity of light that is leaving a
surface, whereas the latter describes the intensity of light that is falling on a surface. For light reflected from
5
80C51) used complementary metaloxidesemiconductor (CMOS) technology and consume less power than
their NMOS predecessors. This made them more suitable for battery-powered devices.
The family was continued in 1996 with the enhanced 8-bit MCS-151 and the 8/16/32-bit MCS-251 family of
binary compatible microcontrollers.[2] While Intel no longer manufactures the MCS-51, MCS-151 and MCS251 family, enhanced binary compatiblederivatives made by numerous vendors remain popular today. Some
derivatives integrate a digital signal processor (DSP). Beyond these physical devices, several companies also
offer MCS-51 derivatives as IP cores for use in field-programmable gate array (FPGA) orapplicationspecific integrated circuit (ASIC) designs. ROM of 4KB and RAM of 128 bytes
TSL 230 BR
The TSL230 light-to-frequency converter combines a silicon photodiode and a current-to-frequency
converter on a single monolithic CMOS integrated circuit. The output is a square wave (50% duty cycle)
with frequency directly proportional to light intensity. Because it is TTL compatible, the output allows direct
interface to a microcontroller or other logic circuitry. The device has been temperature compensated for the
ultravioletto-visible light range of 300 nm to 700 nm and responds over the light range of 300 nm to 1100
nm. The TSL230 is characterized for operation over the temperature range of 25C to 70C.
supplied on the development system`s I/O ports. Which of the ports is to be used for connection solely
depends on the user`s program loaded into the microcontroller. Jumpers S1 and S0 are used to select the
sensor`s light sensitivity, whereas jumpers S3 and S2 are used to scale frequency on the light`s sensor`s
output pin.
10
1.4 Conclusion
With the help of relation, measured intensity of light is proportional to current flowing through photodiode
which is in turn proportional to frequency of square wave generated by light to frequency converter IC, we
have obtained the desired result.
Frequency of desired square wave corresponding to same light intensity can be observed to be changing in
accordance with sensitivity and scaling.
12
13
Baud Rate Generator specifies the rate at which transmission or reception should happen. During
transmission the data is shifted out to Tx line at Baud Rate and in reception data on Rx line is sampled at
baud rate. It is configurable with 8 bit latch registers (DLL and DLH) to different baud rates.
Divisor (decimal) = (clock frequency) / (baud rate x clock sampling rate)
14
15
The two subsystems involved in communication are interfaced to UART module. They operate at
different clock frequencies other than UART. Serial data are contained within frames of 8 data bits, as well
as coded information bits. Between successive transmissions, the transmission line is held high. A
transmission is initialized by a leading low start bit. Next to the leading low start bit comes 8 bits of data
information, beginning with the LSB and ending with the MSB. After the 8 data bits comes the parity bit,
representing the parity result of the 8 data bits. The parity bit can be set true based on even parity or odd
parity mode. Next to the parity bit comes a trailing high stop bit indicating the end of a data frame.
16
We have now covered all necessary declarations, and are ready to look at the actual implementation. Using a
hardware description language allows us to describe the function of the transmitter in a more behavioral
manner, rather than focus on its actual implementation at the gate level.
In software programming languages, functions and procedures break larger programs into more readable,
manageable and maintainable pieces. The Verilog language provides functions and tasks as constructs,
analogous to software functions and procedures.
to multiple lines of Verilog code, where certain inputs or signals affect certain outputs or variables. The use
of functions and tasks usually takes place where multiple lines of code are repeatedly used in a design, and
hence makes the design easier to read and maintain. A Verilog function can have multiple inputs, but always
only one output, while the Verilog task can have both multiple inputs and multiple outputs and even in some
cases, neither.
The master clock mclkx16 is divided down to the proper baud rate clock called rxclk, and equals to
mclkx16/16. Serial data to be received at the rx input of the module. Data received in serial format can be
read out in parallel format, through the 8 bit data bus.
During reception of a data frame, various parity and error checks are performed. When a complete data
frame has been received the receiver returns to idle mode.
The frequency of rxclk is equal to mclkx16/16, and the first rising edge of the rxclk will always occur at the
center point of the start bit. Figure 14 below shows how generation of the baud rate clock rxclk is
synchronized to the center points of the start bit and the following data bits.
RS-232 connector:
The J3 connector provides a standard RS-232 connection.
The pins of J3 are directly connected to the FPGA, allowing an internal implementation of the serial
controller.
It's possible to implement two UART without hardware handshaking.
18
19
(B) RECEIVER
21
22
2.4 Conclusion
We designed the UART consisting of baud rate generator, transmitter and receiver modules on XILINX
ISE using code in Verilog language.
We successfully implemented this design on Spartan 3E kit.
23
APPENDIX A
PROGRAM CODE for Embedded Project on Light to Frequency Converter
sbit LCD_RS at P2_0_bit;
//setting P2.1 as
// ,,
P2.3 ,,
,,
5 ,,
float freq = 0;
char txt[10];
void main() {
LCD_Init();
LCD_Cmd(_LCD_CLEAR);
screen
LCD_Cmd(_LCD_CURSOR_OFF);
screen
TCON.TR0 = 1;
TCON.TR1 = 1;
TMOD = 0x15;
IE.B7 = 1;
IE.B1 = 1;
IE.B3 = 1;
TCON.IT0 = 1;
TCON.IT1 = 1;
P3_0_bit=0;
while(1)
{
freq = (count_pulse/(0.786432*count_time));
count_t0 = 0;
count_time = 0;
TCON.TF0 = 0; TH0 = 0x00; TL0 = 0x00;
LCD_Out(1,1,"INTENSITY = ");
LCD_Out (2,1,txt);
/* getting
26
APPENDIX B
PROGRAM CODE for Verilog Project on UART implementation
Transmitter Module
`timescale 1ns / 1ps
module transmitter(input in, reset, clk, en, output reg [7:0] data,
output reg txparity
);
initial
begin
data <= 65;
data <= 1;
txfull <= 0;
cnt <= 0 ;
txparity <= 0;
parity <= 0;
27
end
begin
if(reset)
begin
data <= 1;
txfull <= 0;
cnt <= 0;
txparity <= 0;
parity <= 0;
end
else
begin
if(in)
begin
if(txfull!=1)
begin
thr<=data;
txfull<=1;
end
end
if(en & txfull)
begin
cnt<=cnt+1;
if(cnt==0)
begin
data<=0;
end
28
end
end
end
endmodule
module clkgen(clk,oclk
);
always@(posedge clk)
div2<=div2[15:0]+151;
wire oclk=div2[16];
endmodule
Reciever Module
module
jaimatadi(clk,rxclk,rxcnt,rxsamplecnt,rst,in,readdata,rxdata,rxen,rxparity,rx_completed,framingerr,d2
);
// declaration of various variables begins
input clk,readdata,rxen,rst,in;
output reg [7:0]rxdata;
output reg rxparity=0,rx_completed,framingerr;
output d2;
reg d2,rxbusy;
output reg [3:0]rxcnt;
output reg [5:0]rxsamplecnt;
output rxclk;
reg [7:0]rxhdr;//rx hold reg
divclk1 oversamplingclk(clk,rxclk);
//rxen allows the input from transmitter to be stored in rxhdr
initial
begin
rxparity<=0;
rx_completed=0;
framingerr<=0;
rxcnt=0;
rxsamplecnt<=0;
30
rxbusy=0;
rxhdr<=0;
rxdata<=0;
d2=1;
end
else
begin
d2=in;
if(rxen)
begin
if( d2 ==0 && rxbusy ==0)
begin
31
rxbusy=1;
rxcnt=0;
rxsamplecnt=16;
rx_completed=0;
end
if(rxbusy)
begin
//if((rxcnt==0)
rxsamplecnt=rxsamplecnt+1;
if(rxsamplecnt%16==7)
begin
rxsamplecnt = rxsamplecnt - 16;
if((d2==1)&&(rxcnt==0))
rxbusy=0;
else
begin
if(rxcnt > 0 && rxcnt < 9)
begin
rxhdr[rxcnt-1]<=d2;
rxparity<=rxparity^d2;
end
if(rxcnt==9)
begin
if(d2==0)
framingerr<=1;
else
begin
framingerr<=0;
32
rxbusy=0;
rx_completed=1;
end
end
rxcnt=rxcnt+1;
end
end
end
end
if(readdata & rx_completed)
begin
rxdata<=rxhdr;
end
end
end
endmodule
module divclk1(clk,oclk
);
reg [12:0]div;
output reg oclk;
input clk;
initial
begin
div=0;
33
oclk=0;
end
always@(posedge clk)
begin
div <= div[11:0]+151;
oclk = div[12];
end
endmodule
34
35