S32K144 Peripherals

So hello guys, welcome back to NXP Semiconductors S32K144 MCU Tutorial series. In the last blog we had started with S32K144 MCU GPIO Peripheral. In this blog we are going to explore the UART Peripheral. Going to Start with UART peripheral. Objective would be to get.

  • familiarity with UART peripheral for S32K144 MCU.
  • Would be understanding UART peripheral from Hardware point of view in S32K144 MCU.
  • Going to understand then how to use UART peripheral via S32K SDK/uart driver.
  • Would also be demonstrating the uart_echo_pall sketch.

So read along the blog and do tell me its reviews!

Table of Contents

UART Peripheral Theory

UART is a serial communication protocol which is used to interface external sensor & IoT modules to the Host MCU. IoT modules like: GSM Module, GPS Module, BLE Modules, WiFi Modules are connected to Host MCU via UART protocol. Thus, understanding of UART communication protocol and its driver implementation, plays a crucial role.

To know about UART peripheral in theory, viewers can refer to this blog.

LPUART Peripheral in S32K144 MCU

In S32K144 MCU, UART can be used via 2 peripherals: LPUART & FlexIO.

UART in S32K144 MCU

LPUART is referred as Low Power Universal Asynchronous Receiver/Transmitter. LPUART is onchip peripheral only to do UART communication protocol. UART is a serial communication protocol which is done via UART peripheral in the Microcontrollers.

Also, in S32K144, there is FlexIO peripheral through which on-board serial communication protocols like UART, I2C & SPI can be emulated. So, through FlexIO peripheral, also UART peripheral can be implemented. To know about FlexIO peripheral in S32K144, refer to this blog.

Features of UART via LPUART peripheral in S32K144 MCU:

  • LPUART peripheral of S32K144 supports full duplex mode and has NRZ data encoding (That is Logic 1 bit represents High value and Logic 0 bit represents Low value).
  • It has programmable Baud rates(
  • LPUART peripheral supports Interrupts mode, DMA mode or pooled operation mode for transmitting/receiving the data using LPUART protocol or for detecting below listed errors while LPUART communication session is happening:
  1. Transmit data register empty and transmission complete.
  2. Receive data register full.
  3. Receive overrun, parity error, framing error, and noise error.
  4. Idle receivers detect.
  5. Active edge on receive pin.
  6. Break detect supporting LIN.
  7. Receive data match.
  • S32K144 also supports hardware parity generation and checking to ensure the integrity of the data while LPUART communication is happening.
  • It has Programmable LPUART data length of 7-10 bits and LPUART stop bits of 1-2 bits.
  • S32K144 MCU has feature to use the LPUART peripheral to wake up the MCU (if it is programmed in sleep modes), it can be waked up in either of the 3 below mentioned events:
  1. Idle line wakeup
  2. Address mark wakeup
  3. Receive data match.
  • Support of request to send (RTS) and clear to send (CTS) signals, for hardware flow control,  example of hardware flow control is a half-duplex radio modem to computer interface.
  • Support of IrDA 1.4 format with programmable pulse width for IR communication.
  • LPUART peripheral of S32K144 supports independent FIFO buffer for transmission and receiving of Data.
  • Also, LPUART peripheral FIFO of S32K144 has additional features like:
  1. configurable watermark (lowest number of bytes) for transmit and receive buffer, when watermark is achieved corresponding status is changed of LPUART peripheral.
  2. Option for receiver to assert request after a configurable number of idle. 
    characters if receive FIFO is not empty.
  • Tx and Rx FIFO in S32K144 for all LPUART Instances both are of 4 words size. 1 Word is 1 byte(8 bits). So FiFo size is 4 byte long(32 bits).

LPUART Hardware Pinout in S32K144 MCU

LPUART Pinout and Hardware Instances

LPUART peripheral in S32K144 has 3 instances: LPUART0, LPUART1, LPUART2.

All the LPUART Instances has 4 pins: 

  • RX: Receiving of data
  • TX: Transmission of data
  • CTS: Clear to Send pin for hardware flow control.
  • RTS: Request to Send for hardware flow control.
    S32K144 UART Pins

Each LPUART instance supports all the 4 pins, with below mentioned pin details.

How to use LPUART Pins in S32K144 MCU for doing UART Communication?

Now for doing UART communication, we need to connect hardware UART pins of the MCU, for doing so follow the steps:

  1. At first select which instance of LPUART wanna use, once selected. As told above their are 3 instances of LPUART in S32K144 MCU.
  2. Once selected, then use above excel to short select which pin of corresponding LPUART has to be used. 
  3. Lets say we use LPUART1 and use PTC7 and PTC6 as Tx & Rx pins of LPUART.
  4. So connect these pins of MCU with external UART Module.
  5. Remember Tx pin of MCU is connected to Rx pin of external UART Module and Rx pin of MCU is connected to Tx pin of external UART Module.
  6. Here i am going to use USB to serial FTDI connector with Original S32K144 evaluation2 board.
  7. With ElecronicsV2 board, it has on-board UART driver IC at LPUART1 PTC7 and PTC6 pins.

How to configure UART Peripheral in S32K144 using S32 Design Studio IDE

UART Peripheral of S32K144 MCU can be configured using the Peripheral configuration tools of S32 Design Studio. These tools provide us with the GUI interface to configure the UART Peripheral of the MCU. To know in detail about the Peripheral configuration of S32 Design Studio refer to these.

BLE Module interfacing with S32K144 MCU
GPS Module interfacing with S32K144 MCU
WiFi Module interfacing with S32K144
GSM Module interfacing with S32K144

LPUART SDK for S32K144 MCU

LPUART SDK

S32K SDK/drivers provide an easy to use and quick way to use LPUART peripheral in S32K144, which is known as LPUART SDK.

LPUART SDK for S32K MCU’s

Each S32 SDK driver can be configured and enabled to use in the project via S32 Configuration Tool. Will be digging into that part, in next section. For now, let’s understand the LPUART SDK in some detail, so as to use UART peripheral via LPUART.

LPUART SDK files

In the SDK of LPUART there are header files and source files for LPUART Driver and LPUART Interrupt.

  • LPUART interrupt files contains functions for using &configuring of LPUART interrupts and IRQ handler in S32K144 MCU.
  • LPUART driver files contains functions for using/configuration of LPUART Peripheral.

LPUART Driver 

LPUART driver files are further divided into LPUART Peripheral Abstraction Layer (PAL) & LPUART Low-level drivers., as shown below:

LPUART Driver Files
  • LPUART Peripheral Abstraction Layer(PAL): contains functions and variables that are directly used in main.c or application code. And internally these functions use the LPUART Low-level drivers & LPUART IRQ . So if hardware is changed LPUART PAL would remain same and only internal low-level driver files need to be changed or modified. By this way we don’t have make many changes on application level.
  • LPUART Low-level driver: contains functions that configures the LPUART peripheral registers for initializing the peripheral, using the peripheral and processing the data of peripheral at hardware level. These files are the ones which actually interacts with the hardware and make it configurable to our needs. 

In the blogs we will be exploring the LPUART Peripheral Abstraction Layer files (PAL) in more details, as that would be directly used in our application project development(main.c) and driver creation of UART modules (GPS, GSM, IoT Modules and etc)

LPUART PAL

In LPUART PAL there are 2 files lpuart_driver.c and lpuart_driver.h files.

Lets get into these files:

  1. lpuart_driver.h: contains the enums, structures and function declarations that would be used in application code. Only functions which are declared in this header file can be used in main.c or application project.
  2. lpuart_driver.c: contains the function definations of the declared functions(uses the low-level driver functions) along with some static functions also that are restricted to use in this file only.

Functions

How to use LPUART PAL for doing UART Communication in S32K144 MCU.

  1. Features of LPUART PAL.
  2. Initialization and configuration API’s of UART peripheral using LPUART PAL.
  • LPUART_DRV_Init: This function is the first function that has to be used in main.c to initialize the LPUART peripheral. This function is just like Serial.begin(9600) of Arduino IDE environment.
				
					status_t LPUART_DRV_Init(uint32_t instance, lpuart_state_t * lpuartStatePtr,
                         const lpuart_user_config_t * lpuartUserConfig);

				
			

This function has 3 function parametrs as follows:

  1. instance: integer number indicating which instance of LPUART we are going to use.
  2. lpuart_user_config and lpuart_state_t: structure pointers have to be sent in this function as parameters. (For the info on these structures refers next section)
				
					#define INST_LPUART_LPUART_1  1

extern lpuart_state_t lpUartState1;

/* External declaration of LPUART configuration structure */
extern const lpuart_user_config_t lpUartInitConfig1;

lpuart_state_t lpUartState1;

const lpuart_user_config_t lpUartInitConfig1 = {
  .transferType = LPUART_USING_INTERRUPTS,
  .baudRate = 9600UL,
  .parityMode = LPUART_PARITY_DISABLED,
  .stopBitCount = LPUART_ONE_STOP_BIT,
  .bitCountPerChar = LPUART_8_BITS_PER_CHAR,
  .rxDMAChannel = 0UL,
  .txDMAChannel = 0UL
};

 /* Initialize LPUART instance */
  LPUART_DRV_Init(INST_LPUART_LPUART_1, &lpUartState1, &lpUartInitConfig1);
 
				
			

In LPUART PAL their are 3 ways by which we can send and receive data.

  1. Interrupt based
  2. DMA Based 
  3. Pooling Based.

In this blog, we are going to explore and understand pooling based method and it’s API. As to use by interrupt and DMA based, we have to know about Interrupt and DMA. So we are going to cover Interrupt and DMA based LPUART communication under topics: Interrupts in S32K144 and DMA in S32K144 MCU.

What is pooling method in Embedded?

LPUART PAL API’s for doing pooling based communication

  • LPUART_DRV_SendDataPolling
				
					status_t LPUART_DRV_SendDataPolling(uint32_t instance, const uint8_t *txBuff, uint32_t txSize);

				
			

This function has 3 parametrs:

  1. instance: integer number indicating which instance of LPUART we are going to use.
  2. txBuff: buffer pointer, pointing to the data which needs to be send out.
  3. txSize: size of data that has to be sent.
				
					  /* Welcome message displayed at the console */
#define welcomeMsg "This example is an simple echo using LPUART\r\n\
it will send back any character you send to it.\r\n\
The board will greet you if you send 'Hello Board'\r\
\nNow you can begin typing:\r\n"

  
  /* Send a welcome message */
  LPUART_DRV_SendDataPolling(INST_LPUART_LPUART_1, (uint8_t *)welcomeMsg, strlen(welcomeMsg));

				
			
  • LPUART_DRV_ReceiveDataPolling
				
					status_t LPUART_DRV_ReceiveDataPolling(uint32_t instance, uint8_t *rxBuff, uint32_t rxSize);

				
			

This function has 3 function parameters:

  1. instance: integer number indicating which instance of LPUART we are going to use.
  2. rxBuff: buffer pointer, would be containing the received data.
  3. rxSize: size of data that has to be received.
				
					  /* Receive buffer size */
#define BUFFER_SIZE 256U

/* Buffer used to receive data from the console */
uint8_t buffer[BUFFER_SIZE];

LPUART_DRV_ReceiveDataPolling(INST_LPUART_LPUART_1, buffer, 1U);
    
				
			
Data Types

There are 2 structures that are important and will be used often

  • lpuart_user_config_t: This structure has members to configure the LPUART according to user defined settings.
				
					/*! @brief LPUART configuration structure
 *
 * Implements : lpuart_user_config_t_Class
 */
typedef struct
{
    uint32_t baudRate;                           /*!< LPUART baud rate */
    lpuart_parity_mode_t parityMode;             /*!< parity mode, disabled (default), even, odd */
    lpuart_stop_bit_count_t stopBitCount;        /*!< number of stop bits, 1 stop bit (default) or 2 stop bits */
    lpuart_bit_count_per_char_t bitCountPerChar; /*!< number of bits in a character (8-default, 9 or 10);
                                                      for 9/10 bits chars, users must provide appropriate buffers
                                                      to the send/receive functions (bits 8/9 in subsequent bytes);
                                                      for DMA transmission only 8-bit char is supported. */
    lpuart_transfer_type_t transferType;         /*!< Type of LPUART transfer (interrupt/dma based) */
    uint8_t rxDMAChannel;                        /*!< Channel number for DMA rx channel.
                                                      If DMA mode isn't used this field will be ignored. */
    uint8_t txDMAChannel;                        /*!< Channel number for DMA tx channel.
                                                      If DMA mode isn't used this field will be ignored. */
} lpuart_user_config_t;


				
			
				
					/* External declaration of LPUART configuration structure */
extern const lpuart_user_config_t lpUartInitConfig1;

const lpuart_user_config_t lpUartInitConfig1 = {
  .transferType = LPUART_USING_INTERRUPTS,
  .baudRate = 9600UL,
  .parityMode = LPUART_PARITY_DISABLED,
  .stopBitCount = LPUART_ONE_STOP_BIT,
  .bitCountPerChar = LPUART_8_BITS_PER_CHAR,
  .rxDMAChannel = 0UL,
  .txDMAChannel = 0UL
};
				
			
  • lpuart_state_t: This structure has data members, which keep track of the on-going transfers . 
				
					/*!
 * @brief Runtime state of the LPUART driver.
 *
 * Note that the caller provides memory for the driver state structures during
 * initialization because the driver does not statically allocate memory.
 *
 * Implements : lpuart_state_t_Class
 */
typedef struct
{
    const uint8_t * txBuff;              /*!< The buffer of data being sent.*/
    uint8_t * rxBuff;                    /*!< The buffer of received data.*/
    volatile uint32_t txSize;            /*!< The remaining number of bytes to be transmitted. */
    volatile uint32_t rxSize;            /*!< The remaining number of bytes to be received. */
    volatile bool isTxBusy;              /*!< True if there is an active transmit.*/
    volatile bool isRxBusy;              /*!< True if there is an active receive.*/
    volatile bool isTxBlocking;          /*!< True if transmit is blocking transaction. */
    volatile bool isRxBlocking;          /*!< True if receive is blocking transaction. */
    lpuart_bit_count_per_char_t bitCountPerChar; /*!< number of bits in a char (8/9/10) */
    uart_callback_t rxCallback;          /*!< Callback to invoke for data receive
                                              Note: when the transmission is interrupt based, the callback
                                              is being called upon receiving a byte; when DMA transmission
                                              is used, the bytes are copied to the rx buffer by the DMA engine
                                              and the callback is called when all the bytes have been transferred. */
    void * rxCallbackParam;              /*!< Receive callback parameter pointer.*/
    uart_callback_t txCallback;          /*!< Callback to invoke for data send
                                              Note: when the transmission is interrupt based, the callback
                                              is being called upon sending a byte; when DMA transmission
                                              is used, the bytes are copied to the tx buffer by the DMA engine
                                              and the callback is called when all the bytes have been transferred. */
    void * txCallbackParam;              /*!< Transmit callback parameter pointer.*/
    lpuart_transfer_type_t transferType; /*!< Type of LPUART transfer (interrupt/dma based) */
#if FEATURE_LPUART_HAS_DMA_ENABLE
    uint8_t rxDMAChannel;                /*!< DMA channel number for DMA-based rx. */
    uint8_t txDMAChannel;                /*!< DMA channel number for DMA-based tx. */
#endif
    semaphore_t rxComplete;              /*!< Synchronization object for blocking Rx timeout condition */
    semaphore_t txComplete;              /*!< Synchronization object for blocking Tx timeout condition */
    volatile status_t transmitStatus;    /*!< Status of last driver transmit operation */
    volatile status_t receiveStatus;     /*!< Status of last driver receive operation */
} lpuart_state_t;

				
			
				
					extern lpuart_state_t lpUartState1;

lpuart_state_t lpUartState1;

				
			

UART Demo Code for S32K144 MCU

 S32 SDK/provides as example demo on LPUART driver to demonstarate how to use the LPUART driver for UART communicatio protocol. Demo Example is named as: lpuart_echo_s32k144

				
					/*
 * Copyright 2020 NXP
 * All rights reserved.
 *
 * NXP Confidential. This software is owned or controlled by NXP and may only be
 * used strictly in accordance with the applicable license terms. By expressly
 * accepting such terms or by downloading, installing, activating and/or otherwise
 * using the software, you are agreeing that you have read, and that you agree to
 * comply with and are bound by, such license terms. If you do not agree to be
 * bound by the applicable license terms, then you may not retain, install,
 * activate or otherwise use the software. The production use license in
 * Section 2.3 is expressly granted for this software.
 */
/* ###################################################################
**     Filename    : main.c
**     Project     : lpuart_echo_s32k144
**     Processor   : S32K144
**     Version     : Driver 01.00
**     Compiler    : GNU C Compiler
**     Date/Time   : 2020-02-20, 12:27, # CodeGen: 1
**     Abstract    :
**         Main module.
**         This module contains user's application code.
**     Settings    :
**     Contents    :
**         No public methods
**
** ###################################################################*/
/*!
** @file main.c
** @version 01.00
** @brief
**         Main module.
**         This module contains user's application code.
*/
/*!
**  @addtogroup main_module main module documentation
**  @{
*/
/* MODULE main */

/* Including needed modules to compile this module/procedure */
#include "sdk_project_config.h"
#include <stdio.h>
#include <string.h>

volatile int exit_code = 0;

/* Welcome message displayed at the console */
#define welcomeMsg "This example is an simple echo using LPUART\r\n\
it will send back any character you send to it.\r\n\
The board will greet you if you send 'Hello Board'\r\
\nNow you can begin typing:\r\n"

/* Error message displayed at the console, in case data is received erroneously */
#define errorMsg "An error occurred! The application will stop!\r\n"

/* Timeout in ms for blocking operations */
#define TIMEOUT     500U

/* Receive buffer size */
#define BUFFER_SIZE 256U

/* Buffer used to receive data from the console */
uint8_t buffer[BUFFER_SIZE];
uint8_t bufferIdx;

/* UART rx callback for continuous reception, byte by byte */
void rxCallback(void *driverState, uart_event_t event, void *userData)
{
    /* Unused parameters */
    (void)driverState;
    (void)userData;

    /* Check the event type */
    if (event == UART_EVENT_RX_FULL)
    {
        /* The reception stops when newline is received or the buffer is full */
        if ((buffer[bufferIdx] != '\n') && (bufferIdx != (BUFFER_SIZE - 2U)))
        {
            /* Update the buffer index and the rx buffer */
            bufferIdx++;
            LPUART_DRV_SetRxBuffer(INST_LPUART_LPUART_1, &buffer[bufferIdx], 1U);
        }
    }
}

/*!
 \brief The main function for the project.
 \details The startup initialization sequence is the following:
 * - startup asm routine
 * - main()
 */
int main(void)
{
  /* Write your local variable definition here */
  status_t status;
  /* Declare a buffer used to store the received data */
  uint32_t bytesRemaining;

  /* Write your code here */
  /* For example: for(;;) { } */

  /* Initialize and configure clocks
   *     -    see clock manager component for details
   */
  CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
                 g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
  CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

  /* Initialize pins
   *    -    See PinSettings component for more info
   */
  PINS_DRV_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

  /* Initialize LPUART instance */
  LPUART_DRV_Init(INST_LPUART_LPUART_1, &lpUartState1, &lpUartInitConfig1);
  /* Install the callback for rx events */
  LPUART_DRV_InstallRxCallback(INST_LPUART_LPUART_1, rxCallback, NULL);
  /* Send a welcome message */
  LPUART_DRV_SendDataBlocking(INST_LPUART_LPUART_1, (uint8_t *)welcomeMsg, strlen(welcomeMsg), TIMEOUT);

  /* Infinite loop:
   *     - Receive data from user
   *     - Echo the received data back
   */
  while (1)
  {
      /* Receive and store data byte by byte until new line character is received,
       * or the buffer becomes full (256 characters received)
       */
      LPUART_DRV_ReceiveData(INST_LPUART_LPUART_1, buffer, 1U);
      /* Wait for transfer to be completed */
      while(LPUART_DRV_GetReceiveStatus(INST_LPUART_LPUART_1, &bytesRemaining) == STATUS_BUSY);

      /* Check the status */
      status = LPUART_DRV_GetReceiveStatus(INST_LPUART_LPUART_1, &bytesRemaining);

      if (status != STATUS_SUCCESS)
      {
          /* If an error occurred, send the error message and exit the loop */
          LPUART_DRV_SendDataBlocking(INST_LPUART_LPUART_1, (uint8_t *)errorMsg, strlen(errorMsg), TIMEOUT);
          break;
      }

      /* Append string terminator to the received data */
      bufferIdx++;
      buffer[bufferIdx] = 0U;

      /* If the received string is "Hello Board", send back "Hello World" */
      if(strcmp((char *)buffer, "Hello Board\n") == 0)
      {
          strcpy((char *)buffer, "Hello World\n");
      }

      /* Send the received data back */
      LPUART_DRV_SendDataBlocking(INST_LPUART_LPUART_1, buffer, bufferIdx, TIMEOUT);
      /* Reset the buffer index to start a new reception */
      bufferIdx = 0U;
  }

  for(;;) {
    if(exit_code != 0) {
      break;
    }
  }
  return exit_code;
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

/* END main */
/*!
 ** @}
 */

				
			
lpuart_echo_s32k144 demo code explanation:

Next blogs to read

Automotive Microcontroller programming training session at DTU College

We have successfully conducted a 10-day training program on Automotive Microcontroller Programing at Delhi Technical University from 6th December to 15th December. The training program was attended by Btech Students of ECE branch and some students of Mtech branch. List of attendance as per dates are: 06/12/2024:25 07/12/2024:25 08/12/2024:23 09/12/2024:22 10/12/2024: Holiday by students 11/12/2024:23 12/12/2024: 22 13/12/2024:19 14/12/2024:15 15/12/2024:10 The 10 day training program session start by introducing students with the Microcontroller Technology. On day 1 of the training session students were made to taught microcontroller technology. General overview of what is semiconductor industry, how does semiconductor industry works and different kind of companies in semiconductor industry. Followed by in depth exploration of microcontroller technology, which is one of the kind of semiconductor chip. Diving into Building block, Functional block, Hardware Development Kit and Software Development Kit of Microcontroller Technology. In the end we conclude the day by discussing about Industrial Microcontroller like that of NXP, Renesas, Infenion giving students exposure to MCU’s apart from Arduino/ESP frameworks. We very much focus on NXP S32K144 MCU which is an automotive MCU and get handson feel with Its Development Board ElecronicsV3 and SDK of S32 Design Studio On Second day we followed by exploring and diving deep into automotive technologies. How Automotive Industry works, Different companies involved in it and overview of Automotive technologies like Functional Domain, E/E Architecture and Autosar Software Tech Stack. On this we very much deep dive into Autosar Software Tech stack and give stduents overview on how to start with it. We start by exploring the MCAL Layer technology of Autosar Software Tech Stack and set up its Software environment using S32 Design Studio IDE and its software package installation. On Day 3-4 we started with Handson experiment after getting initial overview of technologies. On Day 3 & 4 students explored the GPIO/PORT peripheral in Microcontroller technology, students were given in depth overview and understanding on how this peripheral works, why is it used, how to use it and its applications. Students were made to taught about this peripheral from Microcontroller datasheet and made to understand different specs/features of this peripheral from MCU documents. After that students were made to taught how to use this peripheral in Automotive Microcontroller by making them understand on its peripheral stack using Autosar MCAL Driver specs. Students were made to taught how to use Autosar Code configurator tool for GPIO/PORT peripheral. They were taught how to use Software API’s, what parameters to send on those API’s an in which chronology those API’s need to be used. In the end students were given time to learn and have Handson with Embedded Softwrae Debugging of microcontroller. They were made to develop different functional demo codes on GPIO/PORT peripheral and taught how to do embedded software debugging for it. Day 5 was holiday: After continous 4 days of technical learning and information, students asked for day off. Number of students on that day have interviews and assessments so day off on this day was taken. Day 6-7: we started with Handson experiment of ADC peripheral of microcontroller technology. We started by getting overview on what is ADC peripheral, how does it work, why is it needed and different specs/features of ADC peripheral in MCU’s. After that we deep dive into NXP S32K144 concentric ADC peripheral. We explored how ADC peripheral works in S32K144 MCU using its datasheet and exploring its peripheral register’s. After that students were made to taught how to use ADC peripheral in Automotive Microcontroller by making them understand on ADC peripheral Driver using Autosar MCAL Driver specs. Students were made to taught how to use Autosar Code configurator tool for ADC peripheral. Understanding and exploring its different menu sections, sub menu sections. Which sections to configure, how to configure and why to configure. They were taught how to use Software API’s of ADC Driver stack, what parameters to send on those API’s an in which chronology those API’s need to be used. In the end students were given time to learn and have Handson with Embedded Softwrae Debugging of microcontroller for ADC Peripheral. They were made to develop simple functional demo codes of reading POT values using ADC peripheral and taught how to do embedded software debugging for it. Day 8-9:  On these 2 days students were made to taught PWM Peripheral of Microcontroller technology. How PWM signals are generated, how they work , different sepcs/features of PWM Signals. Students were made to introduce the concept of TIMER peripheral in MCU’s which is used to generate PWM signals via it. In these 2 days students were also made to get familarize with Logic Analzer tool which is used to capture PWM Signals. Students were made to understand TIMER peripheral of NXP S32K144 Automotive MCU, how it works and how to use it for generating PWM signals. Followed by theory and hardware overview of PWM signals, students were made to do Handson exploration by generating PWM signals of different frequency/duty cycle using PWM Driver stack of Autosar MCAL Layer. After that students were made to taught how to use TIMER peripheral in Automotive Microcontroller by making them understand on PWM peripheral Driver using Autosar MCAL Driver specs. Students were made to taught how to use Autosar Code configurator tool for PWM Driver. Understanding and exploring its different menu sections, sub menu sections. Which sections to configure, how to configure and why to configure. They were taught how to use Software API’s of PWM Driver stack, what parameters to send on those API’s an in which chronology those API’s need to be used. In the end students were given tasks to generate PWM signals of different frequencies and duty cycle. On the last day, students were instructed to do Integration of What all thinsg they have learned so far. They were given task to Combine all Peripheral of Automotive MCU which was taught as if now in a single project. They did a task of using GPIO, PORT, ADC & PWM Peripherals

Read More »
Kunal Gupta
Author: Kunal Gupta
Placeholder for: {{uwp_button_group}}

Author

Kunal Gupta

Leave a comment

Stay Updated With Us

Error: Contact form not found.

      Blog