Description: This circuit is designed for experiments using the AT90S2313 microcontroller, a 2x16 LCD display, and a 4x4 keypad. It operates with a clock based on a 4 MHz crystal, although any crystal between 1-4 MHz can be utilized. The keys labeled "A", "B", and "F" correspond to numbers 10-16 on the LCD. Due to the AVR's limitation of 15 I/O pins, the LCD display is operated using a 4-bit data bus. Four 10 kΩ resistors are employed to protect the AVR from potential short circuits on the keypad columns while scanning the keys by toggling the pin status from input to output. The source code is written in a straightforward manner, prioritizing clarity over memory efficiency to facilitate understanding of the circuit's operation. The AVR configures Port B with pins PB0-PB3 as inputs and PB4-PB7 as outputs. Initially, the AVR sets pin PB4 to logic '0' to enable the first column (the first four keys) and reads their status. If any of the first four keys are pressed, the AVR sends the corresponding key number to the LCD display. If no keys are pressed, PB4 is set to logic '1' and PB5 to logic '0' to enable the second column. This process continues for all 16 keys, after which the circuit restarts the scanning from the first key in the first column.
The circuit utilizes the AT90S2313 microcontroller, which is a member of the AVR family and is well-suited for embedded applications due to its low power consumption and versatility. The 2x16 LCD display provides a clear interface for outputting the pressed key values, while the 4x4 keypad allows for user input. The 4 MHz crystal oscillator ensures stable clock signals necessary for the microcontroller's operation.
To interface the LCD in 4-bit mode, the data lines are connected to pins PB4 to PB7 of the AVR, allowing for efficient communication with the display while conserving I/O resources. The keypad is connected in a matrix configuration, which enables the microcontroller to scan multiple keys using fewer pins. The 10 kΩ resistors serve as pull-up resistors, ensuring that the input pins are in a known state when not actively driven low by the keypad.
The scanning algorithm implemented in the source code sequentially enables each column of the keypad, reading the state of the keys. This method allows the microcontroller to detect which key is pressed by checking the status of the corresponding input pins. When a key press is detected, the microcontroller sends the appropriate value to the LCD, providing immediate feedback to the user.
This circuit serves as an excellent platform for learning about microcontroller interfacing, LCD operation, and keypad scanning techniques. It can be further expanded by adding additional features such as debounce logic for the keypad or implementing more complex user interactions through the LCD display.A very simple circuit forexperiments with AT90S2313, 2x16 LCD display and 4x4 keypad. The clock is based on 4 MHz crystal, but you can use any other crystalbetween 1-4 MHz. The keys with the name "A", "B". "F" are typed to the LCD with numbers 10-16. Because the AVR has only 15 I/O pins we work the LCD display with 4-bit data bus. The 4 resistors (10 k) are protecting the AVR from anyshortcut onthe columns of the keypad when AVR is scanning the keys by changing the pinstatus from input to output. I wrotethe source code ina simple form, that it means I haven`t made any economy to the flash memory, for understanding the way howthis circuit works.
The AVR configure the PortB as PB0-PB3 inputs and PB4-PB7 outputs. Onthe beginning, the AVR puts the pin PB4 at logic `0` to enable the column 1 (the first 4 keys) and reads the status of the keys. If we have pressed any of the 4 first keys then the AVR sends the number of the key to the LCD display.
If we have not pressed any of 4 first keys, the AVR puts the PB4 at logic `1` and PB5 at logic `0` to enable the secondcolumn. Reading the statusof the keys and display the result to LCD, etc, until the 16th key is been read. After that, the circuit starts again to read from the 1st key (1st column).
In this project, a GPS module is interfaced with an AVR microcontroller. The ATtiny2313 retrieves location data from the GPS and displays it on an LCD screen.
The project involves the integration of a GPS module with the ATtiny2313 microcontroller, which...
This generally results in a square wave if the frequency of oscillation is low enough relative to the amplifier's bandwidth. The schematic of a crystal-controlled oscillator features a low-frequency sine wave oscillator characterized by low distortion, wideband operation, and crystal...
The ATMEL AVR family has established a strong presence in the microcontroller market. These microcontrollers offer a fast core and a variety of peripherals, which continue to attract the attention of engineers and gain their preference. Developers will find compatibility...
In the previous article about the Atmel AVR, only LED blinking was demonstrated without any external event influence on the microprocessor. All ports operated solely as outputs, with no input functionality. This article will illustrate how to connect control buttons...
Below are a couple circuits you can use to produce a 32.768 KHz square wave from a common watch crystal. The output can be fed to a 15 stage binary counter to obtain a 1 second square wave. The circuit...
To ensure the circuit functions properly, it is crucial to correctly configure the fuse bits within the AVR microcontroller. These fuse bits can be set using the programmer employed to upload the software. For those interested in the technical background,...
The Arduino Uno features an ATMEGA328P-PU microcontroller and various additional components on the board. The objective is to program the microcontroller without relying on the Arduino software, utilizing only the essential components. The goal is to develop projects independently of...
A 52 MHz third overtone crystal typically has a series resonance impedance of 30 ohms as per manufacturer specifications. The crystals utilized in the prototypes exhibit nearly ten times lower series resistance but are significantly more expensive. An oscillator can...
The article "Creating a Line Follower Robot with AVR" serves as a continuation of a previous piece on line follower robots, focusing on the AVR ATMega8535 and the associated block diagram. In the first part of this series, titled "Creating...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more