User Guide for Bridgetek models including: IDM2040 LDSBus Python SDK, IDM2040, LDSBus Python SDK, Python SDK, SDK
File Info : application/pdf, 21 Pages, 1.70MB
DocumentDocumentApplication Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Issue Date: 29-11-2021 This document provides information about how to setup and use the LDSBus Python SDK on IDM2040. Use of Bridgetek devices in life support and/or safety applications is entirely at the user's risk, and the user agrees to defend, indemnify and hold Bridgetek harmless from any and all damages, claims, suits or expense resulting from such use. Bridgetek Pte Ltd (BRTChip) 178 Paya Lebar Road, #07-03 Singapore 409030 Tel: +65 6547 4827 Fax: +65 6841 6071 Web Site: http://brtchip.com Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 Table of Contents 1 Introduction .............................................................. 3 2 Credits ....................................................................... 4 3 Getting Started with IDM2040................................... 5 3.1 Hardware Overview.............................................................5 3.2 Hardware Setup Instructions ..............................................5 4 Thonny Python IDE - Installation/Setup Instructions 9 5 Procedure to run LDSU Circuitpy Sample Example using Thonny ............................................................... 12 6 Contact Information ................................................ 18 Appendix A References ............................................. 19 Document References ...............................................................19 Acronyms and Abbreviations.....................................................19 Appendix B List of Tables & Figures .......................... 20 List of Tables.............................................................................20 List of Figures ...........................................................................20 Appendix C Revision History ..................................... 21 Product Page Document Feedback 2 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 1 Introduction This document describes how to use IDM2040 with LDSU circuitpy example including the Installation procedure for Thonny Python IDE and steps to execute LDSU circuitpy examples. The Python SDK will run on IDM2040 with appropriate LDSBus interface. IDM2040 has built-in LDSBus interface and is capable of supplying up to 24v to the LDSBus. More information on the IDM2040 is available at https://brtchip.com/product/. Product Page Document Feedback 3 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 2 Credits Open Source Software Thonny Python IDE: https://thonny.org Product Page Document Feedback 4 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 3 Getting Started with IDM2040 3.1 Hardware Overview RJ45 Jumper 20v Adapter Reset Button Port for PC Boot button connection Figure 1 - IDM2040 Hardware Features 3.2 Hardware Setup Instructions Follow these steps to setup the IDM2040 Hardware Setup a. Remove the Jumper. Product Page Document Feedback 5 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 b. Connect the LDSU module to HVT. c. Using RJ45 cable, connect HVT to IDM2040 RJ45 connector. d. Connect the 20v supply adapter using a USB-C cable to the USB-C port on the IDM2040. Product Page Document Feedback 6 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 e. Turn on the 20v adapter using the AC power supply. f. Connect IDM2040 to PC using Type-C cable. g. Press the Boot button the IDM2040 board; Hold it for a few seconds and release it after resetting the board. Windows will open a drive named "RP1-RP2". h. In the given example package, there must be an ".uf2" file, copy the file and paste it into "RP1-RP2" drive. i. Upon copying the ".uf2" file to "RPI-RP2", the device will reboot automatically and again will appear as a new drive, such as "CIRCUITPY". Product Page Document Feedback 7 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 The "code.py" is the main file which runs every time theIDM2040 is reset. Open this file and delete any content inside of it before saving. j. The COM port for this device will appear in Device Manager. Here is an example screen showing the IDM2040's COM Port as COM6. Product Page Document Feedback 8 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 4 Thonny Python IDE - Installation/Setup Instructions Follow these steps to install and setup Thonny Python IDE a. Download the Thonny Python IDE package from https://thonny.org/. b. Click Windows to download the windows version. ` c. Upon downloading the application, complete the installation by clicking the executable file (.exe) and following the installation wizard. Upon completing the installation, open the Thonny Python IDE from the Windows Startup. d. To open the Properties, click the left mouse button at the right bottom corner. Select "CircuitPython (generic)". Product Page Document Feedback 9 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 e. Click "Configure Interpreter...". f. Click on the Port drop down and select the port appeared for IDM2040 in device manager after connecting. In this example screenshot COM port appeared as COM6. Click [OK]. ` Product Page Document Feedback 10 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 g. Thonny will report the device information at the interpreter prompt ("Adafruit CircuitPython 7.0.0-dirty on 2021-11-11; Raspberry Pi Pico with rp2040") if the device port is correct. Product Page Document Feedback 11 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 5 Procedure to run LDSU Circuitpy Sample Example using Thonny Follow these steps to run the LDSU circuitpy sample example a. Open the sample package file. As part of the sample package there is a folder by name "json" which contains various sensor json file. b. Copy and paste the "json" folder to the "CIRCUITPY" storage device. Product Page Document Feedback 12 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 c. Open any given example using a text editor such as notepad ++ and copy it to the Thonny Editor and save it. For example, open "LDSBus_Thermocouple_Sensor.py" and copy/paste on Thonny Editor. Click [Save]. d. Upon clicking [Save], a "Where to save to?" dialog box will be displayed. Click and select CircuitPython device. Product Page Document Feedback 13 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 e. Enter a file name and click [OK]. Note: When sample code is saved to "code.py" then every time it reboots, it will begin running "code.py". In order to avoid this, specify a different name. f. The file will be saved to "CIRCUITPY" drive. Product Page Document Feedback 14 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 g. To run the example from Thonny Editor, click (Run current script). h. The Circuitpy LDSU example will run to scan the bus and start reporting the sensor data. Product Page Document Feedback 15 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 i. To stop the execution, click (Stop). Users can update the code as required or can copy/paste another example to try in the Thonny editor. Note: Upon making any changes to the script file, remember to Save and Run the script. Product Page Document Feedback 16 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 j. Remember to copy the following files - "irBlasterAppHelperFunctions" and "lir_input_file.txt" before trying the LDSBus_IR_Blaster.py example. Refer to BRT_AN_078_LDSU IR Blaster_Application for more details on "LDSBus_IR_Blaster.py" example. Product Page Document Feedback 17 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 6 Contact Information Head Quarters Singapore Branch Office Taipei, Taiwan Bridgetek Pte Ltd 178 Paya Lebar Road, #07-03 Singapore 409030 Tel: +65 6547 4827 Fax: +65 6841 6071 Bridgetek Pte Ltd, Taiwan Branch 2 Floor, No. 516, Sec. 1, Nei Hu Road, Nei Hu District Taipei 114 Taiwan, R.O.C. Tel: +886 (2) 8797 5691 Fax: +886 (2) 8751 9737 E-mail (Sales) E-mail (Support) sales.apac@brtchip.com E-mail (Sales) support.apac@brtchip.com E-mail (Support) sales.apac@brtchip.com support.apac@brtchip.com Branch Office - Glasgow, United Kingdom Branch Office Vietnam Bridgetek Pte. Ltd. Unit 1, 2 Seaward Place, Centurion Business Park Glasgow G41 1HH United Kingdom Tel: +44 (0) 141 429 2777 Fax: +44 (0) 141 429 2758 Bridgetek VietNam Company Limited Lutaco Tower Building, 5th Floor, 173A Nguyen Van Troi, Ward 11, Phu Nhuan District, Ho Chi Minh City, Vietnam Tel : 08 38453222 Fax : 08 38455222 E-mail (Sales) E-mail (Support) sales.emea@brtichip.com E-mail (Sales) support.emea@brtchip.com E-mail (Support) sales.apac@brtchip.com support.apac@brtchip.com Web Site http://brtchip.com/ Distributor and Sales Representatives Please visit the Sales Network page of the Bridgetek Web site for the contact details of our distributor(s) and sales representative(s) in your country. System and equipment manufacturers and designers are responsible to ensure that their systems, and any Bridgetek Pte Limited (BRTChip) devices incorporated in their systems, meet all applicable safety, regulatory and system-level performance requirements. All application-related information in this document (including application descriptions, suggested Bridgetek devices and other materials) is provided for reference only. While Bridgetek has taken care to assure it is accurate, this information is subject to customer confirmation, and Bridgetek disclaims all liability for system designs and for any applications assistance provided by Bridgetek. Use of Bridgetek devices in life support and/or safety applications is entirely at the user's risk, and the user agrees to defend, indemnify and hold harmless Bridgetek from any and all damages, claims, suits or expense resulting from such use. This document is subject to change without notice. No freedom to use patents or other intellectual property rights is implied by the publication of this document. Neither the whole nor any part of the information contained in, or the product described in this document, may be adapted or reproduced in any material or electronic form without the prior written consent of the copyright holder. Bridgetek Pte Limited, 178 Paya Lebar Road, #07-03, Singapore 409030. Singapore Registered Company Number: 201542387H. Product Page Document Feedback 18 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 Appendix A References Document References BRT_API_002_LDSBus_Python_SDK_Guide BRT_AN_078_LDSU IR Blaster_Application Acronyms and Abbreviations Terms HVT IDE LDSBus USB Description High Voltage T-Junction Integrated Development Environment Long Distance Sensor Bus Universal Serial Bus Product Page Document Feedback 19 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 Appendix B List of Tables & Figures List of Tables NA List of Figures Figure 1 - IDM2040 Hardware Features ................................................................................. 5 Product Page Document Feedback 20 Copyright © Bridgetek Pte Ltd Application Note BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Version 1.0 Document Reference No.: BRT_000378 Clearance No.: BRT#187 Appendix C Revision History Document Title: BRT_AN_080 LDSBus Python SDK on IDM2040 User Guide Document Reference No.: BRT_000378 Clearance No.: BRT#187 Product Page: http://brtchip.com/product/ Document Feedback: Send Feedback Revision 1.0 Changes Initial Release Date 29-11-2021 Product Page Document Feedback 21 Copyright © Bridgetek Pte Ltd