Difference between revisions of "Arduino/C3/Interfacing-LCD-through-AVR-GCC-programming/English-timed"
(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...") |
Sandhya.np14 (Talk | contribs) |
||
Line 11: | Line 11: | ||
|In this tutorial, we will learn to: | |In this tutorial, we will learn to: | ||
− | + | interface a''' LCD''' to''' Arduino''' board, | |
− | + | 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, | |
'''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 ''' | + | '''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''' | + | '''LCD 16 by 2''', |
− | '''Arduino UNO Board''' | + | '''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 | + | 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''' | + | | Make use of the given table to connect the '''Arduino pin'''s to the '''LCD'''. |
|- | |- | ||
Line 61: | Line 61: | ||
|- | |- | ||
| 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 | + | | 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 | + | |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 78: | ||
|- | |- | ||
| 01:58 | | 01:58 | ||
− | | Now we will write an '''AVR-GCC '''program to display | + | | Now, we will write an '''AVR-GCC '''program to display the digit '''5''' on the '''LCD'''. |
|- | |- | ||
Line 90: | Line 90: | ||
|- | |- | ||
| 02:19 | | 02:19 | ||
− | |'''Util slash delay.h '''contains the '''libraries''' for the '''delay | + | |'''Util slash delay.h '''contains the '''libraries''' for the '''delay''' function. |
|- | |- | ||
Line 106: | Line 106: | ||
|- | |- | ||
| 02:58 | | 02:58 | ||
− | | All the numerical '''pins''' of the '''LCD''' are replaced with the names using | + | | All the numerical '''pins''' of the '''LCD''' are replaced with the names using hash '''define.''' |
|- | |- | ||
Line 114: | Line 114: | ||
|- | |- | ||
| 03:10 | | 03:10 | ||
− | | The '''PulseEnableLine | + | | The '''PulseEnableLine''' function is used to toggle the enable '''pin '''of the '''LCD'''. |
|- | |- | ||
Line 122: | Line 122: | ||
|- | |- | ||
|03:25 | |03:25 | ||
− | | The '''SendNibble | + | | The '''SendNibble''' function is used to send data of one '''nibble '''to the '''PORTB'''. |
|- | |- | ||
| 03:33 | | 03:33 | ||
− | | The '''SendByte | + | | The '''SendByte''' function is used to send data of one '''byte '''to the '''PORTB'''. |
|- | |- | ||
| 03:40 | | 03:40 | ||
− | | The '''LCD underscore Cmd | + | | The '''LCD underscore Cmd''' function is used to send a '''command '''to the '''LCD'''. |
|- | |- | ||
| 03:47 | | 03:47 | ||
− | | The '''LCD underscore Char | + | | The '''LCD underscore Char''' function is used to send a '''character data '''to the '''LCD'''. |
|- | |- | ||
| 03:55 | | 03:55 | ||
− | | The '''LCD underscore Init | + | | The '''LCD underscore Init''' function is used to initialize the '''LCD'''. |
|- | |- | ||
| 04:02 | | 04:02 | ||
− | | The '''LCD underscore Clear | + | | The '''LCD underscore Clear''' function is used to clear the '''display'''. |
|- | |- | ||
| 04:09 | | 04:09 | ||
− | | The '''LCD underscore Message | + | | 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 | + | | The '''LCD underscore Integer''' function is used to send an '''integer data '''to the '''LCD'''. |
|- | |- | ||
| 04:27 | | 04:27 | ||
− | | This is the '''main | + | | This is the '''main''' function where we pass the value '''5''' to the '''display.''' |
|- | |- | ||
Line 172: | Line 172: | ||
| 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 | + | Type: '''make space FNAME in capital = lcd '''and press '''Enter'''. |
|- | |- | ||
Line 180: | Line 180: | ||
|- | |- | ||
| 05:18 | | 05:18 | ||
− | | Now you can see that''' ''' | + | | Now, you can see that the digit '''5''' is displayed on the '''LCD'''. |
|- | |- | ||
Line 190: | Line 190: | ||
|In this tutorial, we learnt to: | |In this tutorial, we learnt to: | ||
− | + | interface a''' LCD''' to''' Arduino''' board and | |
− | + | write an '''AVR-GCC''' program to display a digit on '''LCD.''' | |
|- | |- | ||
Line 203: | Line 203: | ||
|- | |- | ||
| 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''' | + | |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 216: | ||
|- | |- | ||
| 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, | + | | This tutorial has been contributed by '''FOSSEE''' and '''Spoken Tutorial Project, IIT Bombay'''. |
− | This is | + | This is Priya from '''IIT Bombay''', signing off. Thanks for watching. |
|} | |} |
Revision as of 17:17, 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. |