This post describes various PIC18 data types used in XC8 and MPASM. We will discuss both PIC18 assembly (MPASM) as well as PIC18 C (XC8) data types with examples. PIC18 Data Types in MPASM (Assembly) PIC18 is an 8-bit microcontroller in which all the internal registers are 8-bit or 1 byte wide. So PIC18 assembly…
How to simulate a PIC18 XC8 C project in Proteus
This tutorial will explain step by step how to create a XC8 C project in MPLAB X for PIC18 micro-controller and simulate it using Proteus. Note: For this tutorial I am using MPLAB X v5.0 and XC8 v2.32. Creating an MPLAB X C Project To simulate a PIC18 XC8 project in Proteus, lets first create…
Getting started with STM32 F3 Discovery Kit
This post describes how to get started with STM32 F3 Discovery Kit. We will learn how to create led blinking project in STM32Cube IDE and run it on the STM32 F3 Discovery Kit. STM32 Family Introduction STM32 is a family of 32-bit microcontrollers developed by STMicroelectronics. STM32 is based on the ArmĀ® Cortex-M architecture. This…
How to Simulate STM32 Project in Proteus
This posts describes how to simulate an STM32 project in Proteus using STM32Cube IDE and Hardware Abstraction Layer (HAL). We will write a code to blink an LED in STMCube IDE and then test it in Proteus. STM32 is a family of 32-bit microcontrollers developed by STMicroelectronics. STM32 is based on the ArmĀ® Cortex-M architecture….
Writing Loop in PIC Assembly
This post explains various methods of writing a loop in PIC Assembly. PIC18 instructions like DECFSZ and conditional branch instructions can be used to write loops in PIC assembly language. Writing loop in PIC Assembly using DECFSZ instruction DECFSZ Instruction DECFSZ instruction operates on a file register. It does two things It decrements the file…
PIC Conditional Branch Instructions
PIC Conditional branch instructions are discussed in detail in this article along with examples. Conditional branch instructions are a very important part of PIC18 assembly. These instructions only branch when some condition is met. Conditional branch instructions are widely used to write loops and if/else type code using PIC18 assembly. Conditional branch instructions check the…
PIC Microcontroller Status Register
PIC microcontroller has a special register known as status register to show conditions like carry, digital carry, overflow etc after some computation in the ALU. This tutorial explains the PIC18 microcontroller status register in detail. PIC18 Status Register The status register (also known as flag register) in PIC 18 microcontroller is an 8-bit register. 5…
How to simulate PIC18 project using MPLAB X Simulator
Introduction This tutorial will explain step by step how to simulate a PIC18 project using MPLAB X simulator. For this tutorial I am using MPLAB X v5.0 but you can use any version upto v5.35. Version 5.35 is last version that included MPASM i.e. the assembler we require to compile the code used in this…
Node in Electric Circuits Explained
In this post, the concept of “node” in Electric circuits is explained. Appropriate examples are provided to enhance the understanding of the concept. Introduction Any two-terminal element in a circuit is known as a branch. Every branch in a circuit has a some voltage across it, known as branch voltage, and some current through it,…
Writing Vectorized MATLAB Code
Introduction This tutorial demonstrates benefits of writing vectorized MATLAB code which runs orders of magnitude faster than non-vectorized code. A loop is usually used if you want to perform same calculations on selected elements of an array. Vectorization is much faster alternative which can do the same in a single statement (or at least much…