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.
set_pin_mode()
: sets the pin mode (INPUT
orOUTPUT
).digital_write()
: writesLOW
orHIGH
in the given pin.digital_read()
: readsLOW
orHIGH
from the given pin.
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 infirmwares
if necessary.
Remember: only works on ATmega328P with Arduino Uno.
- Serial Ports Support (Analog)
- Bultin Timers Functions (delay, sleep, etc)