博文

What is GND in Arduino?

图片
  In the simplest terms,   GND in Arduino stands for "Ground."   It is the   reference point for all voltage measurements in the circuit. Think of it like the "sea level" for your electronic circuit. Just as we measure the height of a mountain from sea level, we measure voltage (electrical "pressure") from the GND point. Key Concepts of GND: 1. The Common Return Path GND provides a common path for electric current to flow  back  to the power source. Every circuit is a loop. Current flows from the power source (like the 5V pin), through your components (like an LED and resistor ), and must return to the source via the GND pin to complete the circuit. Without a connection to GND, current cannot flow, and your circuit will not work. 2. The Zero-Volt Reference All voltage measurements on the Arduino are relative to GND. The  5V  pin is  +5 volts  relative to GND . The  3.3V  pin is  +3.3 volts  relative to GND . If you m...

How to check bootloader version in flash STM32H7?

图片
 There are two very different “bootloaders” people mean on an STM32H7 —pick the one you care about: A) ST’s system bootloader (ROM, not in Flash) This is ST’s factory ROM in System Memory . To read its version you must boot into the ROM and ask it. Quick steps (works on H7): Enter system bootloader Pull BOOT0=1 and reset, or jump from your app to the System Memory start address listed for your exact H7 part in AN2606 (tables show the address per device). Example posts show H723 using 0x1FF0_9800 (address varies by model, check AN2606).  Talk to the bootloader over one of the supported links (UART/I²C/USB-DFU/FDCAN/SPI per device in AN2606).  Issue “Get Version” UART: send 0x7F to sync, then the Get Version & RDP Status command (0x01 + 0xFE). The ROM replies with a one-byte bootloader version (e.g., 0x93 ⇒ V9.3). Protocol is documented in AN3155 (USART) and AN4221 (I²C).  Tools: STM32CubeProgrammer will show the bootloader versio...

How to drive an externally pulled up with fpga pin?

图片
 To drive a line that has an external pull-up from an FPGA , treat the pin as open-drain/open-collector : Never drive a ‘1’. Drive ‘0’ to pull the line low. Otherwise put the pin in Hi-Z so the external resistor pulls it high. That’s it—plus a few electrical + HDL details below. HDL patterns 1) Simple open-drain output (Verilog) // pad goes low when drive_low=1, otherwise Hi-Z (external R pulls high) wire drive_low; assign PAD = drive_low ? 1'b0 : 1'bz; 2) Bidirectional, e.g., I²C SDA (Verilog) inout wire SDA; wire sda_pull_low; // 1 = pull low, 0 = release assign SDA = sda_pull_low ? 1'b0 : 1'bz; // never drive '1' wire sda_read = SDA; // read the line 3) Using vendor I/O buffers Xilinx (IOBUF): wire sda_in; wire sda_pull_low; // 1 = pull low IOBUF #(.IOSTANDARD("LVCMOS33")) iobuf_sda ( .IO(SDA), .I(1'b0), // we only ever drive 0 .O(sda_in), // readback .T(~sda_pull_low)...

How to delete unwanted files in Raspberry Pi command?

图片
 Here’s a safe, no-nonsense cheat-sheet for deleting files from the Raspberry Pi command line (Raspberry Pi OS / Linux). 0) Quick safety checklist Double-check the path : pwd then ls -al (shows hidden files too). Tab-complete names; quote paths with spaces: "My file.txt" . Prefer interactive/confirming deletes at first: rm -i / rm -I . Avoid sudo rm -rf unless you’re 100% sure. 1) Delete single files # basic rm file.txt # confirm before each delete rm -i file.txt # verbose (show what’s removed) rm -v file.txt # file with spaces or leading dash rm -- "My file.txt" rm -- --weird-name 2) Delete many by pattern (glob) # delete all .log in current folder rm *. log # confirm each rm -i *. log # include hidden dotfiles rm .*.tmp 2>/dev/null 3) Delete directories # remove an empty dir rmdir mydir # remove a non-empty dir (careful!) rm -r mydir # safer: prompt once if >3 files rm -rI mydir # show each remov...

Which ESP32 microcontroller is best for data logging?

图片
“Best” depends on what kind of data-logger you’re building (battery life vs. throughput vs. easy PC sync). Here’s the short list I recommend, with why/when to pick each one. Top picks by use-case 1) ESP32-S3-WROOM-1 /1N8R8 (with PSRAM) — Best all-rounder for SD logging + easy USB sync Why: Has USB-OTG (device and host) built in, so you can expose logs to a PC via TinyUSB (CDC/MSC) without extra chips. It also includes a native SD/MMC host controller (1-bit/4-bit/8-bit modes) for higher SD speeds than SPI, plus optional PSRAM for big buffers.  Use when: You want fast SD writes, large burst buffers, and plug-to-PC convenience (appear as a drive or virtual COM). Notes: Follow SD bus pull-up rules (10 kΩ on CMD/DAT lines) and prefer 4-bit SDMMC over SPI for speed.  2) ESP32-WROVER -E (classic ESP32 + PSRAM) — Stable, tons of tutorials, high SDMMC throughput Why: The original ESP32 has a full SDMMC host (two slots, up to 4-bit) and WROVER adds PSRAM (g...

Which microcontroller is used in Arduino Uno?

图片
  The microcontroller used in the   Arduino Uno   is the   ATmega328P , made by Microchip (formerly Atmel). Here's a more detailed breakdown: Core Microcontroller: ATmega328P Architecture:  8-bit AVR RISC Clock Speed:  16 MHz (crystal oscillator on the Uno board) Flash Memory:  32 KB (0.5 KB used for bootloader) SRAM:  2 KB EEPROM:  1 KB Digital I/O Pins:  14 (6 can be used as PWM outputs) Analog Input Pins:  6 Operating Voltage:  5V Important Supporting Chips on the Uno Board While the ATmega328P is the "brain," the Uno has other important chips: USB-to-Serial Converter: ATmega16U2  (or  ATmega8U2  in older revisions) Handles USB communication with your computer Converts USB signals to serial that the main microcontroller can understand Voltage Regulator: NCP1117ST50T3G Regulates incoming voltage to stable 5V and 3.3V Different Uno Versions It's worth noting that there have been some variations: Uno R3  (...

What coding language does Arduino use?

图片
  The short answer is:   Arduino uses a variant of C++. But that's a bit like saying "a car uses an internal combustion engine" – it's technically correct but doesn't give you the full picture. Let's break it down in detail. 1. The Core Language: C++ with a Simplifying Wrapper The code you write for Arduino is processed by a  C++ compiler  (avr-g++). However, the Arduino environment provides a simplified layer on top of standard C++. It's C++:  You can use core C++ features like functions, variables, classes, and libraries. It's Simplified:  The complex parts of C++ (like memory management with  new / delete  and the Standard Template Library - STL) are often avoided or unavailable on these small microcontrollers due to limited memory and processing power. It has a Unique Structure:  Arduino programs are structured around two main functions,  setup()  and  loop() , which is not standard C++ but is provided by the Arduino core ...