<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/1237070#M5803</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am also trying same kind of sensor. can you help me for reading any i2c slave device using s32k142 board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vaibhav&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 06:32:16 GMT</pubDate>
    <dc:creator>vaibhav_n</dc:creator>
    <dc:date>2021-02-26T06:32:16Z</dc:date>
    <item>
      <title>How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754872#M1858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333333; font-size: 15px;"&gt;This article shows how to configure an CAN bus nodes with NXP's Model-Based Design Toolbox. The application show how you can easily mix together various communication protocols like CAN, I2C and UART to achieve a complex setup that allows to read the temperature from a remote sensors, convert that data into a CAN message, sent it via CAN bus, decode the information and display it's variation in time using a host PC application.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399; font-size: 16.5pt;"&gt;&lt;STRONG&gt;INTRODUCTION&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;Nowadays the market faces an abundance of cost effective micro-controller solutions that are reliable, performant and integrates various functionalities of the shelf, making easier than ever to prototype complex applications. One of such solutions is the &lt;/SPAN&gt;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/s32-automotive-platform/32-bit-automotive-general-purpose-microcontrollers:S32K" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;SPAN style="font-size: 11.5pt; border: none windowtext 1.0pt; padding: 0in;"&gt;NXP’s S32K&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt; scalable family of AEC-Q100 qualified 32-bit ARM Cortex-M4F and Cortex-M0+ based MCUs targeted for general purpose automotive and high reliability industrial applications.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;NXP’s &lt;/SPAN&gt;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/s32-automotive-platform/s32k144-evaluation-board:S32K144EVB" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;SPAN style="font-size: 11.5pt; border: none windowtext 1.0pt; padding: 0in;"&gt;S32K144EVB Development Kit&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt; is one of the choices that puts in your hands a small form factor, low cost (US$49) and feature-rich platform which can prove to be a perfect development system for quick application prototyping and demonstration.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/51475iA4B825E9DA4F9EDB/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 1: S32K144EVB's main features&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The main component of this development platform is the S32K144 MCU that integrates in a single SoC a 32bit Cortex M4F core capable of running at 112MHz with 512KB of Flash memory and 54KB of RAM. Dedicated hardware peripherals and a large collection of IP communication blocks makes this MCU a suitable candidate for various industrial and automotive applications. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;In today’s fast growing complex than ever automotive market these is a lot of interest in various modules capable to control and coordinate multiple functionalities. Such microprocessors need to be flawlessly integrated within the cars various computing domains and must be ultra-reliable when operating in a such harsh environment.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/51588iD3FFB6D4788C23FE/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 2:&amp;nbsp;A typical vehicle distributed control architecture and places where S32K is a perfect match&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;NXP’s S32K product families are specifically designed to address all these aspects, and to demonstrate how easy it is to build complex applications let us consider a typical use case that maps over a distributed automotive &lt;STRONG&gt;Body Control Module&lt;/STRONG&gt; domain as the one shown in Fig. 2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;Let us suppose we wish to implement a distributed network of sensors that read data from key points, process and aggregate those data and ultimately sent them via CAN bus to a gateway that informs the upper layers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399; font-size: 16.5pt;"&gt;&lt;STRONG&gt;HARDWARE SETUP&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;We can easily prototype such scenario in a couple of minutes with NXP’s S32K development boards and NXP’s Model-Based Design MATLAB toolboxes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;For the hardware setup, two S32K144EVB development boards are used. These are connected through CAN bus (both on CAN0 instance available directly on the board via J13 connector) and supplied with a 12 volts external power supply due to the CAN transceivers power requirements. The one which acts as&amp;nbsp;CAN node-SLAVE&amp;nbsp;has an &lt;A href="https://www.silabs.com/documents/public/data-sheets/Si7021-A20.pdf" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;Si7021 temperature sensor&lt;/A&gt;, connected on FlexIO I2C protocol&amp;nbsp;using&amp;nbsp;PTD0 GPIO as I2C SDA and PTD1 GPIOI as I2C SCL communication lines.&amp;nbsp; A CAN sniffer was also added to catch some packets over the network.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The real hardware setup with the main components and layout is shown in Fig. 3.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;IMG alt="pastedImage_5.png" src="https://community.nxp.com/t5/image/serverpage/image-id/51785i3B56B3C4A8E53B66/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_5.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 3: CAN-bus network used to emulate a car body control module&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The main components of the setup are:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;Two S32K144EVB development kits which are configured to act as MASTER (1) and SLAVE (2). The boards are supply with 12V (6) and connected via a PC via microUSB (7) for program loading and debugging during development phase;&lt;/LI&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;One Si7021 temperature sensor that support I2C communication protocol is connected with the SLAVE (2) via FlexIO I2C peripheral;&lt;/LI&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;CAN (5) network that interconnects the two boards, allowing to pass control and data messages;&lt;/LI&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;CAN sniffer (4) that acts like a diagnostic tool;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399; font-size: 16.5pt;"&gt;&lt;STRONG&gt;SOFTWARE IMPLEMENTATION&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The application is developed using &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-335555" rel="noopener noreferrer" target="_blank"&gt;NXP's Model-Based Design Toolbox for S32K14x&lt;/A&gt; which allows the user to directly generate and download the application to the actual hardware from MATLAB/Simulink.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The approach we chose for the data exchange protocol is based on the following concepts:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="color: #333333; font-size: 11.5pt; text-indent: -0.25in;"&gt;The CAN node-MASTER sends periodically (every 0.5 seconds) over CAN bus a message with the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;ID 0x3FF&lt;/STRONG&gt;&lt;/SPAN&gt; to trigger a new data acquisition;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="color: #333333; font-size: 11.5pt; text-indent: -0.25in;"&gt;The CAN node-SLAVE receives the message and if the ID matches it will initiate a temperature measurement routine. This measurements is done via I2C communication protocol with a dedicated temperature sensor;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="color: #333333; font-size: 11.5pt; text-indent: -0.25in;"&gt;After acquisition is completed, the node-SLAVE sends back a CAN message with the&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt; ID 0x3FE&lt;/STRONG&gt;&lt;/SPAN&gt; containing in the first 4 bytes a “timestamp” (an uint32 variable that increments every main loop) and the temperature value (floating point&amp;nbsp;conversion in deg C&amp;nbsp;of the temperature read from the actual sensor)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="color: #333333; font-size: 11.5pt; text-indent: -0.25in;"&gt;The verification is done on the PC side by using the FreeMASTER which is connected over the UART interface with the CAN node-MASTER and configured to show the values&amp;nbsp;received over the CAN bus. The FreeMASTER is used in case no CAN sniffer is available&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399; font-size: 15px;"&gt;&lt;STRONG&gt;Part A: CAN node-SLAVE Programming&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The job of the SLAVE&amp;nbsp;board is to measure the temperature from the sensor and to send the values via CAN bus to the MASTER board that acts like a gateway. The Simulink model used to receive/transmit CAN messages and data exchange with the sensor via the I2C protocol over FlexIO is shown below.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_18.png"&gt;&lt;IMG alt="pastedImage_18.png" src="https://community.nxp.com/t5/image/serverpage/image-id/51579iB556304918C19220/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_18.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 4: Simulink model for the application running on the SLAVE board: It implements 2 communication protocols: CAN and I2C&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN&gt;This model implements three basic functionalities:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN&gt;Reading data from sensor&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;Handle the CAN receive messages&lt;/LI&gt;&lt;LI style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;Handle the CAN transmit messages&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333399;"&gt;&lt;STRONG&gt;A.1. Reading Data From Sensor&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The temperature sensor uses I2C protocol for exchanging the temperature values. To achieve that, the FlexIO peripheral must be configured by adding a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FlexIO_I2C_Master_Config&lt;/SPAN&gt; block. &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="info" __jive_macro_name="alert" alert="info" class="jive_text_macro jive_macro_alert"&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="color: #333399;"&gt;A standard I2C peripheral can be used to implement the communication with the sensor. To demonstrate the capabilities of the S32K144 we choose to use the FlexIO peripheral since it can be configured in multiple way to extend the functionalities of standard communication ports.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The instance 0 of FlexIO peripheral is configured to &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;run in the polling mode with a communication baud rate of 400 kHz and as dedicated communication lines:&amp;nbsp;PTD0/PTD1 general purpose input/outputs pins selected&amp;nbsp;to implement&amp;nbsp;SDA and SCL I2C functionalities.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_8.png"&gt;&lt;IMG alt="pastedImage_8.png" src="https://community.nxp.com/t5/image/serverpage/image-id/51903iCCFDA4C7FBB395F0/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_8.png" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;IMG alt="pastedImage_9.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52020iC389F405A9B12D8C/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_9.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 5: FlexIO peripheral configuration&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;When the temperature acquisition is needed, the S32K144 acts as an I2C master and sends a packet consisting of command “227” (0xE3) to the device with the address&amp;nbsp; “64” (0x40)&amp;nbsp; and “Stop bit” by using &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FlexIO_I2C_Master_Transmit&lt;/SPAN&gt; block.&amp;nbsp;&amp;nbsp;T&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;he temperature sensor responds on I2C bus with two bytes of “raw” temperature,&amp;nbsp;therefore a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FlexIO_I2C_Master_Receive&lt;/SPAN&gt; block need to be&amp;nbsp;configured to wait two bytes from the address “64” (0x40) like in Fig 6. Also, a block that converts the data from “raw’ temperature in Celsius degrees is added.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52312iC58D138C3649977D/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;IMG alt="pastedImage_2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52110i658ACEF9091E8101/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 6: FlexIO I2C communication between S32K144 and &lt;SPAN style="background-color: #ffffff;"&gt;Si7021&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;temperature sensor&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;PRE __default_attr="info" __jive_macro_name="alert" alert="info" class="jive_text_macro jive_macro_alert"&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333399; border: 1pt none windowtext; padding: 0in; font-family: 'courier new', courier, monospace;"&gt;If you want to read more about using&amp;nbsp; FlexIO MBDT blocks please read the following article at this link:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/462157" rel="noopener noreferrer" target="_blank"&gt;[FlexIO] Flex your muscles with the latest MBDToolbox release&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399;"&gt;&lt;STRONG&gt;A.2.&amp;nbsp;Handle the CAN receive messages&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;To receive and transmit data over the CAN bus, a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FCAN_Config&lt;/SPAN&gt; block must be added in the model. The settings are very generous because it offers to user the possibility of using in addition of standard settings some advanced options like enabling CAN FD, RX FIFO (the board can filter which messages to receive) and also Pretended Networking (some messages can also wake up the processor from sleep state).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;For this example we are going to use the CAN0 instance in normal mode with a maximum of 16 message buffers as in Fig. 7.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #FFFFFF;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_24.png"&gt;&lt;IMG alt="pastedImage_24.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52237iDD8339E50E91A7B5/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_24.png" /&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 7: CAN peripheral configuration&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;To receive a CAN message, the CAN receive interrupt must be armed using the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FCAN_Receive&lt;/SPAN&gt;&amp;nbsp;block like in the Fig. 8. The “Once” flag variable was used because the next interrupt will be armed inside the&amp;nbsp;sub-system called by the Rx complete interrupt trigger.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_33.png"&gt;&lt;IMG alt="pastedImage_33.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52304i78EB124BE45E22CC/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_33.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 8: CAN receive message handling&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;When a message is received, it triggers the RX_Complete_Event. The only point of interest is the message ID because a message from the 0x3FF (node-MASTER) means a starting conversion. If the address is 0x3FF the Red LED is toggled, the RX ISR is rearmed and “flag” variable is set, for later start measuring the temperature and send the value over CAN bus.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_41.png"&gt;&lt;IMG alt="pastedImage_41.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52313iCD40D97D180CB678/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_41.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 9: Get CAN message on an interrupt&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399;"&gt;&lt;SPAN style="color: #333399;"&gt;&lt;STRONG&gt;A.3.&amp;nbsp;Handle the CAN transmit&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333399;"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #333399;"&gt;&lt;STRONG&gt;messages&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;Once the “flag” variable has been set in the RX_Complete_Event, the temperature information received from the I2C sensors is saved in the “temperature” variable so it is ready to be sent to the master node (0x3FE). &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;For that a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FCAN_Send&lt;/SPAN&gt; block is&amp;nbsp;configured like in the&amp;nbsp;Fig. 10.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The block requires an 8 byte pack of data (“timestamp”&amp;nbsp; and “temperature”) and a data length which is a Constant of value “8”.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;IMG alt="pastedImage_6.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52238iA4F0AD01F2822C18/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_6.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 10: CAN transmit message&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399; font-size: 15px;"&gt;&lt;STRONG&gt;Part B: CAN node-MASTER Programming&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The job of the&amp;nbsp;MASTER board, is to send periodically (every half second) a message to the slave and to handle receive back of the temperature over CAN bus. Also, the CAN node-MASTER can responds to a FreeMASTER queries. The node-MASTER Simulink model that implements these functionalities is shown in Fig. 11.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_16.png"&gt;&lt;IMG alt="pastedImage_16.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52438i25E40715534064D0/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_16.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 11: Simulink model for the application running on the MASTER board: It implements 2 communication protocols: CAN and&amp;nbsp;UART&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The CAN on&amp;nbsp;the board that acts like node-MASTER needs to be configured with the same bus settings as the slave board. Sending data is done in the exactly same way as for slave. The only difference here, is that a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;TX_Complet_ISR&lt;/SPAN&gt; block was added for calling an&amp;nbsp;sub-system when the packet has been sent. This allows us to toggle the blue LED as an additional indication for message transmit.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_24.png"&gt;&lt;IMG alt="pastedImage_24.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52268i89B13CFD0FC230FF/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_24.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 12: CAN transmit message to trigger temperature acquisition on node-slave&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The MASTER and SLAVE are receiving CAN bus messages in a similar way using same type of Simulink blocks - arming once the trigger and then calling a sub-system from the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;FCAN_ISR&lt;/SPAN&gt; block.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The only difference on the&amp;nbsp;node-MASTER side is that this time we really want to process those 8 bytes received as message payload, therefore we need to call the RX_Complete_Event&amp;nbsp;sub-system&amp;nbsp;using the ID and Data received as arguments.&amp;nbsp; The ID is checked and the Data is unpacked in the time-stamp and temperature variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_6.png"&gt;&lt;IMG alt="pastedImage_6.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52667iE9CCAF6E2887A034/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_6.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 13: Handling the incoming CAN messages on node-MASTER&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in; margin-bottom: .0001pt; background: white;"&gt;&lt;SPAN style="color: #333399; font-size: 16.5pt;"&gt;&lt;STRONG&gt;VERIFICATION&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;Once the models are completed and the generated code is downloaded on each the devices there are at least 2 simple ways to check the correct functionality of the master-slave CAN application on S32K144.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;The first method is based on FreeMASTER&amp;nbsp;tool that can be configured to read the data out of the node-MASTER via the UART interface.&amp;nbsp;As it&amp;nbsp;can be seen from Fig. 14, the measured temperature is about 26 degrees Celsius and the time-stamp is continuously increasing.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_10.png"&gt;&lt;IMG alt="pastedImage_10.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52668iD98A1F250849D315/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_10.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 14:&amp;nbsp;Checking the application with FreeMASTER over the UART interface.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0.0001pt; background: white; text-align: justify;"&gt;The second method that might be more expensive is based on the existence of a CAN-Sniffer. In our case we used an IXXAT can to usb converter to check the messaged on the CAN bus.&amp;nbsp;&lt;SPAN style="font-size: 11.5pt; color: #333333; border: none windowtext 1.0pt; padding: 0in;"&gt;This device is mainly used for debugging the CAN bus by sniffing the exchanged messages on the bus. In the Fig. 15, it can be seen “ping-pong” of messages between master (x3FF) and slave (3FE) at specific time intervals.&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6; border-width: 1px; border-color: #ffffff;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_14.png"&gt;&lt;IMG alt="pastedImage_14.png" src="https://community.nxp.com/t5/image/serverpage/image-id/52636iB5765D76B4D50A3E/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_14.png" /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: center;"&gt;&lt;SPAN style="font-size: 13px;"&gt;Fig. 15:&amp;nbsp;Checking CAN messages with dedicated hardware sniffer&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;We hope you find this information useful. Feel free to LIKE this article and comment below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The models used in this article are attached below.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:05:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754872#M1858</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2020-11-02T14:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754873#M1859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, this tutorial is amazing!&lt;/P&gt;&lt;P&gt;I am new to simulink and I wanted to use an I2C sensor which is not FlexIO. What configuration settings are needed for something like that.&lt;/P&gt;&lt;P&gt;Is there an article that explains it?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 00:37:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754873#M1859</guid>
      <dc:creator>siddharthpimpri</dc:creator>
      <dc:date>2018-03-20T00:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754874#M1860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/siddharthpimprikar"&gt;siddharthpimprikar&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;Thank you for your appreciation!&lt;/P&gt;&lt;P&gt;Let me clarify some things first: I2C is a protocol that allows the serial data connection between many devices with unique 7 bits addresses over just 2 wires SDA/SCL while FlexIO is an adaptable peripheral on our S32K, which supports a wide range of protocols like UART, I2C, SPI, according to the user’s needs, so there should be no problems connecting your I2C sensor using our FlexIO peripheral.&lt;/P&gt;&lt;P&gt;In the above article, the section A.1 describes how to read data from a sensor, using PTD0(SDA) and PTD1(SCL) as I2C lines, how to address your sensor and how to get data from it, but obviously, you should read your sensor’s datasheet, which can tell you more about the configuration settings you need. &amp;nbsp;&lt;/P&gt;&lt;P&gt;For more information about FlexIO, we recommend you to read&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/constantinrazvan.chivu"&gt;constantinrazvan.chivu&lt;/A&gt;'s&amp;nbsp;article &lt;A _jive_internal="true" href="https://community.nxp.com/thread/462157"&gt;[FlexIO] Flex your muscles with the latest MBDToolbox release&lt;/A&gt; and the “Chapter 51 Flexible I/O (FlexIO)” from the&amp;nbsp;&lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/s32-automotive-platform/32-bit-automotive-general-purpose-microcontrollers:S32K?&amp;amp;tab=Documentation_Tab&amp;amp;linkline=Application-Note"&gt;S32K reference manual&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;What we recommend you to do is to download and install our toolbox, in which you will find more other examples of I2C communication.&lt;/P&gt;&lt;P&gt;Good luck,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 09:30:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754874#M1860</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2018-03-20T09:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754875#M1861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you this was helpful!&lt;/P&gt;&lt;P&gt;I am using a lux sensor( calculating the actual value from the raw value is slightly tricky here).&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I have understood the procedure better.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sid&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2018 18:02:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754875#M1861</guid>
      <dc:creator>siddharthpimpri</dc:creator>
      <dc:date>2018-03-20T18:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754876#M1862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nice topic!&lt;BR /&gt;&lt;BR /&gt;Is there an example on how to send 2 different messages in different time base?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 14:02:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754876#M1862</guid>
      <dc:creator>vinicius_olivei</dc:creator>
      <dc:date>2019-02-13T14:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754877#M1863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/vinicius.oliveira@enfas.de"&gt;vinicius.oliveira@enfas.de&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you looking for a way to send one CAN message at some frequency and another CAN message at a different frequency?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If yes, then you have 2 options to do this:&lt;/P&gt;&lt;P&gt;- first, a software approach where you are using a soft-timer&amp;nbsp;as a scheduler - more explained by &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/gramirezv"&gt;gramirezv&lt;/A&gt;‌ in this article (&lt;A href="https://community.nxp.com/thread/488575"&gt;(How-to) Multitasking on S32K144 MBDT Simulink&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;- second, a hardware approach where you are using a timer to do the scheduling for you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have 1 timer free on your board, that would be the way to go and just default to the software timer if you have none that you can use.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The implementation would be easy:&lt;/P&gt;&lt;P&gt;- get 2 timer blocks (LPIT) and generate an ISR at the desired periods (while having CAN Send in the respective ISRs) - here you can control the period&amp;nbsp;from the LPIT settings&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;- get 1 timer block to trigger 1 CAN Send, and leave the other in the main loop (not inside another ISR) - here you can control the period by setting the fixed step value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Razvan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2019 15:16:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754877#M1863</guid>
      <dc:creator>constantinrazva</dc:creator>
      <dc:date>2019-02-13T15:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754878#M1864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/constantinrazvan.chivu"&gt;constantinrazvan.chivu&lt;/A&gt;‌ Amazing topic.&lt;BR /&gt;Thank you for posting such a helpful tutorial!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been trying to use the same tutorials with two different NXP EVB. The first is S32K144 and the second is S32K148. In order to adapt the model, I did the following changes.&lt;BR /&gt;1:&amp;nbsp;&lt;SPAN&gt;C&lt;/SPAN&gt;hanged the &lt;STRONG&gt;Block's libraries-link&lt;/STRONG&gt; to the new NXP library.&lt;/P&gt;&lt;P&gt;2: &lt;SPAN&gt;C&lt;/SPAN&gt;hanged&amp;nbsp;the&amp;nbsp;&lt;STRONG&gt;MBD_S32K14x_Config_Information&lt;/STRONG&gt; &lt;SPAN&gt;to match&amp;nbsp;different boards.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3: &lt;SPAN&gt;C&lt;/SPAN&gt;hanged the&amp;nbsp;&lt;STRONG&gt;FCAN_Config&lt;/STRONG&gt; to match&amp;nbsp;different boards.&lt;/P&gt;&lt;P&gt;4: Changed the &lt;STRONG&gt;LED outputs&lt;/STRONG&gt;&amp;nbsp;to match different boards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The model is not performing as expected in the tutorial and since I don't have a CAN sniffer, I find it difficult to debug&amp;nbsp;the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly find attached the updated/edited master (&lt;SPAN&gt;S32K148)&lt;/SPAN&gt; and salve (&lt;SPAN&gt;S32K144) models. Can you help me figure out where the problem is?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;&lt;P&gt;Mohammed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 20:28:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/754878#M1864</guid>
      <dc:creator>mfarag</dc:creator>
      <dc:date>2019-04-04T20:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/1237070#M5803</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am also trying same kind of sensor. can you help me for reading any i2c slave device using s32k142 board.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vaibhav&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 06:32:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/1237070#M5803</guid>
      <dc:creator>vaibhav_n</dc:creator>
      <dc:date>2021-02-26T06:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/1237879#M5814</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/177214"&gt;@vaibhav_n&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The approach is the same on the S32K142 board. The only difference is that you have to identify the right pins and the right address of the sensor.&lt;/P&gt;
&lt;P&gt;Which sensor are you trying to use?&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Marius&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 09:44:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/1237879#M5814</guid>
      <dc:creator>mariuslucianand</dc:creator>
      <dc:date>2021-03-01T09:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to Build and Configure a CAN with S32K to Emulate Automotive Body Control Infrastructure</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/1237882#M5815</link>
      <description>&lt;P&gt;Thanks for the reply. i am using APDS9300 ambient light sensor.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 09:45:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-Build-and-Configure-a-CAN-with-S32K-to-Emulate-Automotive/m-p/1237882#M5815</guid>
      <dc:creator>vaibhav_n</dc:creator>
      <dc:date>2021-03-01T09:45:33Z</dc:date>
    </item>
  </channel>
</rss>

