A logic analyzer is a crucial electronic instrument used in the design and testing of digital circuits. It captures and displays multiple signals from a digital system or circuit, allowing engineers to observe and analyze the operation and interaction of those signals over time. This tool is indispensable for debugging complex digital systems, verifying correct… Continue reading Programming with STM32 – Logic Analyzer
Tag: c
Programming STM 32- Address of Variable
Address of variables &myData An & sign put before the variable name actually gives the address of the data myData variable holds The format specifier used to print the address of a variable is %p Example #include <stdio.h> int main() { char a1 = ‘A’; printf(“The address of variable a1 is %pn”,&a1); return 0; }… Continue reading Programming STM 32- Address of Variable
Variable naming best practices
When programming in C, following consistent and clear variable naming conventions is crucial for maintaining readable and manageable code. Here are the key rules and best practices for naming variables: Alphanumeric and Underscores Only: Variable names can consist of letters (both uppercase and lowercase), digits, and underscores (_). However, they must start with a letter… Continue reading Variable naming best practices
Data types in Embedded C
Data types There are 2 data types a. Integer b. Float Integer Data types Char (Character) · Size: Typically, 1 byte (8 bits) · Range: · Signed: -128 to 127 · Unsigned: 0 to 255 · Usage: Used to store single characters such as ‘A’, ‘b’, ‘1’, etc. It can also be used to store small integers. · Example: char letter = ‘A‘;… Continue reading Data types in Embedded C
Finding 2’s compliment
Write down the binary number: Make sure it has a fixed number of bits (e.g., 8 bits). Invert the digits: Change every 0 to 1 and every 1 to 0. This is known as taking the one’s complement of the number. Add one to the result: This final step gives you the two’s complement of… Continue reading Finding 2’s compliment