Sale!

STC89C52 Development Board

Original price was: 2,65 €.Current price is: 2,31 €. Excluding VAT

YS 51 Development Board on STC Single Chip System Board Mini Microcomputer

4 in stock (can be backordered)

Domande su questo prodotto? Scrivi a Lana su WhatsApp

🎬 The product on video

Description


🔧 YS-51 Development Board – Complete Description

📌 Overview

The YS-51 is a development board designed around the microcontroller STC89C52, belonging to the family STC (Single-chip microcomputer). It is an 8051-compatible microcontroller widely used in educational settings and for low-cost embedded applications.

🧠 Main Features

Feature Description
Microcontroller STC89C52RC (Intel 8051 compatible)
Clock 11.0592 MHz quartz oscillator (typical)
Internal RAM 128 bytes
EEPROM/Flash 8KB (programmable via UART)
GPIO 32 I/O pins (4 ports of 8 bits)
Interfaces UART, Timer, Interrupt, SPI/I2C (via bit-banging)
Operating Voltage 5V DC
Programming Through TTL serial port (UART)

🔌 Components on the board

  • Status LED
  • Reset button
  • External crystal
  • Serial connector for programming
  • Male connectors for each I/O port
  • Power via USB or pin header

🔗 Compatibility with Arduino

The board YS-51 is not directly compatible with theArduino IDE as the microcontroller STC89C52 is not natively supported by Arduino (like ATmega328p, ATmega2560, etc.).

However, you can:

  • Program the STC89C52 with its official software (STC-ISP).
  • Use Arduino as a serial bridge to upload code to the STC.
  • Or make them communicate via UART as separate devices.

🛠️ YS-51 Programming Guide

1️⃣ Required

  • YS-51 Board
  • USB-TTL Converter (e.g. CH340 or FTDI)
  • Programming Software STC-ISP
  • IDE to write the code: Keil uVision 5 (C language)

2️⃣ Connections for programming

Connect the pins as follows:

YS-51 Pin USB-TTL
TX RX
RX TX
GND GND
VCC 5V

To start the programming:

  1. Press the button RESET on the YS-51.
  2. Start loading from the software STC-ISP.
  3. Release RESET.

3️⃣ Write a simple LED blink program

#include <reg52.h>

sbit LED = P1^0;

void delay_ms(unsigned int ms) {
    unsigned int i, j;
    for (i = 0; i < ms; i++)
        for (j = 0; j < 123; j++);
}

void main() {
    while (1) {
        LED = 0;
        delay_ms(500);
        LED = 1;
        delay_ms(500);
    }
}

4️⃣ Compilation and upload

  • Compile the file .c in Keil uVision → generate file .hex.
  • Open STC-ISP → select the correct COM port.
  • Upload the file .hex to the YS-51.
  • Press RESET to start.

🧪 Examples of Communication with Arduino

➕ Arduino as master UART

Wiring (serial communication):

Arduino YS-51
TX RX
RX TX
GND GND

Arduino Code:

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("Hello from Arduino");
  delay(1000);
}

STC Code (Keil C):

#include <reg52.h>
#include <stdio.h>

void UART_Init(void) {
    SCON = 0x50;  // UART mode 1
    TMOD = 0x20;  // Timer 1 mode 2
    TH1 = 0xFD;   // Baud rate 9600
    TL1 = 0xFD;
    TR1 = 1;      // Start Timer1
    TI = 1;
}

void main() {
    UART_Init();
    while (1) {
        if (RI) {
            RI = 0;
            P1 = SBUF;  // visualizza byte ricevuto su P1
        }
    }
}

🧭 Other Example Projects

  1. LCD 1602 Display with STC
    • Control using compatible 8051 libraries.
  2. Seven Segment Counter
    • Uses Timer + GPIO.
  3. Temperature Sensor (DS18B20 or LM35)
    • Analog Reading (via external ADC) or digital (1-wire).

📚 Useful Resources


📌 Conclusion

The YS-51 is a versatile board for those who want to start with the 8051 architecture. Although it is not directly compatible with the Arduino ecosystem, it can be used to communicate with Arduino or programmed using dedicated tools. It offers an excellent way to learn the basics of traditional microcontrollers.

Let’s start with a specific complete project based on the YS-51 board (STC89C52): Relay control via button and serial communication with Arduino.


🔌 Project: Relay control with STC89C52 and communication with Arduino

🎯 Objectives

  • Connect a button to activate/deactivate a relay module.
  • Receive a command via serial from Arduino to activate/deactivate the relay.
  • Send the relay status to Arduino.

🧱 Required Materials

Component Quantity
YS-51 with STC89C52 1
Arduino Uno/Nano 1
5V relay module 1
Button + 10kΩ resistor 1
Dupont cables various
5V power supply 1

🔌 Connection Diagram

YS-51 → Relay

STC89C52 Relay
P1.0 IN (signal)
GND GND
VCC VCC

YS-51 → Button

Button STC89C52
One end P1.1
Other end GND

Use a internal pull-up or an external 10kΩ resistor between P1.1 and VCC.

YS-51 ↔ Arduino (UART)

STC89C52 Arduino
TX (P3.1) RX
RX (P3.0) TX
GND GND

💾 STC89C52 Code (Keil C)

#include <reg52.h>
#include <stdio.h>

sbit RELAY = P1^0;
sbit BUTTON = P1^1;

void UART_Init(void) {
    TMOD = 0x20;       // Timer1 Mode2
    TH1 = 0xFD;        // 9600 baud
    TL1 = 0xFD;
    TR1 = 1;           // Start timer
    SCON = 0x50;       // UART mode 1, 8-bit, enable RX
    TI = 1;            // Set transmit ready
}

void UART_SendString(char *s) {
    while (*s) {
        SBUF = *s++;
        while (!TI);
        TI = 0;
    }
}

void delay_ms(unsigned int ms) {
    unsigned int i, j;
    for (i = 0; i < ms; i++)
        for (j = 0; j < 123; j++);
}

void main() {
    UART_Init();
    RELAY = 0;  // relè OFF

    while (1) {
        if (BUTTON == 0) {  // premuto (collegato a GND)
            RELAY = !RELAY;  // cambia stato
            UART_SendString(RELAY ? "Relay ONn" : "Relay OFFn");
            delay_ms(500);  // debounce
        }

        if (RI) {
            char cmd = SBUF;
            RI = 0;

            if (cmd == '1') {
                RELAY = 1;
                UART_SendString("Relay ONn");
            } else if (cmd == '0') {
                RELAY = 0;
                UART_SendString("Relay OFFn");
            }
        }
    }
}

💻 Arduino Code (Serial Monitor + Command Sending)

void setup() {
  Serial.begin(9600);
}

void loop() {
  if (Serial.available()) {
    String stato = Serial.readStringUntil('n');
    Serial.println("STC ha risposto: " + stato);
  }

  if (Serial.availableForWrite()) {
    char comando = Serial.read();
    // Comandi manuali da Serial Monitor
    if (comando == '1') Serial.write('1');
    else if (comando == '0') Serial.write('0');
  }

  // Simula un comando automatico ogni 5 sec
  static unsigned long t = millis();
  if (millis() - t > 5000) {
    Serial.write('1');
    delay(2000);
    Serial.write('0');
    t = millis();
  }
}

⚙️ Keil uVision and STC-ISP Installation (Step by Step)

🔽 1. Download the tools


🧰 2. Keil Installation

  1. Start the setup.
  2. During the installation, select “8051 microcontroller support”.
  3. Create a new project:
    • Target: STC89C52RC o Generic 8051
    • Add file .c
  4. Compile (F7) → get file .hex.

💾 3. Use of STC-ISP

  1. Connect the YS-51 via USB-TTL.
  2. Start STC-ISP.
  3. Select:
    • Correct COM port
    • Chip type: STC89C52RC
    • Load file .hex
  4. Press RESET on the board.
  5. Click “Download/Program”.
  6. Wait for confirmation (time: about 3–4 seconds).

✅ Final Test

  • Pressing the button on YS-51, the relay switches on/off.
  • From the Arduino serial monitor, send '1' o '0'.
  • Check the output feedback from STC → Arduino → PC.

Tutorial: How to Use YS 51 Development Board STC

The YS 51 board on STC is ideal for makers who want to explore the world of low-cost microcontrollers. It is a single chip integrated into a complete development board, suitable for both beginners and intermediate developers.

What you need

  • YS 51 Development Board STC
  • USB to micro-USB connection
  • Arduino IDE installed

Steps

  1. Connect the USB cable to the YS 51 board and the computer hardware.
  2. Open Arduino IDE and select ‘STC89C52RC’ as the device in the ‘Tools > Boards’ menu.
  3. Check the firmware version installed on the board. If necessary, download and install the latest version from the official website.
  4. Load an example sketch from the Arduino library (e.g., Blink) to test the connection.
  5. Select ‘File > New’ in Arduino IDE and copy-paste the sketch provided in the tutorial.
  6. Compile and upload the sketch to the YS 51 microcontroller.
  7. Verify the correct execution of the code by monitoring the outputs through the Arduino Serial Monitor.
  8. Explore further functionalities of the board by following the documents provided by the manufacturer.

Example code

// Includi la libreria necessaria
#include <STC89.h>
// Definisci le pin
#define LED_BUILTIN 13
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // Accendi il LED
  delay(1000);                       // Attende un secondo
  digitalWrite(LED_BUILTIN, LOW);    // Spegni il LED
  delay(1000);                       // Attende un secondo
}

Mini project

Create a small night light with the YS 51 STC Development Board. Connect a light sensor and program the board to automatically turn on a light bulb when it gets dark.

Common mistakes

  • Ensure that the Arduino IDE is correctly configured with the settings for the microcontroller.
  • Check the USB connections between the computer and the board.
  • Check for any compilation errors in the loaded code.
  • Check hardware compatibility between the YS 51 board and the development hardware used.

Recommended accessories

  • USB to micro-USB cable
  • JTAG cable for debugging
  • Breadboard
  • Various sensors

Frequently asked questions

Where can I find the datasheet for the YS 51 board?
The datasheet is available on the manufacturer’s website or in the ‘documentation’ folder of the Arduino IDE installation package.

Can I use the YS 51 with programming languages other than C/C++?
Most of the board’s features are accessible through the Arduino IDE, but you may need to install additional libraries to use other languages.

What is the difference between YS 51 and Arduino Uno?
The YS 51 is a low-cost microcontroller with limited functionality compared to the Arduino Uno, but it offers an economical solution for simple projects.

Reviews

There are no reviews yet.

Be the first to review “STC89C52 Development Board”

Your email address will not be published. Required fields are marked *