Close

Man! Some roadblocks, and it works.

A project log for Case study: A polyphonic PIC18F music box

Does this work? An online article discusses about building this music box.

nyh-workshopNYH-workshop 12/01/2017 at 15:210 Comments

Since I have a day off, I tried to test the circuit further to see what works and what doesn't.

Here's the video:

And the github page: https://github.com/uncle-yong/pic16f1579-music-box-pbver

What works:

What doesn't work:

What is difficult:

The schematic (1/2):




                                           +5V
                                           ^
                                           |
                                           +---------------------------------+
                   PIC16F1579              |       74HC125                   |
                  +------------------+     |      +-----------------+        |
                  |                  |     |      |                 |        |
                  |                  |     |      |                 |        |
                  |                  |     |      |                 |        |
  Gate1  +--------+ RB5          RB7 +------------+ 1/OE            |        |
                  |                  |     |      |                 |        |
                  |                  |     +------+ 1A              |        |
                  |                  |     |      |                 |        |
                  |                  |     | +----+ 1Y              |        |
                  |                  |     | |    |                 |        |
  Gate2  +--------+ RB4          RC7 +------------+ 2/OE       3/OE +-----+  |
                  |                  |     | |    |                 |     |  |
                  |                  |     +------+ 2A           3A +--------+
                  |                  |       |    |                 |     |
                  |                  |       | +--+ 2Y           3Y +--+  |
                  |                  |       | |  |                 |  |  |
  Gate3  +--------+ RC2          RB7 +----+  | |  |                 |  |  |
                  |                  |    |  | |  |                 |  |  |
                  |                  |    |  | |  |                 |  |  |
                  +------------------+    |  | |  +-----------------+  |  |
                                          |  | |                       |  |
                                          +-------------------------------+
                                             | |                       |
                                             | +----+SqWave CH2        |
                                             |                         |
                                             +------+SqWave CH1        +-----+SqWave CH3

Schematic (2/2):

             EACH CHANNEL:
                                              100K

         SqWave CHx +----------------+--------/\/\/\/\------------>Output_x
                                     |
                                     \
                                     /
                                     \ 10K
                                     /
                                     \
                         220         /
                                     |
            Gate_x  +----/\/\/\/\----+
                                     |
                                   + |
                                    ---  10uF
                                    ---
                                     |
                                    +++
                                    ///



           
MIXING THREE CHANNELS TO LM386 MODULE:

                                                                            //
SqWave CH1  +---------------+            +-----------------+               //
                            |  100nF     |                 |           +--+/+
                            |            |                 +-----------+  | |
SqWave CH2  +---------------+-----||---->+ LM386 module    |           |  | |
                            |            |                 +-----------+  | |
                            |            |                 |           +--+\+
SqWave CH3  +---------------+            +-----------------+               \\
                                                                            \\

                                                                        4 OR 8 OHM SPEAKER

 ASCII Art From ASCIIFlow Infinity.

Note: Basic connections like +5V and GND on the microcontrollers and the other chip is not shown here. You need to connect these or else it won't work!

Finally this works. After what many troubles I had in 2009. Accomplished? It is very far from it.

What would it be if there's none of the microcontroller which supports the independent PWM? You gotta need to have a separate square wave generators (use an RC with the CD40106) and a digital potentiometer, and then this tri-state buffer. More components, and more hassles! So here, might as well use that PIC16F1579 instead (or the PIC16F1578)!

There are many rooms for improvisation too. That's one fun little project I've been doing so far! :) 

The midi source - I lost the webpage's address! I'll put this in when I found it! 

Discussions