Actually, If i knew the frequency of sound command 255, which is a white noise, it would be easy for me to edit it.
Paco here http://usuaris.tinet.cat/fmco/dccfunc_en.html has made it with Tushuuu and assembly.
He uses TMR2 as PWM generator for sound, Vref module for volume control, TMR1 for Envelope timing, TMR0 for software noise generator, internal comparator for mixing sound and noise.
RB0 is DCC input, RB3 (PWM) conected to RA1 (comparator), RA2 outputs to a buffer OPAMP, RA4 to OPAMP output throught a resistor and to another OPAMP buffer for output to a buzzer.
The size of the circuit is the reason that i need software edit of the sound. The circuit must be very small.
Bookmarks