Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 1.6 KB

README.md

File metadata and controls

44 lines (27 loc) · 1.6 KB

AVR Bare Metal

Here I'll let some experiments with bare metal in AVR microcontrollers.

In this repository, all the examples and stuff will be exclusively to ATmega328P (which is a microcontroller from AVR family) and Arduino Uno.

The code here are focused to re-create the functions provided by the Arduino Library, such as pinMode, digitalWrite, digitalRead, delay, etc. The firmwares in firmwares dir use those functions.

Functions so far

  • set_pin_mode(): sets the pin mode (INPUT or OUTPUT).
  • digital_write(): writes LOW or HIGH in the given pin.
  • digital_read(): reads LOW or HIGH from the given pin.

Try it yourself

Compiling the standard lib and the examples (firmwares):

make

After that, you can upload the examples inside the build/firmwares/ dir:

./upload [SERIALPORT] build/firmwares/*.bin

SERIALPORT is platform dependent, but in my case is something like /dev/ttyUSB0.

Any .bin in build/firmwares can be uploaded, but check and modify the code in firmwares if necessary.

Remember: only works on ATmega328P with Arduino Uno.

Examples

TODO

  • Serial Ports Support (Analog)
  • Bultin Timers Functions (delay, sleep, etc)