First contact with the microcontroller, natural selection a simple microcontroller 51. But my operating system is Linux. Under Windows 51 it seems very easy to get started. But to build 51 development environment is not very smooth on Linux.
So how can I talk about Linux development environment to build STC89C52RC it.
Choose their favorite code editor. vim, emacs, gedit so can.
Install the compiler. Generally choose sdcc. Generally can be installed directly from a distribution's package manager.
Arch as in:
$ Sudo pacman -S sdcc
If not, you need to download the compilation.
Brief use sdcc:
If the current directory has a written source file main.c. Use the following simple way to compile.
$ Sdcc main.c
Several files are generated in a main.ihx generated hexadecimal executable file. Later it can be burned into the device.
The resulting executable program to burn a microcontroller is required to download lines. Generally use USB to serial download cable. After plugging in / dev which has a device called ttyUSB * specification can be later content.
Otherwise, you may need to install USB to serial driver.
Choose Recorder tool. Most online using this tool gSTCISP burn. But after I tried, always stuck in We are trying to connect your MCU ... this place.
At first I thought the problem line download. Later I found not. You can try. Note gSTCISP need is a binary file, so need to be converted to a binary file main.ihx.
A transition example:
$ Makebin main.bin
You need to change the file name of the file with your own name. There are many other methods, self-searching.
Through a burning tool I tested stcflash. This is a python script. So you need to install python environment. Most Linux distributions install python. But you need to install an additional runtime python-serial.
$ Sudo pacman -S python-serial
Stcflash.py the downloaded file into the source directory. Then start burning.
First turn off the board. carried out
$ Sudo python ./stcflash.py ./main.ihx
Open board to burn inside. Success results are as follows:
Connect to / dev / ttyUSB0 at baudrate 2400
Detecting target ... done
Model: STC89C52RC (ver4.3C)
Erasing target ... done
Size of the binary: 218
Programming: #################### done
Further binaries stcflash can also burn to enter.
sdcc Download: http: //sdcc.sourceforge.net/snap.php#Linux
gSTCISP Download: http: //osdn.jp/projects/sfnet_gstcisp/releases/ fulllist = 1?
stcflash Download: https: //github.com/RainMark/stcflash.git