Welcome to the N1IR Electronics Website. Totally off the cuff, one take, unrehearsed video projects for anyone interested in amateur radio, electronic design, makers, hardware hackers and science.


Get off you duff and build something!
Training the hand and mind since 1982.

Friday, October 25, 2013

Replacement Project, Musical PIC PART 2

Well just finished the replacement  Musical PIC project, used a ATMEGA328, I know, I know, it's over kill but I've got over 600 of them in stock in the shop. I used the Arduino IDE and the TONE library.


One problem I ran into was the newest Arduino 1.0.5 did not work with the old TONE library, it got stuck on wiring.h in the TONE.CPP file, just change In \libraries\Tone\Tone.cpp change #include <wprogram.h> to #include <arduino.h> 


and bingo work again. I also used the rttl example program that came with the libary. This you can find any RTTL ring tone and use it, the example program come with about 20 or so songs, all you have to do is remove the comment // to the song you would like to burn on the IC.





Below is a schematic 






PCB Design Coming Soon !!!

If you refer to the schematic, there is no ICSP pins. You must use the Arduino platform first and program then remove the IC and place it in the newly programmed Arduino IC on to the PCB you just made.

Once this is done simply get a new ATMEGA328P-PU and burn a boot-loader using Adafruits USBtinyISP programmer. This eliminates the need to buy a new Arduino platform at $30, all you are doing is replacing the IC with the newly burned IC with boot-loader at around $1.00 each.

It's important to use the ATMEGA328P-PU version, the ATMEGA328-PU has a different chip Hex ID. You can still use the -PU IC but you have to change the embedded AVRdude Utility in the Arduino IDE and change the ID to fool the Arduino IDE to burning the boot-loader. 

What's the difference between the ATMEGA328P-PU version and the ATMEGA328-PU, not much the P-PU has a micro current sleep mode.

Notes:
I deleted the two 22pf caps hanging off the crystal to make the project cheaper and used a 200 ohm resistor to limit the current to the 8 ohm speaker. This eliminated the need for a driver transistor. 

Overall cost of the project

Speaker = Free from donation (we have over 400 new 2" SPK)
ATMEGA328 = $1.00 in bulk
Resistor = less that $0.01
Xtal = $0.50
PB SW = Free from donation (we have over 5000 in stock)

If you were to buy from digikey or jaycar it would probably be under $5 USD