Calibrate STPM32/33 For Smart Energy Meter embedded by neudeep - August 21, 2021October 30, 20210 In this tutorial, we will see how to calibrate STPM32/33. STPM32 is an ASSP (Application Specific Standard Product) for metering applications. It is designed for measurement of power and energies in a power line with high accuracy. It provides instantaneous voltage and currents, active, reactive and apparent powers, and energies. Lets start with how to Calibrate STPM32/33 For Digital Smart Energy Meter. Introduction To Energy Calibration Calibration is the process of comparing reading on one piece of equipment or system, with another piece of equipment. The other piece of equipment that has been calibrated and referenced to a known set of parameters. After the design phase, any tolerance of the real components from these values or device internal parameter drift can
SAME54 I2C Driver Issue Solved embedded by blog_1buq8n - September 10, 2019October 10, 20190 If you are reading this post that means you are using ATMEL or Microchip controller. We are using ATSAME54 micro from microchip, it is ARM based cortex-M4 series controller. In our application we have around eight I2C ( Inter-integrated Circuit) slave devices connected. I2C slave devices includes, RTC, onboard temperature sensor, FRAM, LED drivers etc. Well as you know all I2C slave devices can be addressed using their addresses. Well as most of guys does we too have downloaded sample code from start.atmel.com and tested. We have SAME54 explained pro and we brought PCA9685 LED driver. This is simple I2C based LED driver and is easily available, its schematic and design also available from adafruit. With sample code and its
Modbus Master Stack On ATSAME54 With RTOS embedded by neudeep - September 7, 2019September 7, 20190 In previous post we discussed about how to port modbus slave stack on ATSAME54. This post we will discuss on how to port modbus master stack on SAME microcontroller. You can download example freemodbus master stack for reference from FreeModbus. We have referred the 'AT91SAM7X_FREETROS' example project. You can follow the steps from previous post for creating directory of project files. Instead of modbus slave stack, add modbus master stack. In addition, We are using FreeRTOS in our project. So In top level directory we have added FreeRTOS V9.0.0 . Please refer to modifications in port specific files described in previous post. So lets begin with issues while port modbus master stack on SAME, Without an operating systems there are
Port Modbus Slave Stack On ATSAME54 embedded by neudeep - July 30, 20190 We are referring modbus server stack implementation for SAM3X and We want to port it on SAME54P20A. First we have downloaded the example project for SAME54P20A which is using Usart_Asynchrnous module from Atmel START. Then create new top level directory for project files. Following files needs modification while porting, they are present in sub directory named 'port' which will contain all port specific files, portserial.cporttimer.cportevent.cportother.cport.h Atmel start project is having makefile in sub-directory 'gcc'. Add these port specific files paths in makefile. Then add modbus stack folder to top level directory which is having all the modbus specific functions. For compilation we hav to add these all file paths in makefile which is in gcc directory. We have to first
How To Use Two Timers In Same Project embedded by blog_1buq8n - July 29, 2019August 22, 20210 If you are using SAM series controller you probably have came across this question, How do i implement two timer which generate two interrupt at different time in same project? or How we can use two timer in same project in SAME54 controller? Well SAM series controller are ARM-based MCUs and MPUs from ATMEL now Microchip. We are using ATSAME54P20A ie SAME54 explained pro board to evaluate the functionality of it. So created new project using start.atmel.com with TC0 and TC1 along with WDT and interrputs. The project tree looks as below, This project works well and TC0 timer interrupt is working but TC1 timer interrupt is not working. Following is code for initialization and using
How To Write RTOS Safe ISR For ATSAME embedded by blog_1buq8n - July 26, 2019August 22, 20210 In our application it is required to use FreeRTOS API functions from an interrupt service routine(ISR). Good thing about FreeRTOS is it has provided interrupt safe API, meaning one can use FreeRTOS API functions from ISR, as they have provided two versions of some API. Functions intended for use from ISRs have “FromISR” appended to their name eg. xQueueSendFromISR How to set correct priority levels if I want to call an ISR-safe function from interrupt? Because the maximum level of configKERNEL_INTERRUPT_PRIORITY is 1 and the minimum preemption Priority level of any interrupt source e.g. and edge interrupt is 15. That means it is above the max. level of configKERNEL_INTERRUPT_PRIORITY. In our application we were using xQueueSendFromISR() from IRQ10 ie 'EIC_10_IRQn', to
How To Mock Local Variable In Ceedling embedded by neudeep - May 17, 2019August 30, 20210 In embedded system product development there are quite number of tools and framework for unit testing the C code. In this blog post I will explain about how to mock local variable in ceedling for unit testing. Ceedling is one of the widely used open source framework for your test driven product development (TDD) in embedded systems. What is Ceedling 'Ceedling' is open source framework used in unit testing, in our project which involves embedded system development we are using 'ceedling' framework. Ceedling works together with Unity and CMock. Both are are open source tools for testing C code. Ceedling has feature of automatic generation of mock. Read more about ceedling features in our previous blog post. Unit Testing Tools Unit
EmbSysRegView In Eclipse For SAME54 On Ubuntu embedded by blog_1buq8n - April 4, 2019April 11, 20191 After successfully able to debug using OpenOCD and Eclipse, Now it is time to explore more. To start with, lets install EmbSysRegView plugin, This plugin gives similar functionality to the 'I/O view' in Atmel Studio 7. It displays special functions registers (SFR), peripheral registers values and memory values. This needed in embedded system development. Installation Bad news is, You can not install the EmbSysRegView plugin from the eclipse marketplace since eclipse marketplace is referring to old sourceforge download URL. Installation from Marketplace fails: An error occurred while collecting items to be installed session context was:(profile=_Applications_Eclipse.app_Contents_Eclipse, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). Artifact not found: http://embsysregview.sourceforge.net/update/plugins/org.eclipse.cdt.embsysregview_0.2.6.jar. The new link to download is from sourceforge latest download, But it does not download full files and this
Debugging in Eclipse Using OpenOCD on Ubuntu embedded by blog_1buq8n - April 3, 2019April 11, 20192 This is second part of ongoing tutorial on setting up GCC + Eclipse + OpenOCD environment for use with the SAME54 Xplained pro board on latest Ubuntu system. In order to be able to follow this blog entry you must already have the gcc-arm toolchain and openOCD configured When we talk about debugging it is important to know that the actual "debugger" or emulation hardware is "on chip" and is called the "on chip debug" (OCD) hardware. While there are other methods to debug your embedded code using DDD, Kgdb, & Gdb on Ubuntu in this post will see debugging using Eclipse. Prerequisite - Download and install the latest version of Eclipse (open-source integrated development environment). Compile and install openOCD
Setup GCC ARM Tool Chain For SAM E54 Xplained Pro embedded by blog_1buq8n - March 30, 2019March 30, 20190 steps for setting up a free and fully functional GCC + Eclipse + OpenOCD GDBServer environments for use with the SAME54 Xplained Pro board.