I'm trying to control a LCD screen from my PC. I have a W78E52B MCU with a sample code written in a .c file which I want to compile and upload to the device, preferably from a Linux environment for automation purposes.

The code looks like this:

sbit RES=P3^5;
sbit CS1=P3^3;
sbit A0=P3^0;
sbit E=P3^2;
sbit RW=P3^1;
sbit DB0=P1^0;
sbit DB1=P1^1;
sbit DB2=P1^2;
sbit DB3=P1^3;
sbit DB4=P1^4;
sbit DB5=P1^5;
sbit DB6=P1^6;
sbit DB7=P1^7;
sbit key1=P3^4;
sbit key2=P3^6;
sbit key3=P3^7;

What tool do I use to build this program into a hex/binary which can be transferred to the MCU? What is the relation between "8051" that I see here and there, and the MCU that I have?

  • 1
    \$\begingroup\$ A C compiler. You have a 8051-compatible MCU. \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 2 '15 at 6:41
  • \$\begingroup\$ The only non-proprietary C compiler I know of is SDCC. It doesn't compile due to a missing intrins.h. \$\endgroup\$ – miluz Jun 2 '15 at 14:12

W78E52B MCU is a 8051-based microcontroller from Nuvoton IC manufacturer. So that there is no difference between any other 8051 based microcontroller (like At89s52) and W78E52B MCU.

For compiling your program from linux environment you need a compiler.

  • \$\begingroup\$ Which? I tried sdcc and it couldn't find intrins.h. Keil seem to work but it doesn't run on Linux, and the evaluation version doesn't build the program. \$\endgroup\$ – miluz Jun 2 '15 at 7:26
  • \$\begingroup\$ Try with SDCC - Small Device C Compiler at sdcc.sourceforge.net \$\endgroup\$ – KernelPanic Jun 2 '15 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.