Contact SCM has a few years of time, has been focused on how to write some applications on a single chip microcomputer, how to start the knowledge of little, ashamed ashamed ... Today, I have to tidy up a bit, deepen the understanding of the SCM, such as why the definition of the data area of the variable restart the initial value of 0.
When the MCU is powered on, it will execute startup. The instructions for the A51 file, I analyzed the instructions
? What is the final positioning of your product?If the product has a large profit margin and the cost of MCU is limited, you may wish to upgrade the product to a higher level, which is also a promotional material and leave room for subsequent upgrades.If the product needs to be carefully calculated and the number of products is huge, saving 1 cent can bring huge profits, then MCU is enough. Even if developm
As the functionality of the project continues to increase, the program code size is constantly rising, and when more than 64KB, consider introducing the bank into the system.Before you tell me how to add a bank function to an existing project, let's talk about the background of its existence.8051 is based on the Harvard architecture. Code memory is 16-bit addressing, and data memory is 8-bit addressing. This separate addressing feature is suitable for
8051 principles of asynchronous serial port sending and receiving
8051 principles of asynchronous serial port sending and receiving
From: Liu Jianwen | academic half-It Ge-Wen
Author: Liu Jianwen
Keywords: 8051Digital ElectronicsData Communication
Permanent Link: http://arttech.us/y-2011/8051-uart-rx-tx.html
Postmeta
Tag:
There was a difference in the early 15, and now I'm back in the garden ... The work is busy on the one hand, another really long time did not engage these things.Originally wanted to make a time-sharing operating system on the 8051 microcontroller, so read the next 8051 assembly under the Code, the summary record is as follows:LJMP c:0149//long jump to 0x0149 address start execution command, this command is
//8051 and 1602 communication in bus mode//the main implementation function of this program is to send a string of strings to 1602, and display it#include#include#defineUchar unsigned char#defineUINT unsigned int#defineLcdddata XBYTE[0XFFFF]//Read Data address#defineLcdxdata XBYTE[0XFDFF]//Write Data address#defineLcddcom Xbyte[0xfeff]//Read Command#defineLcdxcom XBYTE[0XFCFF]//Write CommandsUchar idata s_good[5]={'W','D','J','X',0x00};uchar idata s_g
MCS-51 Microcontroller in the physical structure has four storage space:
1. In-chip program memory2. Off-chip program memory3. In-chip data storage4. Off-chip data storage
But logically, from the user's point of view, 8051 Single-Chip Microcomputer has three storage spaces:
1. 64 K program memory address space (movc)2. Address Space of the On-chip data storage of 256b (mov)3. and 64 K off-chip data storage address space (movx)When you access three dif
Putchar in Keil C, take 8051 as an instance, putcharkeilIn Keil C, it is necessary to implement char putchar (char c), or the powerful function printf wocould not work.We shoshould notice in here: new line command for serial output be "\ r \ n" (line feed: LF, 0x0a + carriage return: CR, 0x0d ), not only "\ n" in Keil C.I do not want to write too much tedious word in here, below is my putchar code for 8051,
The size of my color screen is 240*320 ~The following code is used:
//common.h#ifndef __COMMON_H__#define __COMMON_H__#include
// Touchpad. C # DEFINE _ touchpad_c __# include "touchpad. H "// my screen interface // # include" GDI. H "sbit tp_clk = p1 ^ 4; // clock sbit tp_cs = p1 ^ 5; // select sbit tp_in = p1 ^ 6; // data input // sbit tp_busy = p1 ^ 3; // I have not used the busy sign sbit tp_out = p1 ^ 7; // data output sbit tp_irq = P3 ^ 2; // use int0 to notify the
that enables the MCU to enter the low-power mode. Composition of interrupt programs
Void timer_interrupt ()
{
Settimer ();
Resetstack ();
Enable_timer_interrupt;
....
After the interruption occurs, reset the timer first. This is mainly for the 8051,805-1 auto-Reload divider, which only has 8-bit, and it is difficult to perform timing for a long time; reset the stack, that is, the stack pointer is assigned to the top or bottom of the stack (this is
First, the chip is divided into chip-level and system-level
Chip level is, just a chip, such as 51 single-chip microcomputer, you can write a program, download and follow the program to run, before and after the program
System level is, can run operating system, such as ARM,SOC, have RAM and ROM
Cpu:
Computers should understand that the central processing Unit, computer computing core and control core, all of the following chips contain CPU, chip-level
MPU:
microprocessor, including CPU on
Reading guidance The XC866 is the first generation of the new 8-bit microcontroller family (XC800), with integrated high-performance 8051-core, on-chip flash, and powerful peripheral sets. In addition, the XC800 family of internal integrated on-chip oscillators and embedded voltage regulators (EVR) that support single-supply 3.3V or 5.0V further enhance product performance and effectively save system costs.Key Words:XC8668-bit
clock cycle: The clock cycle, also known as the oscillation period, is defined as the reciprocal of the clock pulse (it can be understood that the clock cycle is the inverse of the monolithic microcomputer external crystal oscillator, such as the crystal oscillator 12M, its time period is 1/12 us), is the most basic, the smallest unit of time in the computer. In a clock cycle, the CPU only completes one of the most basic actions. For some kind of MCU,
At present, the general color LCD connection mode has so many: MCU mode, RGB mode, SPI mode, VSync mode, Mddi mode and so on.
=========================================================================================
First, the hardware interface
MCU mode: currently the most commonly used connection mode, usually 80 system (68 system no longer exists). Data bits are transmitted in 8-bit, 9-bit, 16-bit, and 1
MCU Low Power Design (ii) practiceKey Words:MCU low power consumption, stm8l low power consumption, energy saving practice, IAR development environment, ammeter measurement power consumptionIntroduction:Energy consumption is a major problem with battery-powered products, and once the power is exhausted the device will "strike". In the MCU low power Design (a) theory, we introduce the principle of energy sav
All the friends who have made products have realized that a design seems simple, and the hardware design and code compilation will be done quickly, but it is more or less unexpected during the debugging process, these are manifestations of insufficient anti-interference capabilities.
The following describes how to avoid detours in your design:
Anti-interference is embodied in two aspects: hardware design and software writing.
Here's a key note: the main anti-interference Design in
, it is not difficult to understand why the program runs and runs data as commands.
Iii. Second functional usage of P0 port, P2 port and P3: The second functional usage of P0 port, P2 port, and P3 port is often puzzled at the beginning of school, it is believed that there must be a switching process between the second function and the original function, or an instruction. In fact, the second function of each port is completely automatic, and no command is needed for conversion. For example, P3.6
too deeply will feel particularly difficult, affect interest, easy to be hit. SCM with this very basic C knowledge, you can do the preliminary SCM program, can immediately see their results, immediate, easy to have a sense of accomplishment and interest.If a friend in the university on the number of electricity, mold electricity, self-learning a little, this is very important, I am very short of this, can also teach me, three people, will have my teacherI work in the daytime, I am busy in the m
Still remember when reading, the teacher said that single-chip computer, ARM, DSP has interoperability, are CPU, but listen to the teacher can not understand.How can I understand them and find out their similarities and differences? Let's take a look at my wife's views:Icer, SOC design for arm CPUsLet me say a few words, hoping to say a little thinner.First of all, said CPU, central processing unit, the essence is an integrated circuit, the function is to read out from a place (such as ROM) a co
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.