Post Reply 
Playing digitized sound files on the HP48G/GX
02-12-2018, 11:56 PM
Post: #10
RE: Playing digitized sound files on the HP48G/GX
(02-09-2018 11:41 PM)3298 Wrote:  You remember right, I downloaded it at some point and disassembled it. It seemed to be a pretty simple ARM assembly loop actually. I think it was something like: put a byte at some specific memory location, wait some time, repeat with the next byte. I may be off though, because that was before I started to mess with HPGCC3, which I did several years ago...
Not off at all. The ARM has one of the CPU timers (Timer 2 IIRC) that can be used to automatically flip the bit connected to the speaker. So once you set the clock frequency, all you had to do is to store the duty cycle in a register, the timer would reach that value, automatically flip the bit , and continue counting until the end, flip the bit again and then load the next value, all this automatically. The routine only had to store the next value whenever the timer had used it, and the value (at least in my code) was the duty cycle 0-255 taken from an 8-bit wave file (or synthesized wave). So it was very simple and with minimal CPU use.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Playing digitized sound files on the HP48G/GX - Claudio L. - 02-12-2018 11:56 PM



User(s) browsing this thread: 4 Guest(s)