From the application point of view, this paper designs an application system based on the external SRAM expansion keyboard of ATmega2560 microcontroller. The detailed design is given from the hardware block diagram to the software.
ATmega2560 microcontroller is the most advanced one in ATmega series. It has been widely used in consumer electronics and industrial automatic control fields. Due to its low development cost, easy to use and powerful functions, you only need to make a simple ISP download line to write the compiled program into its program memory for downloading, which can save a lot of development costs. This article introduces the application design example of ATmega2560 microcontroller external SRAM expansion disk, and introduces the flexible application of external memory expansion function method, so that beginners can quickly grasp the design difficulties and key points.
1 ATmega2560 Microcontroller Overview
ATmega2560 has the characteristics of fast speed, high clock frequency, strong I/O port function, large driving ability, flexible storage function, rich peripherals, low power consumption, high confidentiality, and especially easy to use and low development cost.
The ATmega2560 microcontroller has a Flash capacity of 256 kB, an EEPROM capacity of 4 kB, an SRAM capacity of 8 kB, 86 I/O ports, 4 serial USART ports, 16 10-bit ADC channels, 6 sleep modes, and is packaged in TQFP.
1.1 ATmega2560 microcontroller software compilation
ATmega2560 controller is one of the ATmega series AVR microcontrollers. The ATmega2560 integrated development environment can be selected from AVRStudio v4.14.exe. It includes AVR Assemblet compiler, AVR Studio debugging function, AVR Prog serial and parallel download function, and JTAG ICE simulation functions. When programming in C language is required, Win AVR-20100110-install.exe software should be added.
1.2 ATmega2560 microcontroller software download
The download program software SLISP V1518 PNP.exe from Guangzhou Tianhe Shuanglong Electronics Co., Ltd. is selected. The installed MCU download software is shown in Figure 1. The software can download multiple models of microcontrollers from ATmega8 to ATmega2561. The software can easily set the fuse bit through the setting navigation or factory default settings. After setting the various parameters of the download software, click the flash option in Figure 1, select the execution code program to be written, click Program, and the program is easily downloaded to the flash in ATmega2560.
1.3 Making ATmega2560 microcontroller download ISP line
Figure 2 shows the simplest ISP parallel port download line schematic diagram, which can be completed with four 1 kΩ resistors and a DB25 socket. It is a very good choice to use this downloader in an environment without an emulator. The SCK pins correspond to pin 20 of ATmega2560, MISO corresponds to pin 22, RESET corresponds to pin 30, MOSI corresponds to pin 21, and GND is connected to all ground pins of ATmega2560. The ISP parallel port download line is very simple to make.
2 Design of external SRAM keyboard expansion for ATmega2560 microcontroller
2.1 Hardware circuit design
The hardware circuit is mainly composed of ATmega2560 microcontroller, LM1085IS-5.0 voltage regulator, AHC573 latch and programmable peripheral interface M82C55A, and keyboard input circuit. Figure 3 is the main control circuit of ATmega2560 microcontroller, and Figure 4 is the keyboard scanning circuit for external SRAM (data memory) expansion. The XP parallel port in Figure 4 is the ISP download interface, and the execution code can be downloaded to the ATmega2560 program memory through the ISP parallel port downloader.
The PA port of M82C55A is set as an output port, and the PB port is set as an input port. The intersection of the PA and PB ports constitutes a keyboard scanning circuit.
The PA port (pins 71 to 78) of the ATmega2560 microcontroller is used as the low byte of the external memory interface address and is also multiplexed as a data port. The PC port (pins 53 to 60) is only used as the high byte of the external memory interface address. When the ALE (pin 70) external memory address latch enable signal is valid, the PA port is used as the low 8 bits of the 16-bit address bus. The latched address output of the latch AH573 and the high 8 bits of the PC port together form a 16-bit external memory address space. When the read or write control signal of the external memory is valid, that is, when RD (pin 52) or WR (pin 51) is valid, the PA port will be used as a data port to transmit data.
2.2 Software Design
(1) Software Design Flowchart
The flow chart of the software program is shown in Figure 5.
(2) Key Program Analysis
3 Conclusion
From the application perspective, this paper constructs a complete ATmega2560 microcontroller external SRAM expansion keyboard application design, and gives a detailed analysis from the hardware principle to the software design. It has certain application value in the ATmega2560 external SRAM expansion application.
Previous article:Design and simulation of underwater acoustic modem based on single chip microcomputer
Next article:Design of MCU control board based on MCF51QE128 and ATmega64
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Regarding DDR4's winding length, all you need to know is in this book
- EEWORLD University ---- Amplifier Protection Series
- Introduction to calling DSP functions of TMS320F28335
- Running Debian system on K510 (unsuccessful compilation)
- UWB transceiver DW1000 chip internal diagram
- If the input signal travels 100 meters, is it better to connect it to the positive pole or the negative pole of the optocoupler?
- Tongzhou Electronics IPO Prospectus
- Please teach me the concept of RL78 related timer
- RCD calculation method (welcome to find faults. Many experts participated)
- Electronic equipment temperature measurement