Giter Site home page Giter Site logo

arjunrajasekharan / dac-piano Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1013 KB

Created DAC Using R-2R Ladder Circuit To Implement Piano in TM4C. This project was done as the part of Embedded Systems course.

C 99.54% Batchfile 0.23% PowerShell 0.22%
r2r-dac tiva-c tm4c123gh6pm embedded-systems iar-workbench

dac-piano's Introduction

DAC-Piano

Created DAC Using R-2R Ladder Circuit To Implement Piano in TM4C. This project was done as the part of Embedded Systems course.

Components Used

  • TM4C123GH6PM

  • Buttons - 8

  • 10kΩ resistors - 8

  • 1kΩ resistors - 24

  • 500Ω resistor - 1

  • Potentiometer - 1

  • Speaker - 1

Pin Configurations:

TM4C Pin Circuit Connection
PE0 Button 1
PE1 Button 2
PE2 Button 3
PE3 Button 4
PF0 Button 5
PF1 Button 6
PF2 Button 7
PF3 Button 8
PB0 R-2R Bit 1
PB1 R-2R Bit 2
PB2 R-2R Bit 3
PB3 R-2R Bit 4
PB4 R-2R Bit 5
PB5 R-2R Bit 6
PB6 R-2R Bit 7
PB7 R-2R Bit 8

Circuit

Screenshot 2021-05-14 at 11 59 46

Screenshot 2021-05-14 at 12 00 08

Logic

  • Constructed R-2R Ladder Design for 8-bits in Tivac Board using resistors, wire connectors, and connected Multimeter and in the R-2R Ladder.

  • The 8-bit binary value is assigned to 8 ports of Port B

  • GPIO Ports (E and F) are initialized as digital pins and set to input mode.

  • Unlock PORT E and F and disable the analog function. We also clear the PCTL register for Ports E and F.

  • Configured the Tiva C board pin connections for resistors in the R-2R ladder (port B pins).

  • Each button corresponds with a different keynote and has a frequency index for each button.

  • By reading the corresponding PORTS (Port E and F) , the button pressed is found.

  • Pushbutton signals are sent to Tiva C pin connections ( VCC, GND, taking output signal from push buttons when pressed and feeding the input to Tiva C - 4 port E and 4 port F GPIO pins).

  • Binary input values (corresponding frequencies of piano notes) are sent from Tiva C to corresponding R-2R Ladder resistors in the circuit.

  • GPIO PE0-PE3 and PF0-PF3 ports are set from Tiva C to R-2R ladder DAC to Piezo to play the specific frequency.

  • GPIO Port B in range of PB0-PB7 Pin is read from R-2R Ladder to corresponding Tiva C Button Connected GPIO Port ranging from PE0-PE3 and PF0-PF3 Port.

  • Sine Waves are generated by setting frequency for 8 Basic notes in music to get through DAC R-2R Ladder.

Demo Link

https://drive.google.com/file/d/1T4WI3HeAmsE5nf2GBpMLfPKmT8kRCRYN/view?usp=sharing

dac-piano's People

Contributors

arjunrajasekharan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.