The serial port operation includes the Java upper computer embedded C subordinate machine

Source: Internet
Author: User

aEnvironment1.1 Keil UVision4

http://pan.baidu.com/s/1o6A331w

1.2 STC

Http://pan.baidu.com/s/1jGpCUTC

1.3 MyEclipse 8.5

Http://pan.baidu.com/s/1jGABEaM

1.4 jar package to be imported RXTX

Http://pan.baidu.com/s/1ntwsvRr

First copy the RxtxParallel.dll and RxtxSerial.dll to the bin directory of the JDK directory.

Then copy the Rxtxcomm to the Jdk\jre\lib\ext directory.

Finally, you will import the jar package in your Java project Rxtxcomm

1.5 at89c51 Single chip microcomputer 1.6 18B20 temperature sensor 1.7 DS1302 Clock Controller 1.8 1602 LCD screentwosingle chip microcomputer slave machine

Create a new folder on the desktop as your embedded workspace


Create a new project in Keil


Select the folder you just created on the desktop


Select Atmel Series Processors


Select At89c51


Copy the C file you have written to the new process you just made on the desktop, and if you don't write it, create a new soucefile.c file.


Switch to Keil, double-click the procedure name to import the C file into the process


Modifying process properties


Click Target to change 24 to 12


Click Output to tick the crate hex


If you import a C file without code, rewrite it and click on the following three buttons when you are done. If you import a well-written c ask Price, you can simply click


Open the Desktop folder again, found that there are many more files, including hex file


Now you can burn the hex file to the microcontroller.

I'm using a STC here.


Click EXE file


Modify your MCU COM port baud rate, and then click "Open File" to select your hex file. Then download, the program is burned to a single-chip microcomputer.

This time prompts you to re-SCM or open the switch button of the microcontroller.

If the hint is not found or is occupied, first see if the COM port is correct, and then see if there are other software that occupies the COM port. It's best to turn off all the other software.


Let's look at the results of the operation in MyEclipse.


threePcMachine Upper Machine

How to accept the serial port information, I choose the language is Java, because this language is more powerful and flexible.

The IDE I chose is myeclipse 8.5 In addition to the KAR package RXTX because the Comm package only supports Win32 bit

The simple operation is to create a new Java project, import the jar package, and create a new Java file under SRC. Also pay attention to the use of RXTX. The main thing is to copy the two DLL files under the JDK bin, copy the jar package to ext, and finally import the jar into your project. All the code and jars are downloaded in the link below. Below I give the use of RXTX.





FourSource Code

Http://pan.baidu.com/s/1pJDPtPL

It contains the process files and RXTX packages of the upper and lower computers.

For specific use, please refer to Readme.tex

The serial port operation includes the Java upper computer embedded C subordinate machine

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.