Creating expansion board definition file for Arduino Multifunction shield

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating expansion board definition file for Arduino Multifunction shield

Creating expansion board definition file for Arduino Multifunction shield

Creating expansion board definition file for Arduino Multifunction shield

 An expansion board definition file for the Arduino Multifunction shield can be applied in Pins Tool to expansion headers available on the NXP board. This tutorial describes the steps of creating an XML expansion board file using the shield documentation and the expansion headers feature in the Pins toolFor details on the expansion headers feature, see the following article: Adding Expansion Headers to a custom board

You can apply the Arduino Multifunction shield on several NXP boards. This tutorial uses the FRDM K64F EVK board.  

Prerequisites:

  • Use a  shield description/specification, for example, https://www.biomaker.org/multifunction-shields. You can use HAILANGNIAO Multi-Function shield V2.
  • Use the XSD schema file https://mcuxpresso.nxp.com/XSD/expansion_board_1.0.xsd for the definition file validation.
  • Use the definition of signal types - mapping of signals from the expansion board to the processor. You can find it in the Config Tools data directory: c:\ProgramData\NXP\mcu_data_{config_tools_version}\expansion_headers\signal_types\common_signal_types.xml.
  • Use the definition of expansion header where the board can be applied: c:\ProgramData\NXP\mcu_data_{config_tools_version}\expansion_headers\frdm_arduino.xml.
  • Get familiarized with devices that are on the shield or can be connected to the shield.
  • Install MCUXpresso IDE v11.3.0 or later and SDK FRDM-K64F 2.8.2 or later.
  • Create a Project for FRDM-K64F.
  • Open Expansion Header view (Windows -> Show View -> Expansion Header).
antonintomanec_9-1630307324963.jpeg

Figure 1 FRDM K64F EVK board

antonintomanec_18-1630308311658.png

Figure 2 Expansion Header view in the Pins tool

Expansion board template

 Edit the following template according to the steps below.

<?xml version="1.0" encoding= "UTF-8" ?>
<expansion_board id="board_id" name="board_name"
  xsi:schemaLocation="http://mcuxpresso.nxp.com/XSD/expansion_board_1.0 http://mcuxpresso.nxp.com/XSD/expansion_board_1.0.xsd"
  xmlns="http://mcuxpresso.nxp.com/XSD/expansion_board_1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <header_connection ref="expansion_header_def_id">
    <connectors>
      <connector ref="C1">
        <pins>
          <pin ref="1" name="pin name" signal_type="digital_in" description="pin description"/>
        </pins>
      </connector>
    </connectors>
  </header_connection>
  <code_identifiers prefix="ARDUINO_"/>
</expansion_board>

Expansion board id and name

 Edit the id and name of the expansion board.

<?xml version="1.0" encoding= "UTF-8" ?>
<expansion_board id="arduino_multifunction_ds18b20_board" name="Arduino Multi DS18B20 board"
  xsi:schemaLocation="http://mcuxpresso.nxp.com/XSD/expansion_board_1.0 http://mcuxpresso.nxp.com/XSD/expansion_board_1.0.xsd"
  xmlns="http://mcuxpresso.nxp.com/XSD/expansion_board_1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Expansion board - header connection

The element header_connection determines the id of an expansion header where the board can be applied to.

  1. Get the type of expansion header in the FRDM-K64F board.antonintomanec_19-1630309130896.png

Figure 3 Edit expansion header dialog

  1. Edit the header_connection in the expansion board XML.
    <?xml version="1.0" encoding= "UTF-8" ?>
    <expansion_board id="arduino_multifunction_ds18b20_board" name="Arduino Multi DS18B20 board"
      xsi:schemaLocation="http://mcuxpresso.nxp.com/XSD/expansion_board_1.0 http://mcuxpresso.nxp.com/XSD/expansion_board_1.0.xsd"
      xmlns="http://mcuxpresso.nxp.com/XSD/expansion_board_1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <header_connection ref="frdm_arduino">​

NOTE

Some other NXP boards can provide a  single row Arduino expansion header, for example, MIMXRT1060-EVK. For these boards,  create the definition file based on the single_row_arduino expansion header. The definition file varies only in pin references.

Expansion board pins

The tutorial describes how to add a pin element within the connector elements in three examples. See the marked pins on the shield below.

antonintomanec_0-1630311865137.png

Figure 4 Arduino Multi-Function shield

Pin 5V (Power supply +5V)

  1. Get the needed pin element attributes values
  • Find the board pin in the expansion header view. The pin tooltip shows connector J3 pin 10. The connector tooltip shows the definition id for J3, which is C1.antonintomanec_20-1630309515294.png

Figure 5 Connector pin and connector tooltips in the Expansion header view

  • Pin 5V is an external pin from the processor point of view (not connected to the processor). In the common_signal_types.xml, find a suitable signal type.antonintomanec_21-1630309578613.png
  1. Add the element pin with reference 10, name on the shield 5V, signal type power_supply_5V, and the description in the connector C1.
    <connector ref="C1">
      <pins>
        <pin ref="10" name="5V" signal_type="power_supply_5V" description="Power supply +5V"/>​

Pin 13 (LED - D1)

  1. Get the needed pin element attributes values
  • Find the board pin in the expansion header view. The pin tooltip shows connector J2 pin 12. The connector tooltip shows the definition id for J2, which is C2.antonintomanec_22-1630309813636.png

Figure 6 Connector pin and connector tooltips in the Expansion header view

  • Pin 13 is connected to LED D1 on the shield. It is digital input from the shield point of view, it is output from the processor point of view. In the common_signal_types.xml, find a suitable signal type.

antonintomanec_25-1630310166317.png

  1. Add the element pin with reference 12, name on the shield 13, signal type digital_in, and the description in the connector C2.
    <connector ref="C2">
      <pins>
        <pin ref="12" name="13" signal_type="digital_in" description="LED - D1"/>​

Pin A4 (Thermometer DS18B20 or LM35 - U5)

Pin A4 is connected to the header U5 on the shield where two different external thermometers can be applied. The definition file you create is the variant for DS18B20. See the documentation for DS18B20: https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf 

  1. Get the needed pin element attributes values
  • Find the board pin in the expansion header view. The pin tooltip shows connector J4 pin 10. The connector tooltip shows the definition id for J4, which is C4.antonintomanec_26-1630310445013.png

    Figure 7 Connector pin and connector tooltips in the Expansion header view

  • Pin A4 is connected to DS18B20 DQ pin which is Data Input/Output. In the common_signal_types.xml, find a suitable signal type.antonintomanec_2-1630311946370.png
     
  1. Add the element pin with reference 10, name on the shield A4, signal type digital, and the description in the connector C4.
    <connector ref="C4">
      <pins>
        <pin ref="10" name="A4" signal_type="digital" description="Thermometer DS18B20 or LM35 - U5"/>​

 

See the complete expansion board definition file arduino_multifunction_ds18b20.xml and arduino_single_multifunction_ds18b20.xml in the CreateExpansionBoardFile.zip.

For information on the usage of this created board file see the following article: Measuring temperature using digital sensor DS18B20 and Arduino Multifunction Shield on FRDM K64F

Attachments
No ratings
Version history
Last update:
‎02-23-2022 05:31 AM
Updated by: