Difference between revisions of "Arduino/C3/Interfacing-LCD-through-AVR-GCC-programming/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "{| Border = 1 | '''Time''' |'''Narration''' |- | 00:01 | Welcome to the''' Spoken Tutorial''' on '''Interfacing LCD through AVR-GCC programming.''' |- | 00:09 |In this tutor...")
 
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
 
|In this tutorial, we will learn to:
 
|In this tutorial, we will learn to:
  
Interface a''' LCD''' to''' Arduino''' board.
+
interface a''' LCD''' to''' Arduino''' board,
  
Write an '''AVR-GCC''' program to display a digit on '''LCD.'''
+
write an '''AVR-GCC''' program to display a digit on '''LCD.'''
  
 
|-
 
|-
Line 19: Line 19:
 
|To follow this tutorial, you should have basic knowledge of :
 
|To follow this tutorial, you should have basic knowledge of :
  
'''Electronics '''
+
electronics,
  
 
'''C Programming '''and
 
'''C Programming '''and
  
'''AVR-GCC'''
+
'''AVR-GCC'''.
  
 
|-
 
|-
Line 29: Line 29:
 
| To record this tutorial, I am using:
 
| To record this tutorial, I am using:
  
'''Arduino UNO Board'''
+
'''Arduino UNO Board''',
  
'''Ubuntu Linux '''operating system version 14.04
+
'''Ubuntu Linux operating system''' version 14.04.
  
 
|-
 
|-
 
| 00:47
 
| 00:47
 
| We also require some external devices such as:
 
| We also require some external devices such as:
'''Breadboard'''
+
'''Breadboard''',
'''LCD 16 by 2'''
+
 
'''Arduino UNO Board'''
+
'''LCD 16 by 2''',
 +
 
 +
'''Arduino UNO Board''',
  
 
|-
 
|-
 
| 01:00
 
| 01:00
|'''Potentiometer'''
+
|'''Potentiometer''',
 +
 
 
'''Jumper Wires '''and
 
'''Jumper Wires '''and
'''Pin headers'''
+
 
 +
'''Pin headers'''.
  
 
|-
 
|-
 
| 01:07
 
| 01:07
 
|In this experiment, we will be using a '''16 by 2 LCD'''.
 
|In this experiment, we will be using a '''16 by 2 LCD'''.
Please refer to the basic level tutorial of this series to know more about '''LCD'''.
+
Please refer to the basic level tutorials of this series to know more about '''LCD'''.
  
 
|-
 
|-
 
| 01:20
 
| 01:20
| Make use of the given table to connect the '''Arduino''' pins to the '''LCD'''.
+
| Make use of the given table to connect the '''Arduino pin'''s to the '''LCD'''.
  
 
|-
 
|-
Line 61: Line 65:
 
|-
 
|-
 
| 01:32
 
| 01:32
| This is the circuit connection.
+
| This is the '''circuit''' connection.
  
 
|-
 
|-
 
| 01:35
 
| 01:35
| Connect one extreme lead of the '''potentiometer '''to '''pin''' '''1''' of the '''LCD'''.  
+
| Connect one extreme lead of the '''potentiometer '''to '''pin 1''' of the '''LCD'''.  
  
 
|-
 
|-
 
| 01:42
 
| 01:42
|The other extreme end is connected to '''pin''' '''2''' of the '''LCD'''.  
+
|The other extreme end is connected to '''pin 2''' of the '''LCD'''.  
 
The middle '''pin''' is connected to '''pin 3''' of the '''LCD'''.  
 
The middle '''pin''' is connected to '''pin 3''' of the '''LCD'''.  
  
Line 78: Line 82:
 
|-
 
|-
 
| 01:58
 
| 01:58
| Now we will write an '''AVR-GCC '''program to display''' '''the digit '''5''' on the '''LCD'''.
+
| Now, we will write an '''AVR-GCC '''program to display the digit '''5''' on the '''LCD'''.
  
 
|-
 
|-
Line 90: Line 94:
 
|-
 
|-
 
| 02:19
 
| 02:19
|'''Util slash delay.h '''contains the '''libraries''' for the '''delay function'''.
+
|'''Util slash delay.h '''contains the '''libraries''' for the '''delay''' function.
  
 
|-
 
|-
Line 106: Line 110:
 
|-
 
|-
 
| 02:58
 
| 02:58
| All the numerical '''pins''' of the '''LCD''' are replaced with the names using '''hash''' '''define.'''  
+
| All the numerical '''pins''' of the '''LCD''' are replaced with the names using hash '''define.'''  
  
 
|-
 
|-
Line 114: Line 118:
 
|-
 
|-
 
| 03:10
 
| 03:10
| The '''PulseEnableLine function '''is used to toggle the enable '''pin '''of the '''LCD'''.
+
| The '''PulseEnableLine''' function is used to toggle the enable '''pin '''of the '''LCD'''.
  
 
|-
 
|-
Line 122: Line 126:
 
|-
 
|-
 
|03:25
 
|03:25
| The '''SendNibble function '''is used to send data of one '''nibble '''to the '''PORTB'''.
+
| The '''SendNibble''' function is used to send data of one '''nibble '''to the '''PORTB'''.
  
 
|-
 
|-
 
| 03:33
 
| 03:33
| The '''SendByte function''' is used to send data of one '''byte '''to the '''PORTB'''.
+
| The '''SendByte''' function is used to send data of one '''byte '''to the '''PORTB'''.
  
 
|-
 
|-
 
| 03:40
 
| 03:40
| The '''LCD underscore Cmd function '''is used to send a '''command '''to the '''LCD'''.
+
| The '''LCD underscore Cmd''' function is used to send a '''command '''to the '''LCD'''.
  
 
|-
 
|-
 
| 03:47
 
| 03:47
| The '''LCD underscore Char function '''is used to send a '''character data '''to the '''LCD'''.
+
| The '''LCD underscore Char''' function is used to send a '''character data '''to the '''LCD'''.
  
 
|-
 
|-
 
| 03:55
 
| 03:55
| The '''LCD underscore Init function '''is used to initialise the '''LCD'''.
+
| The '''LCD underscore Init''' function is used to initialize the '''LCD'''.
  
 
|-
 
|-
 
| 04:02
 
| 04:02
| The '''LCD underscore Clear function''' is used to clear the '''display'''.
+
| The '''LCD underscore Clear''' function is used to clear the '''display'''.
  
 
|-
 
|-
 
| 04:09
 
| 04:09
| The '''LCD underscore Message function''' is used to send a '''string '''of '''data '''to be displayed on the '''LCD'''.
+
| The '''LCD underscore Message''' function is used to send a '''string '''of '''data '''to be displayed on the '''LCD'''.
  
 
|-
 
|-
 
|04:18
 
|04:18
| The '''LCD underscore Integer function '''is used to send an '''integer data '''to the '''LCD'''.
+
| The '''LCD underscore Integer''' function is used to send an '''integer data '''to the '''LCD'''.
  
 
|-
 
|-
 
| 04:27
 
| 04:27
| This is the '''main function''' where we pass the value 5 to the '''display.'''
+
| This is the '''main''' function where we pass the value '''5''' to the '''display.'''
  
 
|-
 
|-
Line 172: Line 176:
 
| 04:56
 
| 04:56
 
| Go to the folder where '''lcd.c '''file is saved.
 
| Go to the folder where '''lcd.c '''file is saved.
Type, '''make space FNAME in capital = lcd '''and press '''Enter'''.
+
Type: '''make space FNAME in capital = lcd '''and press '''Enter'''.
  
 
|-
 
|-
Line 180: Line 184:
 
|-
 
|-
 
| 05:18
 
| 05:18
| Now you can see that''' '''the digit 5 is displayed on the '''LCD'''.
+
| Now, you can see that the digit '''5''' is displayed on the '''LCD'''.
  
 
|-
 
|-
Line 190: Line 194:
 
|In this tutorial, we learnt to:
 
|In this tutorial, we learnt to:
  
Interface a''' LCD''' to''' Arduino''' board and
+
interface a''' LCD''' to''' Arduino''' board and
  
Write an '''AVR-GCC''' program to display a digit on '''LCD.'''
+
write an '''AVR-GCC''' program to display a digit on '''LCD.'''
  
 
|-
 
|-
Line 203: Line 207:
 
|-
 
|-
 
| 05:57
 
| 05:57
| The video at the following link summarizes the Spoken Tutorial project. Please download and watch it.
+
| The video at the following link summarizes the '''Spoken Tutorial''' project. Please download and watch it.
  
 
|-
 
|-
 
| 06:05
 
| 06:05
|The''' Spoken Tutorial Project''' Team:
+
|The''' Spoken Tutorial Project''' team:
 
conducts workshops and gives certificates. For more details, please write to us.
 
conducts workshops and gives certificates. For more details, please write to us.
  
Line 216: Line 220:
 
|-
 
|-
 
| 06:19
 
| 06:19
|Spoken Tutorial project is funded by NMEICT, MHRD, Government of India.More information on this mission is available at this link.
+
|Spoken Tutorial project is funded by '''NMEICT, MHRD''', Government of India. More information on this mission is available at this link.
  
 
|-
 
|-
 
| 06:29
 
| 06:29
| This tutorial has been contributed by '''FOSSEE''' and Spoken Tutorial Project, '''IIT Bombay'''.  
+
| This tutorial has been contributed by '''FOSSEE''' and '''Spoken Tutorial Project, IIT Bombay'''.  
This is '''Priya''' from IIT Bombay signing off. Thanks for watching.
+
This is Priya from '''IIT Bombay''', signing off. Thanks for watching.
  
 
|}
 
|}

Latest revision as of 17:18, 26 October 2018

Time Narration
00:01 Welcome to the Spoken Tutorial on Interfacing LCD through AVR-GCC programming.
00:09 In this tutorial, we will learn to:

interface a LCD to Arduino board,

write an AVR-GCC program to display a digit on LCD.

00:22 To follow this tutorial, you should have basic knowledge of :

electronics,

C Programming and

AVR-GCC.

00:34 To record this tutorial, I am using:

Arduino UNO Board,

Ubuntu Linux operating system version 14.04.

00:47 We also require some external devices such as:

Breadboard,

LCD 16 by 2,

Arduino UNO Board,

01:00 Potentiometer,

Jumper Wires and

Pin headers.

01:07 In this experiment, we will be using a 16 by 2 LCD.

Please refer to the basic level tutorials of this series to know more about LCD.

01:20 Make use of the given table to connect the Arduino pins to the LCD.
01:26 This table is available in the Additional reading material link of this tutorial.
01:32 This is the circuit connection.
01:35 Connect one extreme lead of the potentiometer to pin 1 of the LCD.
01:42 The other extreme end is connected to pin 2 of the LCD.

The middle pin is connected to pin 3 of the LCD.

01:53 This is the live setup of the connection.
01:58 Now, we will write an AVR-GCC program to display the digit 5 on the LCD.
02:05 Open any text editor and type the following.
02:09 avr/io.h contains all the basic libraries required to perform the input and output operations.
02:19 Util slash delay.h contains the libraries for the delay function.
02:26 stdlib.h contains the libraries for defining variable types and other commonly used functions.
02:36 ClearBit(x comma y) is equivalent to cbi(x comma y). This is used to clear the yth bit of PORTx.
02:47 SetBit(x comma y) is equivalent to sbi(x comma y). This is used to set the yth bit of PORTx.
02:58 All the numerical pins of the LCD are replaced with the names using hash define.
03:05 This is done to make the program easier to understand.
03:10 The PulseEnableLine function is used to toggle the enable pin of the LCD.
03:17 SetBit will set to high and Clearbit will set to low, with a delay in between.
03:25 The SendNibble function is used to send data of one nibble to the PORTB.
03:33 The SendByte function is used to send data of one byte to the PORTB.
03:40 The LCD underscore Cmd function is used to send a command to the LCD.
03:47 The LCD underscore Char function is used to send a character data to the LCD.
03:55 The LCD underscore Init function is used to initialize the LCD.
04:02 The LCD underscore Clear function is used to clear the display.
04:09 The LCD underscore Message function is used to send a string of data to be displayed on the LCD.
04:18 The LCD underscore Integer function is used to send an integer data to the LCD.
04:27 This is the main function where we pass the value 5 to the display.
04:33 This code is available in the Code files link of this tutorial. You can download and use it.
04:41 I’ll save the code as lcd.c file in the Downloads folder.

Ensure that the Makefile is also present in the same folder.

04:53 Switch to the terminal.
04:56 Go to the folder where lcd.c file is saved.

Type: make space FNAME in capital = lcd and press Enter.

05:12 This command creates a .hex file and uploads it to Arduino.
05:18 Now, you can see that the digit 5 is displayed on the LCD.
05:25 This brings us to the end of this tutorial. Let us summarize.
05:31 In this tutorial, we learnt to:

interface a LCD to Arduino board and

write an AVR-GCC program to display a digit on LCD.

05:43 As an assignment-

Modify the above code to display any other digit from 0-9.

Modify the above code to build a counter which counts from 0 to 9.

05:57 The video at the following link summarizes the Spoken Tutorial project. Please download and watch it.
06:05 The Spoken Tutorial Project team:

conducts workshops and gives certificates. For more details, please write to us.

06:15 Please post your timed queries in this forum.
06:19 Spoken Tutorial project is funded by NMEICT, MHRD, Government of India. More information on this mission is available at this link.
06:29 This tutorial has been contributed by FOSSEE and Spoken Tutorial Project, IIT Bombay.

This is Priya from IIT Bombay, signing off. Thanks for watching.

Contributors and Content Editors

Pratik kamble, Sandhya.np14