Home 8051 8051 Code

8051 Code

C8051F340 flashing led example

This LED flashing example was written for a C8051F340 dev board connected to a DVK501 board by Waveshare, the basic example will simply toggle...

8051 7 Segment display program written in Basic

While browsing through the mikroelectronika website and looking at available downloads, I noticed their Basic compilers for various microcontroller architectures. So after downloading the...

8051 and 7 segment displays

Its fairly straightforward to connect  a 7 segment display to your 8051 processor, in this example we will do this and show a code...

8051 and RGB LED example

In this example we connect an RGB LED to our 8051. In this case we used an RGB LED breakout, this was a common...

mikroC Pro and 8051 development

Recently I purchased several 8051 type development boards from China, most of the examples were written in Keil. As a test I decided to...

8051 switch input example

A very simple example that toggles a set of 8 LEDs based on whether a switch is pressed or not The switch is connected to...

LED count down

This is a hexadecimal counter using LEDs. It will start at 0xFF and count down 1   Code #include <reg52.h> void delay(unsigned int i); main() { unsigned char Num = 0xff; while...

8051 rotating LEDs examples

Again using the ARm + 8051 development board Example 1 #include<reg52.h> void Delay(unsigned int t); void main (void) { unsigned char i; Delay(50000); P2=0x7f; while (1) { for(i=0;i<8;i++) { Delay(50000); P2>>=1; P2=P2|0x80; } P2=0x7f; } } void Delay(unsigned int t) { while(--t); }     Example 2   #include<reg52.h> void Delay(unsigned int t); void...

Flashing leds 8051 example

This example was written using Keil UV2, the board in question was a 8051/ARM development board that I purchased from China. The micro was a...