CompuServe Messages

#Audio.device

    13-Sep-89 22:28:41
Sb: #65474-#Audio.device
Fm: Richard Rae/SYSOP 76703,4253
To: Sylvain Duford 76056,1655
Easy as pie, Sylvain. If you have, or can get your hands on, a copy of Amazing Computing V3N3, you'll find a simple C program in my column which does just that. If you need verbatim code, let me know. Basically, the only thing you need to do is flip the state of the LED bit in the ciaa. In C systems, all the equates one needs are in the cia.h include file. The way I did it was to grab the state of ciaa.ciaddra (the DDR status), OR ciaa.ciaddra with CIAF_LED bit (which makes the LED pin an output; it should already be one, but just in case…), XOR ciaa.ciapra with CIAF_LED (which flips the state of the LED pin), then restore the saved ciaa.ciaddra value. I expect you should be able to find these or similar equates in your compiler's files. Remember, though, that switching out the reconstruction filter like this opens you up to problems with aliasing, which could be particularly nasty in a sweep generator. Be sure to have as many sample points as possible per waveform cycle; this will move the aliased frequencies farther away from the point of interest. Rick