8051 Software Uart C Code Compiler

How do I write a C program to echo characters coming in the 8051's serial port? The functions _getkey and putchar perform serial I/O using the on-chip serial port. These routines are included in the C51 libraries and source for each is included in the C51 LIB directory. The main criteria for UART communication is its baud rate. Both the devices Rx/Tx should be set to same baud rate for successful communication. For the 8051 the Timer 1′ is used to generate the baud rate in Auto reload mode.

HomeProductsTeensyBlogForum
You are here:8051 ToolsMain Page
PJRC Store
8051 Board, $79
LCD 128x64 Pixel, $29
LCD 16x2 Char, $14
Serial Cable, $5
9 Volt Power, $6
More Components...
8051 Tools
Main Page
Software
PAULMON Monitor
Development Board
Code Library
89C2051 Programmer
Other Resources

Mailing List

If you'd like to receive announcements of new additions to this site,updates and changes, and new versions of the various pieces of code;just fill in this very simple form. I rarely send announcements out, soyou won't get flooded with messages.

AS31 Assembler & SDCC C Compiler

AS31 is a free 8051 assembler originally written byKen Stauffer.Versions of AS31 found here include important bug fixes and added features, such as standard intel-hex outputformat for use with PAULMON2 and EPROM programmers.AS31 is a good tool for building small 8051-based projectsthat are written in 100% 8051 assembly language.

SDCC is a free C compiler written by Sandeep Dutta,Micheal Hope, Alan Baldwin, John Hartman, Dmitry S. Obukhov,Jans J Boehm, Alan J Demers, Jean Loius-VERN, Daniel Drotos,Kevin Vigor, Johan Knol, Scott Dattalo, Karl Bongers,and others. More details are available at theofficial SDCC website. The SDCC available here, with '-pj#' added to theversion number, is a modified version that includes someadditions to better support the 8051 developement boardsavailable at this site.

GNU Make is written by Richard Stallman and Roland McGrath,as part of the Free SoftwareFoundation's GNU's Not Unix project.

Linux Download and Installation Instructions

  • AS31 2.0beta3 Source Code (82k download)
  • SDCC 2.3.1-pj2 Source Code (2.8M download)
  • Compiling AS31 and SDCC on Red Hat 7.1 with gcc 2.96.

Windows Download and Installation Instructions

  • SDCC C Compiler and AS31 Assembler and GNU Make Win32 Binaries (1.1M download)

SDCC and GNU Make are Free Software providedunder the GNU General Public License (GPL). AS31 is alsoFree Software, provided under the BSD license.The standard C libraries provided with SDCC are covered by the termsand conditions of the GNU Lesser General Public License (LGPL).

SDCC, AS31, and Gnu Make are distributed in the hope that they willbe useful, but without any warranty; without even the impliedwarranty of merchantability or fitness for a particularpurpose.

A copy of the old as31 page is stillavailable.

PAULMON 8051 Family Monitor/Debugger

  • The original version is still available.

PAULMON is a user-friendly 8051 family monitor, intended for usein a single board computer like the development board below. Byplacing PAULMON in the board's EPROM, the board will 'boot-up' toa friendly menu-driven monitor which allows you to download yourprograms to RAM and run them, which is much faster and easierthan reprogramming the EPROM. PAULMON also provides several featuresto help you debug your programs, including adisassembler and single-step program execution.

It is veryeasy to use and together with an 8051 family assembler, such asthe one above, it provides a very low-cost 8051 developmentsystem.PAULMON is in the public domain. You may use piecesof the code in your own programs and even incorporate the codeinto your own commercial products, if you wish.

Download PAULMON2 Source or Object Code.Nearly everything is improved andseveral new features have been added... generally much betterthan version 1, even in the beta versions.Documentation for PAULMON2 isavailable on-line.

PAULMON1 was originally developed in the Fall of 1991 in aboutfour weeks. The code has remained fixed, but my own needs havechanged from project to project over the years. These changes,additional features, plus a major overhaul of the existing codeis finally available asPAULMON2.

Low-Cost 8051 Development Board Design

This 8051 development board provides an easy and low-cost way todevelop projects based on the 8051 microcontroller, without theneed to purchase any other equipment, such as EPROM programmersor emulators.

Figure 1: 8051 Development Board, Rev 4, With 16x2 LCD

Important Features:

  • PAULMON2 v2.1 Monitor, easy to learn and use. All PAULMON2 sourcecode is available for free download, andmay be used without any restrictions, even for copy-and-paste intoyour own programs.
  • Flash ROM for non-volatile storage of downloaded programs, toallow the board to permanently run the downloaded program,without the PC computer. No EPROM programmer is needed to makethe board permanently run your application. The Flash ROM canalso be used for data logging.
  • Two serial port connectors w/ on-board mux, allowing easierdevelopment of applications which require the serial port
  • 32 I/O Signals, and 8 Bit Bus signals, clearly labeled on the board
  • Large prototype area to add custom circuits

The older versions are still on line:Rev 3 (2001)Rev 2 (1997), andRev 1 (1992).Parts for these boards are no longer available.


8051 Code Library

I've written quite a lot of 8051 code in the lastfew years. Here are some free bits and piecesof code that may be useful, along with some minimal documentation.

These 8051 code examples are distributed in the hope that they willbe useful, but without any warranty; without even the impliedwarranty of merchantability or fitness for a particularpurpose.

Paul's Code Library

All of these are in the public domain.
  • AMD Flash ROM Program and Erase Routines -- incomplete
  • Xilinx FPGA Configuration Programming -- incomplete

Contributed Works

Refer to the author's comments for license details, if any.
  • Tiny Basic For 8051 ported to PM2 by Dave LeBlanc.
  • LCD Display Routines and a simple schematic by Dzidek & Ogest.
  • LCD Display via 82C55 by Ben Loveday.
  • LCD Display Driver by Ho Weng San
  • Xilinx Download and readback for XC3090 by Craig Jackson
  • Misc code library by Stephan Joubert also in a ZIP file.
  • AT89C2051 programmer, the code is in this ZIP file by Paul Hoepping

Atmel 89C2051 in-circuit programmer

TheAtmel 89C2051is a 20 pin version of the popular 8051 microcontroller.It's got only 2k of built-in program memory, but it's Flash ROM, so youcan easily reprogram the chip without the UV erasure step. This reallycool Atmel version has all of the normal 128 bytes of ram (unlike someother low-cost 20 pin 8051 family members) and they even left the built-inUART built-in. It's got some other features, but best of all, it costsonly about $5(US) from Marshall in single piece quantities.Please keep in mind that neither I nor Oregon State Universityrepresent Atmel or Marshall.

I have designed and built a simple programmer for this cool partwhich can reprogram it in-circuit. You place the 89C2051in this board, and connect the board to your project's 20 pinsocket with a ribbon cable. You can download code to the programmer,reprogram the Atmel chip, and then place the chip back into thecircuit. Since it's Flash ROM, no UV erase step is required. Youcan reprogram and test your code without moving the chip betweensockets. As well, the programmer supports an 'echo-thru' mode, wherethe 89C2051's UART output is echoed to the terminal controlling the89C2051 in-circuit programmer, but only while the 89C2051 is runningin-circuit.

To get started now, the design is quite similar to thedevelopment board example above, with the addition of the followingchips: 74HC00, CD4007, and four CD4066. The three unused ANDgates in that example are used here. Two NPN and one PNP small-signaltransistors are needed, as well as a 12 volt power supplyfor the programming voltage and 4000 series logic.Only one of the 82C55's is used, but one 82C55 is required.BETA Version 0.004 is now available, alsoin ZIP format.As well, BETA Version 0.003 is still available,but 0.004 is much easier to use.

Someday more reasonable documentation and a schematic of therequired hardware will appear. For now, thisbeta release schematic is availablefor those who want to try to add the hardware support to anexisting development board.

Other Resources

Paul's 8051 Tools, Projects and Free Code Offerings; Paul Stoffregen
http://www.pjrc.com/tech/8051/index.html
Last updated: February 24, 2005
Status: Pretty good, atmel icp in beta, missing some docs for code.
Suggestions, comments, criticisms, things you want??<paul@pjrc.com>

C8051 is a microcontroller (MCU) core produced by Silicon Laboratories, Inc. It is based on a patented implementation of the 8051 instruction set architecture.[1]

  • 2Families
  • 3Nonfree Development tools
  • 4Free Development tools

Overview[edit]

The C8051 is a ‘hard wired’ implementation of the 8051 microcontroller CPU, as opposed to the original micro-coded version. The instruction set is mapped to a basic two-stage pipeline to increase throughput while maintaining an 8-bit program memory width. The result is a high-performance 8051 microcontroller architecture that executes most instructions within 1 or 2 clock cycles and delivers 20 to 25 times the performance of the original 8051 core.[1]

Families[edit]

Analog Intensive[edit]

ADC resolutions range from 10 to 24 bits, and other on-chip analog peripherals include DACs (resolutions to 12-bits), a voltage reference, comparators, a temperature sensor, programmable gain array (PGA) and oscillators. Digital peripherals can include external memory interface, timers, programmable counter array (PCA) modules and UART, USART, SPI, I²C/SMBus, I2S and more.[2]

Part NumberFlash MemoryMIPSRAMPackagesOther
C8051F00x/1x16-32 kB20-250.25-2 kBQFP32, QFP48, QFP6416x PGA
C8051F02x64 kB254.25 kBTQFP64, TQFP100-
C8051F04x32-64 kB254.25 kBTQFP64, TQFP10060V PGA
C8051F06x32-64 kB254.25 kBTQFP64, TQFP100DMA
C8051F12x/3x64-128 kB50-1008.25 kBTQFP64, TQFP10016x16 MAC
C8051F35x8 kB500.75 kBQFN28, LQFP32-

Ultra low power[edit]

The ultra-low power C8051 MCUs are designed to minimize power consumption across active and sleep modes and to provide the fastest wake-up times possible.[3]

Part NumberFlash MemoryMIPSRAMPackagesActive/Sleep PowerOther
C8051F90x/1x8-16 kB250.75 kBQSOP24, QFN24160 µA/MHz / 50 nAdc-dc; RTC
C8051F92x/3x64 kB254.25 kBQFN24, QFN32, LQFP32170 µA/MHz / 50 nAdc-dc; RTC
C8051F96x16-128 kB258.25 kBQFN40, DQFN76, TQFP80110 µA/MHz / 50 nAAES; LCD; dc-dc
C8051F98x/9x2-8 kB250.5 kBQFN20, QFN24, QSOP24150 µA/MHz / 10 nATouch; RTC

Automotive and industrial[edit]

Silicon Labs' automotive and industrial microcontrollers (MCUs) are auto-grade products qualified and tested to the AEC-Q100 specification with high temperature operation up to 125 °C. The C8051F5xx industrial and automotive microcontrollers include a CAN 2.0B interface, LIN 2.1 interface, an integrated precision oscillator (±0.5%) that allows full spec operation without an external crystal oscillator and 1.8 to 5.25 V supply voltage. Both the C8051F5xx and C8051F85x/6x families feature a 12-bit ADC and are implemented in small form factor packages.[4]

Part NumberFlash MemoryMIPSRAMPackagesOther
C8051F85x/6x2-8 kB250.25-0.5 kBSOIC16, QFN20, QSOP24LFO
C8051F50x/1x32-64 kB504.25 kBQFN32, QFP32, QFN40, QFN48, QFP48LIN2.1; ±0.5% osc
C8051F52x/3x2-8 kB250.25 kBDFN10, QFN20, TSSOP20LIN2.1; ±0.5% osc
C8051F54x8-16 kB501.25 kBQFN24, QFN32, QFP32LIN2.1; ±0.5% osc
C8051F55x/6x/7x16-32 kB502.25 kBQFN24, QFN32, QFP32, QFN40CAN2.0B; ±0.5% osc
C8051F58x/9x96-128 kB508 kBQFN32, QFP32, QFN40, QFN48, QFP48CAN 2.0B; ±0.5% osc

Broad based/small form factor[edit]

These small MCUs include up to 100 MIPS CPU, 12-bit ADC, 12-bit DACs and other vital analog peripherals such as integrated precision oscillator (±2%) and precision temperature sensor (±2 °C). Cost-sensitive pin-compatible one-time programmable (OTP) options are also available.[5]

Part NumberFlash MemoryMIPSRAMPackageOther
C8051F85x/6x2–8 kB250.25–0.5 kBSOIC16, QFN20, QSOP24Vref; LFO; 105 °C
C8051F2xx8 kB250.25-1.25TQFP48-
C8051F30x*2–8 kB250.25 kBQFN11, SOIC14-
C8051F31x*8–16 kB251.25 kBQFN28, LQFP32-
C8051F33x*2–16 kB250.75 kBQFN20, QFN24Vref; LFO; DAC
C8051F36x16–32 kB50–1001.25 kBQFN28, LQFP32, TQFP48Vref; EMIF; 16x16 MAC
C8051F37x/9x8–16 kB501 kBQFN24, QFN20Vref; 105 °C; EEPROM; ±2 °C temp. sensor; DACs
C8051F41x16–32 kB502.25 kBQFN28, LQFP32Vref; RTC; DACs

* C8051F30x, C8051F31x, and C8051F33x are also available with one-time-programmable memories as C8051T60x, C8051T61x, and C8051T63x respectively.

USB[edit]

These devices feature an on-board universal serial bus (USB) 2.0 function controller with an integrated transceiver and on-chip clock recovery, and are available in a wide range of packages. No external resistors, crystal, voltage regulator, EEPROM or other components are required.[6]

Part NumberFlash MemoryMHzRAMPackagesOther
C8051F32x**16 kB481.25-2.25 kBQFN28, LQFP32Crystal-less
C8051F34x*32-64 kB482.25-4.25 kBQFN32, LQFP32, TQFP48Crystal-less; EMIF
C8051F38x**32-64 kB481.25-4.25 kBQFN32, LQFP32, TQFP48Crystal-less; EMIF

* Legacy product, replaced by C8051F38x.

** C8051F32x and C8051F38x are also available with one-time-programmable memories as C8051T32x and C8051T632x respectively.

Capacitive touch sensing[edit]

Silicon Labs' capacitive touch sense microcontrollers (MCUs) enable implementation of touch buttons, sliders, wheels, capacitive proximity sensing and liquid level sensing.[7]

Part NumberFlash MemoryMHzRAMPackagesOther
C8051F7xx8-32 kB250.5-8 kBQFN24, QFN32, QFN48, QFP48, QFP6418-38 touch ch.
C8051F8xx4-16 kB250.25-0.5 kBSOIC16, QFN20, QFN24, QSOP248-16 touch ch.
C8051F99x8 kB250.5 kBQFN20, QFN24, QSOP2413-14 touch ch.

Wireless[edit]

The Si10xx wireless MCU family offers single-chip solutions that combines an MCU and an integrated sub-GHz RF transceiver. These products are designed to address the specific requirements of low-power embedded systems requiring an RF bidirectional communication link.[8]

Best 8051 compiler
Part NumberFlash MemoryMHzRAMPackageOther
Si100x32-64 kB254.25 kBLGA42CRC; dc-dc; RTC
Si101x8-16 kB250.75 kBLGA42CRC; dc-dc; RTC
Si102x/3x128 kB254.25-8.25 kBLGA85128 LCD segments

USB connectivity bridges[edit]

The CP21xx family offers a plug-and-play interface solution that support VCP, USBXpress, HID, and USB Audio driver suites on Windows, Linux, and OSX. These devices support Crystal-less operation and in-system programming memory.[9]

Part NumberDescriptionDriver TypeGPIOsPackageOther
CP2101*USB to Dual UART BridgeVCP, USBXpress-QFN285 V regulator
CP2102**USB to UART BridgeVCP, USBXpress-QFN285 V regulator
CP2103*USB to UART BridgeVCP, USBXpress4QFN285 V regulator; RS-485
CP2104USB to UART BridgeVCP, USBXpress4QFN245 V regulator; RS-485; Split Vio
CP2105USB to Dual UART BridgeVCP, USBXpress5QFN245 V regulator; RS-485; Split Vio
CP2108USB to Quad UART BridgeVCP, USBXpress16QFN645 V regulator; RS-485; Split Vio
CP2109USB to UART BridgeVCP, USBXpress-QFN285 V regulator
CP2110HID USB to UART BridgeHID10QFN245 V regulator; RS-485; Split Vio
CP2112HID USB to SMBus/I²C BridgeHID8QFN245 V regulator; Split Vio
CP2114USB to I2S Audio BridgeUSB Audio12QFN325 V regulator; Split Vio
CP2130USB to SPI BridgeWinUSB, LibUSB11QFN245 V regulator; Split Vio

* Legacy product, replaced by CP2104.

** Lower cost alternatives available as CP2104 and CP2109 (footprint compatible).

Nonfree Development tools[edit]

Silicon Labs offers both software and hardware development tools to support their C8051 MCUs. A complete list of development boards and kits is available on the company's website.

ToolStick[edit]

The Silicon Labs ToolStick is a development system that allows designers to develop and debug application firmware directly on the target microcontroller using the Silicon Labs Integrated Development Environment (IDE). Once complete, designers can replace the Daughter Card with a Programming Adapter and program blank devices for use in their actual system.[10]

Silicon Labs IDE[edit]

The Silicon Labs Integrated Development Environment (IDE) is a complete, stand-alone software program that includes a project manager, source editor, source-level debugger and other utilities. The IDE interfaces to third party development tool chains to provide system designers a complete embedded software development environment. The IDE supports the entire 8-bit microcontroller (MCU) portfolio.

Keil® PK51 Developer’s Kit[edit]

The Keil PK51 Developer’s Kit includes an industry-leading 8051 C compiler, linker and assembler for use with Silicon Labs’ 8-bit microcontrollers and Studio. This toolchain package provides the build support for 8051 projects, while the IDE provides editing and debugging support. This free toolchain comes without a time or code size limit.[10]

Other tools and utilities[edit]

Configuration Wizard

The Configuration Wizard 2 utility helps accelerate development by automatically generating initialization source code to configure and enable the on-chip resources needed by most design projects. In just a few steps, the wizard creates complete startup code for a specific Silicon Labs MCU.[10]

Flash Programming Utilities

The Flash Programming Utilities allow designers to download code to a device and perform other memory operations without needing to use the Silicon Labs IDE. These utilities are static examples of the C8051Fxxx On-Chip Interface Utilities DLL detailed in application note AN117. The downloaded installation utility installs both the Windows Flash Programming Utility and the Command-line (32-bit) Flash Programming Utility.[10]

Debug Driver for Keil µVision Software

The µVision debug driver allows the Keil µVision IDE to communicate with Silicon Labs on-chip debug logic. In-system Flash memory programming integrated into the driver allows you to rapidly update target code. The µVision IDE can be used to start and stop program execution, set breakpoints, check variables, inspect and modify memory contents and single-step through programs running on your actual target hardware.[10]

Free Development tools[edit]

The C8051 is also supported by FOSS tools.

Small Device C Compiler[edit]

The Small Device C Compiler is an optimizing standard (ANSI C89, ISO C90, ISO C99, ISO C11) C compiler. It supports the C8051 via the mcs51 backend.

ec2drv[edit]

ec2drv provides Linux support for the serial debug adapter. In particular, it can be used for programming the flash memory of the C8051.

References[edit]

8051 Software Uart C Code Compiler Download

  1. ^ abSilicon Laboratories, Inc.
  2. ^Silicon Laboratories, Inc. - High-Performance, Analog-Intensive Microcontrollers
  3. ^Silicon Laboratories, Inc. - Ultra-Low-Power Microcontroller ICs
  4. ^Silicon Laboratories, Inc. - Automotive and Industrial Microcontrollers
  5. ^Silicon Laboratories, Inc. - Small Form Factor Microcontrollers
  6. ^Silicon Laboratories, Inc. - USB Microcontrollers
  7. ^Silicon Laboratories, Inc. - Capacitive Touch Sense MCUs
  8. ^Silicon Laboratories, Inc. - Wireless Microcontrollers (MCUs)
  9. ^Silicon Laboratories, Inc. - USB Connectivity Bridges
  10. ^ abcdeSilicon Laboratories, Inc. - 8-bit Microcontroller Studio, Individual Components

Best 8051 Compiler

Retrieved from 'https://en.wikipedia.org/w/index.php?title=C8051&oldid=902461827'