【C51 Self-study Notes】Overview and Preparation

Publisher:ShimmeringMoonLatest update time:2022-03-10 Source: eefocusKeywords:C51  AT89S52  Keil  uVision Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Using atmel company: AT89S52


Use the burning tool: progisp


Writing tool: Keil uVision


Development board used: Sirius TLX-1C development board


The subsequent codes have been packaged: https://download.csdn.net/download/f_zmmfs/10560847 (delete for infringement)

structure:


       It integrates an 8-bit CPU, 4K bytes of ROM, 128 bytes of RAM, four 8-bit parallel I/O ports, a full-duplex serial port, two 16-bit timers/counters, and five interrupt sources.


        CPU: Consists of calculation and control logic, as well as an interrupt system and some external special function registers


        RAM: used to store data that can be read and written, such as intermediate results of calculations, final results, and data to be displayed; (non-memory)


        ROM: used to store programs, some original data and tables;


        I/O port: Four 8-bit parallel I/O ports, which can be used as both input and output;


        T/C: Two timers/counters, which can work in both timing mode and counting mode;


        Interrupt control system for five interrupt sources


        A full-duplex UART (Universal Asynchronous Receiver Transmitter) serial I/O port for serial communication between MCUs or between MCU and microcomputer;    


        The oscillator and clock generation circuit are built in, and the quartz crystal and fine-tuning capacitor need to be connected externally. The maximum oscillation frequency depends on the model and performance of the microcontroller.


Level:


Two levels of digital circuits: 0 1


TTL level: 1——+5v 0——0v (for microcontroller)


RS232 level: 1——+12v 0——-12v (for computer serial port)


Therefore, the communication between the computer and the microcontroller requires the addition of a level conversion chip max232


Common data types:

Special data types:

Common header files:


Usually there are:

           reg51.h reg52.h math.h ctype.h stdio.h stdlib.h absacc.h


reg51.h reg52.h (define special function registers and bit registers);


math.h (defines common mathematical operations) 


 


Common bit operations:


>> << (bit shift right bit shift left)

    & | (bitwise AND bitwise OR)

    ^ ~ (bitwise exclusive or bitwise inversion)


 


Summarize:

Steps for MCU development:


1. Analyze and implement functions: split the functions into modules to implement them - what chip to use

2. Analyze the chip: study the chip manual and understand how to use the chip (parameters, key points of operation, timing diagram, examples) - how to use the chip

3. Combination chip: connect the chip to the MCU according to a certain logic, construct a complex circuit (already constructed MCU development board) - put the chips together

4. Analyze the pin diagram: Construct the information interaction logic between the MCU IO and the chip (development board schematic diagram) - study the combination principle

5. Code implementation: Control IO ports to achieve data interaction - write down your ideas

Keywords:C51  AT89S52  Keil  uVision Reference address:【C51 Self-study Notes】Overview and Preparation

Previous article:[C51 self-study notes] Flashing light + running light (four methods) + 74HC573 chip + keil4 software simulation (debug)
Next article:[C51 Getting Started Notes] Single Bus Protocol + DS18B20

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号