0% found this document useful (0 votes)
152 views

TB3180 LIN Analyzer Library Demo 90003180A

Uploaded by

LIN TIMOFEI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views

TB3180 LIN Analyzer Library Demo 90003180A

Uploaded by

LIN TIMOFEI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

TB3180

LIN Analyzer Library Demo

Authors: Daniel Erhan - Wait for the bus to respond. This delay is only
Gaurang Gunde for the demo (better visualization). It will not
be needed in the final application.
Microchip Technology Inc.
• Clean up before exiting:
- Stop the continuous bus read process.
INTRODUCTION - Disconnect from the USB device.
Refer to the LIN_Library_API_Demo.zip file to get
Many customers need to develop a customized user
access to the source code through a NetBeans™
interface for the LIN communication protocol in a short
project for better understanding.
time and with reduced costs. Microchip provides a Java
LIN library API which gives customers flexibility to
develop their own interface. FRAME INFORMATION
This document explains how to use the library to create The LINWorkingFrame class allows the application
a customized user front-end to interface with the LIN developer to retrieve the following information about a
Analyzer Tool (P/N APGDT001). LIN Frame transaction:
• Frame ID
DEMO DESCRIPTION • Baud rate
• Time-stamp
In this demo, the Master (LIN Analyzer Tool) is
• The frame data payload along with the checksum
transmitting two frames with ID = 05h (PID = 85h) and
• Error status
eight data bytes + checksum byte at 19200 bps baud
rate. The error status variable is called
m_OnReceive_error. This reports the following
Also, it shows how the connection with the tool is
error conditions on the bus, if any:
established and how the message is listened back from
the bus. • 0 – No error
• 1 – Bus time-out error
• 3 – Timer error (in the firmware)
DEMO STRUCTURE • 4 – Status error (in the firmware)
In order to get successful transactions on the LIN bus • 5 – Event marker error
using the Java LIN library API, the demo needs to have • 6 – Next frame header received error
the following code flow: The developer can leverage the above elements to
• Select and initialize the lowest level report necessary error conditions when designing a
communication protocol from the host. In this custom GUI.
demo USB is used since the LIN Analyzer Tool
interfaces as a USB device. STEPS
• Initialize the LIN DLL Library by passing in the
communication reference. The following presents the steps required for creating a
• Add a listener to the model to observe the LIN new application and running it successfully:
frames on the bus. Frame data can be retrieved 1. Install Java JDK v8 software (see References
through the LINWorkingFrame object. for download page).
- Log LIN Frame information on the console.
2. Install NetBeans v8.2 software (see References
• Library Initialization:
for download page).
- Start the LIN continuous read process.
- Initialize the Serial Analyzer hardware Tool. 3. Install LIN Serial Analyzer v3.0.0 software (see
• Initialization ends here. The custom application References for download page).
can be written after this step: 4. Create LIN_Library_API_Demo folder on the
- Change the baud rate. local drive C:\
- Transmit a LIN Frame with the Master as the
publisher. This can be done repeatedly as
desired by the user.

 2018 Microchip Technology Inc. DS90003180A-page 1


TB3180
5. Copy the lib folder content from:
“C:\Program Files (x86)\linanalyzer-
1.1.0\dist\lib\” to
“C:\LIN_Library_API_Demo\lib\”.
6. Open NetBeans.
7. Select File -> New Project, then select Java at
Categories and Java Application at Projects,
then press Next button (see Figure 1).

FIGURE 1: NEW PROJECT

8. Write “LIN_Library_API_Demo” at Project Name


and select the working folder at Project
Location then press the Finish button. Be sure
that “Create Main Class” is checked (see
Figure 2).

 2018 Microchip Technology Inc. DS90003180A-page 2


TB3180
FIGURE 2: NEW JAVA APPLICATION

9. In the Projects window, right click on Libraries


and select “Add JAR/Folder…” (see Figure 3).
10. Select C:\LIN_Library_API_Demo\lib\ folder.

FIGURE 3: OPEN ADD JAR/FOLDER


DIALOG

11. Select all the .jar files from that folder using
SHIFT + click command, and then press the
Open button (see Figure 4).

 2018 Microchip Technology Inc. DS90003180A-page 3


TB3180
FIGURE 4: ADD LIBRARY .jar FILES TO THE PROJECT

12. Add the demo code to the


LIN_Library_API_Demo.java file. Use the
code found in the file with the same name from
LIN_Library_API_Demo.zip archive.
13. Power-up the LIN Serial Analyzer (plug the
power jack).
14. Press Run or Debug button in NetBeans in
order to execute the demo (see Figure 5).

FIGURE 5: RUN THE DEMO

15. Check the results.


• The transmitted message is displayed in the
Output window (see Figure 6):

FIGURE 6: CHECK THE RESULTS IN THE OUTPUT WINDOW

• Check the LINbus signal using an oscilloscope


(see Figure 7):

 2018 Microchip Technology Inc. DS90003180A-page 4


TB3180
FIGURE 7: CHECK THE LINbus SIGNAL USING OSCILLOSCOPE

TROUBLESHOOTING
1. Check if the LIN Serial Analyzer tool is externally
powered when the text below is seen in the
Output window (see Figure 8).

FIGURE 8: TROUBLESHOOTING – LIN ANALYZER NOT POWERED

2. Check if the LIN Serial Analyzer tool is plugged


into the USB port and the driver is installed
properly when the text below is seen in the
Output window (see Figure 9).

FIGURE 9: TROUBLESHOOTING – LIN ANALYZER NOT DETECTED

 2018 Microchip Technology Inc. DS90003180A-page 5


TB3180
REFERENCES APPENDIX A: REVISION HISTORY
Revision A (03/2018)
Hardware
Initial release.
LIN Serial Analyzer tool:
http://www.microchip.com/APGDT001

Software
Java SE JDK 8 and NetBeans IDE 8.2 Cobundle:
http://www.oracle.com/technetwork/java/javase/
downloads/jdk-netbeans-jsp-142931.html

Note: When installing the Java JDK and


NetBeans separately instead of the
bundled above, make sure the Java is the
JDK edition and not the JRE edition.
LIN Serial Analyzer v3.0.0 software package:
http://www.microchip.com/SWLibraryWeb/
product.aspx?product=LIN_Analyzer

Note: The entire project can be found in the


LIN_Library_API_Demo.zip file.

CONCLUSION
This technical brief provides the minimum steps
required to create a simple console application demo,
where messages are sent and monitored on the LIN
bus using the LIN Analyzer Tool.

 2018 Microchip Technology Inc. DS90003180A-page 6


Note the following details of the code protection feature on Microchip devices:
• Microchip products meet the specification contained in their particular Microchip Data Sheet.

• Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.

• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.

• Microchip is willing to work with the customer who is concerned about the integrity of their code.

• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”

Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.

Information contained in this publication regarding device Trademarks


applications and the like is provided only for your convenience The Microchip name and logo, the Microchip logo, AnyRate, AVR,
and may be superseded by updates. It is your responsibility to AVR logo, AVR Freaks, BeaconThings, BitCloud, chipKIT, chipKIT
ensure that your application meets with your specifications. logo, CryptoMemory, CryptoRF, dsPIC, FlashFlex, flexPWR,
MICROCHIP MAKES NO REPRESENTATIONS OR Heldo, JukeBlox, KEELOQ, KEELOQ logo, Kleer, LANCheck, LINK
WARRANTIES OF ANY KIND WHETHER EXPRESS OR MD, maXStylus, maXTouch, MediaLB, megaAVR, MOST, MOST
IMPLIED, WRITTEN OR ORAL, STATUTORY OR logo, MPLAB, OptoLyzer, PIC, picoPower, PICSTART, PIC32
OTHERWISE, RELATED TO THE INFORMATION, logo, Prochip Designer, QTouch, RightTouch, SAM-BA, SpyNIC,
INCLUDING BUT NOT LIMITED TO ITS CONDITION, SST, SST Logo, SuperFlash, tinyAVR, UNI/O, and XMEGA are
QUALITY, PERFORMANCE, MERCHANTABILITY OR registered trademarks of Microchip Technology Incorporated in
FITNESS FOR PURPOSE. Microchip disclaims all liability the U.S.A. and other countries.
arising from this information and its use. Use of Microchip ClockWorks, The Embedded Control Solutions Company,
devices in life support and/or safety applications is entirely at EtherSynch, Hyper Speed Control, HyperLight Load, IntelliMOS,
the buyer’s risk, and the buyer agrees to defend, indemnify and mTouch, Precision Edge, and Quiet-Wire are registered
hold harmless Microchip from any and all damages, claims, trademarks of Microchip Technology Incorporated in the U.S.A.
suits, or expenses resulting from such use. No licenses are Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any
conveyed, implicitly or otherwise, under any Microchip Capacitor, AnyIn, AnyOut, BodyCom, CodeGuard,
intellectual property rights unless otherwise stated. CryptoAuthentication, CryptoCompanion, CryptoController,
dsPICDEM, dsPICDEM.net, Dynamic Average Matching, DAM,
ECAN, EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-
Chip Connectivity, JitterBlocker, KleerNet, KleerNet logo, Mindi,
MiWi, motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB,
MPLINK, MultiTRAK, NetDetach, Omniscient Code Generation,
PICDEM, PICDEM.net, PICkit, PICtail, PureSilicon, QMatrix,
RightTouch logo, REAL ICE, Ripple Blocker, SAM-ICE, Serial
Quad I/O, SMART-I.S., SQI, SuperSwitcher, SuperSwitcher II,
Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan,
WiperLock, Wireless DNA, and ZENA are trademarks of Microchip
Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in
the U.S.A.
Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and Silicon Storage Technology is a registered trademark of Microchip
Tempe, Arizona; Gresham, Oregon and design centers in California Technology Inc. in other countries.
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping GestIC is a registered trademark of Microchip Technology
devices, Serial EEPROMs, microperipherals, nonvolatile memory and Germany II GmbH & Co. KG, a subsidiary of Microchip
analog products. In addition, Microchip’s quality system for the design Technology Inc., in other countries.
and manufacture of development systems is ISO 9001:2000 certified.
All other trademarks mentioned herein are property of their
respective companies.

QUALITY MANAGEMENT SYSTEM © 2018, Microchip Technology Incorporated, All Rights Reserved.
ISBN: 978-1-5224-2775-9
CERTIFIED BY DNV
== ISO/TS 16949 ==

 2018 Microchip Technology Inc. DS90003180A-page 7


Worldwide Sales and Service
AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE
Corporate Office Australia - Sydney India - Bangalore Austria - Wels
2355 West Chandler Blvd. Tel: 61-2-9868-6733 Tel: 91-80-3090-4444 Tel: 43-7242-2244-39
Chandler, AZ 85224-6199 China - Beijing India - New Delhi Fax: 43-7242-2244-393
Tel: 480-792-7200 Tel: 86-10-8569-7000 Tel: 91-11-4160-8631 Denmark - Copenhagen
Fax: 480-792-7277 Tel: 45-4450-2828
China - Chengdu India - Pune
Technical Support: Fax: 45-4485-2829
Tel: 86-28-8665-5511 Tel: 91-20-4121-0141
http://www.microchip.com/
China - Chongqing Japan - Osaka Finland - Espoo
support
Tel: 86-23-8980-9588 Tel: 81-6-6152-7160 Tel: 358-9-4520-820
Web Address:
www.microchip.com China - Dongguan Japan - Tokyo France - Paris
Tel: 86-769-8702-9880 Tel: 81-3-6880- 3770 Tel: 33-1-69-53-63-20
Atlanta Fax: 33-1-69-30-90-79
Duluth, GA China - Guangzhou Korea - Daegu
Tel: 678-957-9614 Tel: 86-20-8755-8029 Tel: 82-53-744-4301 Germany - Garching
Tel: 49-8931-9700
Fax: 678-957-1455 China - Hangzhou Korea - Seoul
Austin, TX Tel: 86-571-8792-8115 Tel: 82-2-554-7200 Germany - Haan
Tel: 512-257-3370 Tel: 49-2129-3766400
China - Hong Kong SAR Malaysia - Kuala Lumpur
Tel: 852-2943-5100 Tel: 60-3-7651-7906 Germany - Heilbronn
Boston
Tel: 49-7131-67-3636
Westborough, MA China - Nanjing Malaysia - Penang
Tel: 774-760-0087 Tel: 86-25-8473-2460 Tel: 60-4-227-8870 Germany - Karlsruhe
Fax: 774-760-0088 Tel: 49-721-625370
China - Qingdao Philippines - Manila
Chicago Tel: 86-532-8502-7355 Tel: 63-2-634-9065 Germany - Munich
Itasca, IL Tel: 49-89-627-144-0
China - Shanghai Singapore
Tel: 630-285-0071 Fax: 49-89-627-144-44
Tel: 86-21-3326-8000 Tel: 65-6334-8870
Fax: 630-285-0075 Germany - Rosenheim
China - Shenyang Taiwan - Hsin Chu
Dallas Tel: 49-8031-354-560
Tel: 86-24-2334-2829 Tel: 886-3-577-8366
Addison, TX Israel - Ra’anana
China - Shenzhen Taiwan - Kaohsiung
Tel: 972-818-7423 Tel: 972-9-744-7705
Tel: 86-755-8864-2200 Tel: 886-7-213-7830
Fax: 972-818-2924 Italy - Milan
China - Suzhou Taiwan - Taipei
Detroit Tel: 39-0331-742611
Tel: 86-186-6233-1526 Tel: 886-2-2508-8600
Novi, MI Fax: 39-0331-466781
Tel: 248-848-4000 China - Wuhan Thailand - Bangkok
Tel: 86-27-5980-5300 Tel: 66-2-694-1351 Italy - Padova
Houston, TX Tel: 39-049-7625286
Tel: 281-894-5983 China - Xian Vietnam - Ho Chi Minh
Tel: 86-29-8833-7252 Tel: 84-28-5448-2100 Netherlands - Drunen
Indianapolis Tel: 31-416-690399
Noblesville, IN China - Xiamen Fax: 31-416-690340
Tel: 317-773-8323 Tel: 86-592-2388138
Norway - Trondheim
Fax: 317-773-5453 China - Zhuhai Tel: 47-7289-7561
Tel: 317-536-2380 Tel: 86-756-3210040
Poland - Warsaw
Los Angeles Tel: 48-22-3325737
Mission Viejo, CA
Romania - Bucharest
Tel: 949-462-9523
Tel: 40-21-407-87-50
Fax: 949-462-9608
Tel: 951-273-7800 Spain - Madrid
Tel: 34-91-708-08-90
Raleigh, NC Fax: 34-91-708-08-91
Tel: 919-844-7510
Sweden - Gothenberg
New York, NY Tel: 46-31-704-60-40
Tel: 631-435-6000
Sweden - Stockholm
San Jose, CA Tel: 46-8-5090-4654
Tel: 408-735-9110
Tel: 408-436-4270 UK - Wokingham
Tel: 44-118-921-5800
Canada - Toronto Fax: 44-118-921-5820
Tel: 905-695-1980
Fax: 905-695-2078

 2018 Microchip Technology Inc. DS90003180A-page 8

You might also like