BASIC52 Controller, STC12C5A60S2
Wichit Sirichote, wichit.sirichote@gmail.com

New design BASIC52 controller using STC12C5A60S2 single cycle 8051 compatible microcontroller and Ferro-electric memory.


The new design BASIC52 controller is built with STC12C5A60S2, single-cycle 8051 compatible chip and a 32kB Ferro-electric memory. The controller board has preloaded the BASIC-52 interpreter with add-on functions for full access of STC's special function registers. The kit has an extra input port and output port, an RV09 pot for 0-5V analog test signal, a 10-bit bar display, and an optional text LCD port. The BASIC program can run with simple mode switch, when set to AUTO the program will start run after power on easily.

Hardware

The main MCU, U6 is the STC12C5A60S2, a 40-pin DIP package, running with 12MHz xtal. The external memory chip, U2, is 32kB RAM FM1808, Ferro-electric memory. The memory and I/O space allocation are provided by PLD chip, U4 GAL16V8. U3 74HC573 is an onboard GPIO1 LED. U5 74HC541 is an 8-bit digital input port, the lower 4-bit is available at SIP connector, the upper 4-bit is tied to the onboard push button switches, S2, S3, S4 and S5. U7 74HC573 is an 8-bit digital output port, all 8-bit port are available at JR3 SIP connector. The board is powered with +5V from a USB port.

Hardware Features

MCU: STC12C5A60S2, 60kB Flash with BASIC52 interpreter
Memory: 32kB Ferro-electric RAM
Input/Output: 8-bit output port, 4-bit input port
Onboard display: 8-bit bar display, Text LCD (optional)
Onboard key switch: 4 switches push button
ADC: 10 bit, P1.0 to P1,7
Mode selector: AUTO and PROG

Quick start with BASIC52

The controller board uses 9600 terminal for BASIC program writing. The kit is preloaded with an LED running program.

To enter PROG mode, select J1 position for PROG, the Press SW1 to reset the kit.

Type list command, to list the program.

The program is very simple to understand.

Variable N is loaded with 1.

Then write to GPIO1 LED at location 8000H using XBY(8000H) command.

Update the variable by left shift one bit.

Pause some delay by calling subroutine 60

Then repeat the loop.

Loading BASIC program

BASIC programs can be written in any PC editor. To load the program, set a delay for character 50ms and line delay of 100ms. Then click File Sending.

Here is the sample program for testing program running.

The running output is shown below.

ADC Testing program

The STC12C5A60S2 chip has a built-in 10-bit ADC converter. The ADC inputs use P1.0 to P1.7 for 8-channel analog input.

The kit has RV09 POT for ADC testing at P1.0. S1 selector channel1 selects between P1.0 digital I/O or Analog input signal. To test ADC with the onboard RV09 POT, select the ADC0 position.

This program demonstrates how to access the STC12x chip's special function registers.

Adjust the RV09 POT, the readings will be changed from 0 to 1023.

 

PARTS LIST

Semiconductors

U1,U3,U7 74HC573
U2 FM1808, 32kB Ferro Electric memory
U4 GAL16V8B
U5 74HC541
U6 STC12C5A60S2, 60kB Flash single cycle 8051 compatible microcontroller
U8 CH340HW-728, USB-serial interface
U12 SSA-LXB102, 10 segment bar display

D10 1N5227
D12 1N4148
D13 1N5231 5.1Vz 1/2W zener diode

Resistors (all resistors are 1/8W +/-5%)

R1, R10 100
R2 680
R3, R4, R5, R8 10k
R6 RESISTOR SIP 9
R9, R7 1k
R11 20
R12 4k7

Capacitors

C1,C2 27pF, ceramic capacitor
C3,C4,C8,C9,C10,C11,C12, C13 100nF, multi layer capacitor
C5,C6,C7 10uF electrolytic capacitor
C14 220uF electrolytic capacitor

Additional parts

JR1,JR2,JR3 CONN RECT 16
CON3
LS1 SPEAKER
Q1 12MHz, SMD XTAL
Q2 BC557, PNP transistor

SW1 SW SPDT
S1 SW DIP-2
S2,S3,S4,S5 12x12mm tact switch
S6 6x6mm tact switch
PCB double side plate through hole
JR2, JR3 optional 16 pin SIP header

Download

Hardware schematic, BASIC52 and BASIC test programs , PLD file , STC12C5A60S2 Datasheet, FerroElectric Memory

More technical information, please contact Wichit Sirichote, wichit.sirichote@gmail.com


<

Last updated October, 2025

October 2025