protodomemusic / mmml

Micro Music Macro Language - An MML Implementation for 1-Bit Music on AVR Microcontrollers
GNU General Public License v3.0
96 stars 6 forks source link

flashing an atmega8 chip #2

Closed farvardin closed 4 years ago

farvardin commented 4 years ago

Hello, I've tried to flash one of the demo song on an atmega8(A) chip, but I can't get any sound...

The command line used to flash the hex was:

avrdude -p atmega8 -c USBasp -U flash:w:mmml.hex:i -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m

avrdude: verifying ... avrdude: 1 bytes of hfuse verified

avrdude: safemode: Fuses OK (E:FF, H:D9, L:E4)

avrdude done. Thank you.

I've adapted the fuse according to this website: https://www.engbedded.com/fusecalc/ (using 8mhz internal clock but there are many other options so I'm not sure), I've also connected the audio to PB0 and gnd...

do you have any clue?

protodomemusic commented 4 years ago

Hm, I don't have an atmega8 to test this, but looking at the datasheet it should work with no issues. Let's break this down logically:

If the program uploads successfully and you're still not hearing any sound, it might be a problem with the circuit. Let me know how you get on.

farvardin commented 4 years ago

The flashing was ok. I hadn't sent the full log.

I've tried again. The circuit was correct, but I was powering the atmega8 chip with some pins from an arduino, which was already on an other shield, and I suppose the circuit was then underpowered! It was my fault! In the future, I'll try to document better the whole process of using an atmega8.

farvardin commented 4 years ago

I've put a makefile for using an atmega8, and a few music samples (two of my own, one from your repo, "fly to the moon") there: https://github.com/farvardin/garvuino/tree/master/arduino_sketches/others/mmml (it's not really "arduino sketches", but it fits better there)

I've also made a little tutorial on there: https://github.com/farvardin/garvuino/blob/master/doc/garvuino_manual.md (in the MMML section)

And here is a recording (the sound is a bit low) of my music converted to MMML: https://www.youtube.com/watch?v=FPUAUxfS40E