[STC MCU Learning] Lesson 4: Understand your development board (STC51)

Publisher:sumigLatest update time:2022-08-19 Source: csdn Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1.4.1. Complete Introduction to the Development Board


1.4.1.1 Version

(1) Our course is based on the Puzhong Technology STC89C51 development board kit V3.0 (high configuration), which is compatible with V2.2 (for details, please go to the first lesson)

(2) The code is based on V3.0. If you find any problems with V2.2, please contact me.

(3) The price of a single development board is RMB 168 (V3.0 high configuration). If you need it, you can go to Taobao to buy it. No advertising is done here.


In addition, Puzhong Technology also has a development board supporting course on Bilibili, which is the same development board used in this course.


Link: https://www.bilibili.com/video/av32132894/ The response was not very good.


1.4.1.2 Accessories

(1) There are 12 items in total, including the development board, including the main board, Dupont wire, crystal oscillator and jumper cap, USB cable (Android phone cable), stepper motor, DC motor, infrared remote control, 1 1602 screen, 1 12864 screen, 2.2/2.4 inch TFT touch screen, STM32 core board, and DS18B20 temperature sensor. The items in bold are temporarily needed, and the rest can be left alone.


Unboxing video: Bilibili (not filmed yet)


Overall picture of the development board:

Other Accessories:

(2) Development board supporting information: Baidu Netdisk Extraction code: 2020 

(3) There are many small parts, so don’t lose them (if you lose them, you will have to buy new ones, which is not expensive but a waste of time)

(4) Do not plug the jumper cap into the board at will to avoid damaging the hardware.

(5) It is recommended to take out unused parts and store them in a cabinet. Carrying them around in boxes can easily cause them to get damaged.

(6) The STM32 core board will not be useful until the third quarter


1.4.2. Introduction to the development board mainboard and onboard components


1.4.2.1. Single-Chip Microcomputer

(1) First, be careful not to install it upside down (the MCU has a groove facing the rod), the worst result is that it will burn out.

(2) Second, be careful not to remove the 51 chip when the power is on. Don't take it off unless necessary. Don't be careless. (Although hot-swappable is available now)


ps: I once had a psychological trauma because I plugged and unplugged something while it was powered on. In the end, the power switch burned out, and the entire row of sockets burned out.


The microcontroller in the real project is soldered on the board.



1.4.2.2. Necessary peripheral circuits for single-chip microcomputer operation (necessary for single-chip microcomputer)


(See the ARM3.0 development board CD-ROM data course supporting the EM3_V3.0 development board schematic diagram 1)

(1) Crystal oscillator (crystal oscillator + power on == maintain synchronization, the crystal oscillator is connected to the crystal oscillator circuit inside the chip)

(2) Reset circuit (reset: can also be seen on the board)

(3) Power supply circuit (power module: 5V connection can work)

(4) USB automatic download circuit (a little knowledge is enough, but no problem if you don’t know how to do it)


We will analyze these circuits when we use them later, so let’s talk about the operation first.

1.4.2.3 Other peripheral device circuits

(1) Digital tube (different control methods are divided into static digital tube (individual control) and dynamic digital tube (matrix control))

(2) Dot matrix (16*16 LED)

(3) Independent buttons & matrix buttons

(4) Introduce one by one (lecture in class)


First, we will talk about simple peripherals, and then we will play with high-end peripherals and protocols...


There are no advanced peripherals, such as Bluetooth, Zigbee, and WIFI.


1.4.3. Preparation before power on

The microcontroller can be powered by a power bank, and the circuit board requires very low current to start up.


1.4.3.1. Check whether the relevant jumper caps are OK

(1) The development board is compatible with 51 and STM32 (and AVR) through jumper cap design: the jumper caps and DuPont wires should be checked in advance to determine which development board it is.

(2) The default setting of the 51 MCU is used when it is shipped (do not change it for now)

(3) Perform 7 checks on the "How to use the development board.doc" document in the root directory of the development board CD-ROM. 


1.4.3.2. Install the onboard CH340 chip driver

(1) The onboard CH340 chip is used to complete the USB to serial port conversion to realize the program download and burning function

(2) Puzhong 51-Dual-core-A7 development board data 1--Newbies must read Puzhong 51-Dual-core-A7 development board introductory tutorial.pdf Follow these steps

(3) If this doesn't work, you can let the computer automatically search and install the driver or use software such as Driver Master to install it.


Note: The USB cable should always be plugged into the same USB port on the computer. Do not move it casually.


1.4.4. Learn to download programs to the microcontroller and run them

Read the Puzhong 51-Dual-core-A7 development board information 1--Newbies must read the Puzhong 51-Dual-core-A7 development board introductory tutorial.pdf

1.4.4.1、Download using PZ_ISPv1.88

Summary: Puzhong's own download software is easier to use. The development board is powered on before downloading, and the power supply of the development board does not need to be turned on during the entire download and running process. After downloading, the program will run automatically, and the program can be downloaded again while it is running.


1.4.4.2. Download the program using STC-ISP

(1) The STC official software download is a little more troublesome than the PZ_ISP download. PZISP is a software download that is operated directly after power-on, while the STC-ISP software download requires a cold start, that is, click download first and then turn on the power, which is a more complicated operation. The program can be downloaded and run directly after downloading.

(2) If you want to download again, you must turn off the power -> click the download button -> turn on the power to successfully download.

It is recommended to use the download tool STC-ISP, which is universal.


Note: The chip type must be correct. If the baud rate is too high, the download may fail. Lower the baud rate. If the baud rate is very low, select low-speed download.


Next, start running the sample program and practice by observing the phenomenon!

How to connect --> How to download --> What happens



1.4.5. Download and test the official sample program 1 (LED, button, buzzer)


(1) LED flashing and LED running lights


      Wiring: J19 to J22 


      Power on the development board 


      Download program: PZ-ISP/STC-ISP Select 51 routine 1, LED light 1 LED flashing C version LED2.hex, etc.


       Seeing the phenomenon

(2) Independent buttons 


     Wiring: J19 to J22 && JP1 to J29 


      Power on the development board 


      Download program: PZ-ISP/STC-ISP Select 51 routine 2, independent buttons 8 buttons control 8 LED lights pro.hex, etc.


       Seeing the phenomenon


(3)Buzzer


      Wiring: P15 to buzzer 


      Power on the development board 


      Download program: PZ-ISP/STC-ISP Select 51 routine 3. Buzzer Buzzer test Happy Birthday buzz.hex


       Hearing the phenomenon


Problem: I followed the documentation correctly but could not download. The solution is:

1) Go back step by step to the previous download state to see if the problem can be solved

2) Power off the entire development board completely (unplug the USB power cable) for more than 3 seconds and then power it back on



1.4.6. Download and test the official sample program 2 (digital tube, LED dot matrix, motor, clock)


(1) Static digital tube


      Wiring: J8 to J22 


      Power on the development board 


      Download program: PZ-ISP/STC-ISP Select 51 routine 6, static digital tube display digital tube flow display pro.hex


       Seeing the phenomenon


(2) Dynamic digital tube


      Wiring: J6 connected to J22 P22-P24 connected to ABC digital tubes respectively


      Power on the development board 


      Download program: PZ-ISP/STC-ISP select 51 routine 7, dynamic digital tube dynamic display digital (with decoder) program pro.hex, etc.


       Seeing the phenomenon


(3)LED dot matrix


       Not adjusted yet.


(4) Stepper motor 


       Wiring: 0A-B-, 0B to B+, 0C to A-, 0D to A+, 1A-1D to P10-P13   


      Power on the development board 


      Download program: PZ-ISP/STC-ISP Select 51 routine 10, stepper motor L6219-four-wire bipolar motor, etc.


       Seeing the phenomenon

(5) Real-time clock DS1302


- LCD1602 display clock


      Wiring: 0A-B-, 0B to B+, 0C to A-, 0D to A+, 1A-1D to P10-P13 


      Power on the development board 


      Download program: PZ-ISP/STC-ISP Select 51 routine 10, stepper motor L6219-four-wire bipolar motor, etc.


       Seeing the phenomenon


- Digital tube display clock

      Wiring: See wiring diagram


      Power on the development board 


      Download the program:


       Seeing the phenomenon



1.4.7. Download and test the official sample program 3 (temperature sensor, remote control, AD)


(1) 18B20 temperature sensor


    Using LCD1602 display


    Plug LCD1602 J14 to P37


    Power on and download the program: 51 routine 15, temperature sensor DS18B20LCD1602 display temperature program pro.hex


    Look at the phenomenon

(2) Infrared remote control


    Using LCD1602 display


    Plug in LCD1602 J11 to P32


    Power-on download program: 51 routine 19, infrared LCD1602 display key value program pro.hex


    Look at the phenomenon


(3)AD


Digital tube displays AD value


The wiring diagram is as follows. Power on, download the program, and observe the phenomenon.

1.4.8. Download and test the official sample program 4 (color screen)


(1) Touch screen


Plug in color screen


Download program: Puzhong 51-dual-core-A7 development board data Playing with TFTLCD touch screen--based on 51 single-chip microcomputer GUI design 3, TFTLCD touch screen experiment--Chinese character display Outputtemplate.hex


This class is over!


Reference address:[STC MCU Learning] Lesson 4: Understand your development board (STC51)

Previous article:[STC MCU Learning] Lesson 5: Necessary preparations before writing code
Next article:Automatic digital voltage meter emulation digital tube display based on 51 single chip microcomputer ADC0808

Latest Microcontroller Articles
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号