Saltar al contenido ForoHackers

Microcontrollers: start here

Microcontroladores
#2943 · · Citar · Denunciar

A microcontroller is a whole small computer on one chip: a CPU core, flash for the program, RAM, and peripherals wired to pins. It runs one program from power-on to power-off, usually without an operating system, and it talks to the world through voltages, timers and buses.

Key concepts

  • Memory map: peripherals are addresses. Writing a register turns a pin on, starts a timer or sends a byte.
  • Interrupts: hardware stops your code to run a handler, then returns. Keep handlers short; share data with care.
  • Clocks and power: the clock tree sets the speed of everything; sleep modes and wake sources decide battery life.
  • Peripherals: GPIO, timers and PWM, ADC and DAC, UART, SPI, I2C, USB, DMA.
  • Toolchain and debug: cross-compiler, linker script, startup code, a flasher and a SWD or JTAG probe.

Vocabulary

  • HAL: hardware abstraction layer, the vendor's or your own wrapper over registers.
  • Bare metal: code that runs with no operating system under it.
  • Watchdog: a timer that resets the chip unless the program keeps feeding it.
  • Datasheet and reference manual: the first says what the chip is; the second, how every register behaves.

What to study, in order

  1. C with pointers, bitwise operators and volatile; what a linker script places where.
  2. Blink an LED from registers alone, then with the vendor HAL; compare the two.
  3. Timers, interrupts and a UART console; then SPI and I2C against a real sensor.
  4. DMA, low-power modes and a watchdog; measure current, not just time.
  5. A logic analyser and a debugger on every bug, before adding prints.

Related tags

#firmware #rtos #embedded-linux #bootloaders

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder