On this resource you can find drivers supporting the AVR/ATmega-Series by ATMEL (now Microchip) for a lots of peripheral devices. All code is written for the ATmega32 but can easily be converted for similar MCU models. There are display drivers for various DOT-matrix and graphical displays. Also oscillators (DDS and CLK) will be covered and sensors soon are to be added. So, stay tuned! 🙂
Driver code is written in Embedded C for AVR microcontrollers (using GNU AVR C Compiler suite). No “Arduino”, sorry!
Oscillators (DDS & Clock)
(The code also contains function for clock multiplying)
Sensors, Controls etc.
The demonstration code hands over the alphanumeric data for air pressure and ambient temperature to a data connection using UART. A terminal program (like gtkterm for Linux oder HyperTerm for Windows) must be connected via a level shifter (MAX232 or equivalent) to pin PD0 of the Atmega32 MCU.
- 8 databits
- No parity
- 1 stopbit
Detecting the direction of a rotating encoder.
There are 3 version of the code. Version 2 is more simple than Version 1 concerning INT-routine. If it does not work from scratch, try to change the encoder pins A and B since there is only 1 interrupt triggering pin. If it is the “wrong” one only one direction will be detected!
V3 in addition uses Timer1 as counter for Milliseconds and resets LEDs 1s after the last took place.
The MCP4725 DAC is used as a simple sine wave generator to demonstrate an easy to understand application.
This example writes numerical data into the EEPROM and reads it subsequently. If both values are the same a green LED flashes, if there is an error, a red LED is lit.
The green LED goes from VDD via a 100Ω resistor to PD0, the red LED to PD1 the same way.
As the MCP4725 the LTC1257 converts digital signals to analog values. The LTC1257 in contrast to the device mentioned before uses an SPI interface (3 wires). The demonstration code converts the output of a sine wave function into a voltage.