https://github.com/llefranc/42_piscine_electronique
Optionnal project: microcontroller programming on ATMega328P, with I/O registers, PWM cycle, interrupts, EEPROM access and UART/I2C/SPI serial communication.
https://github.com/llefranc/42_piscine_electronique
atmega328p eeprom i2c interrupts microcontroller pwm spi timers uart
Last synced: 2 months ago
JSON representation
Optionnal project: microcontroller programming on ATMega328P, with I/O registers, PWM cycle, interrupts, EEPROM access and UART/I2C/SPI serial communication.
- Host: GitHub
- URL: https://github.com/llefranc/42_piscine_electronique
- Owner: llefranc
- Created: 2023-03-13T10:56:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-31T13:53:02.000Z (about 3 years ago)
- Last Synced: 2025-03-06T10:54:20.167Z (over 1 year ago)
- Topics: atmega328p, eeprom, i2c, interrupts, microcontroller, pwm, spi, timers, uart
- Language: C
- Homepage:
- Size: 8.22 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Piscine électronique (@42Paris)
⬇️ Below is the video of the result after two weeks of work ([code here][3]) ⬇️
[](https://youtu.be/Q54Xc41ZGNc)
## About
This was an optionnal project that I did which introduced me to the world of microcontroller programming in C.
42Chips, the electronic association from 42 school designed a dev kit with several components:
- An ATMega328P microcontroller
- Several push buttons
- Several red LEDs
- A temperature and humidity sensor reachable through I2C bus
- A real time clock reachable through I2C bus
- A 16 bits I/O expander reachable through I2C bus
- A segments display
- RGB LEDs reachable through SPI bus
- An UART to USB port
- 3 analog sensors: a potentiometer, a light detector and a NTC
> Full schema of the devkit available [here][2]
## The exercises
The goal of the project was to get familiar and interact will all these different components.
We were allowed to **only use C language and no external library**. Each exercise has to be completed by interacting with the ATMega328P registers, using the chip's [documentation][1] as source.
A new pool of exercises for a new thematic was unlocked each day of the week during two weeks.
- ➡️ D00: I/O registers.
- ➡️ D01: Timers and PWM cycles.
- ➡️ D02: Interrupts.
- ➡️ D03: UART protocol.
- ➡️ D04: I2C protocol.
- ➡️ D05: EEPROM.
- ➡️ D06: RGB LED.
- ➡️ D07: Analog-to-Digital Converter (ADC).
- ➡️ D08: SPI protocol.
- ➡️ D09: Expander and segments display.
There was also each weekend a rush project.
- ➡️ R00: Game using I2C protocol *(unfortunately I didn't have enough time to do this one)*.
- ➡️ R01: A program interacting with all the devkit's components.
[1]: file:///mnt/nfs/homes/llefranc/Downloads/ATMEGA48A.PDF
[2]: https://github.com/llefranc/42_piscine_electronique/blob/main/devkit_schema.pdf
[3]: https://github.com/llefranc/42_piscine_electronique/tree/main/R01