PDA

View Full Version : question about how to implement ASM and ENDASM



karenhornby
- 5th March 2008, 09:34
Hi
I want to include a sound output on the 16F877 which I THINK I've figured it out ok, and can THINK my code willget it to play simple sounds

However I've found Roman Black's BTc Sound Encoder 2.0 Software which converts sound (in wave files) to a 1-bit format that can be played back on microprocessor chip

The sound is output on 2 pins of the PIC as follows:

; Digital ----------2R-----,
; |
; Digital ----------2R-----*----- Analogue
; | out
; |
; |
; C = 0.22 uF
; |
; |
; |
; Gnd

The generated file is in ASM format, which I understand I can include by using the ASM command, but how do you define what ports the sound is to be played out of?

I've included the sound sample I wish to try here (its a clip from star trek) (its renamed to .txt as .asm files arent allowed for some reason)

Any ideas how to proceed with this?


The problem being as i see it, I've got a generated wave table but no playback algorithm??

How can I use this and have the sound played on say for example PORTD.0 and PORTD.1 of a 16F877?

Kamikaze47
- 9th March 2008, 09:21
There is no playback code in that ASM file. It contains only the bits required to reproduce that sound. You need to write code that will output those bits to you chosen i/o pins at the correct bitrate.

The bitrate (as specified by the ASM file) is 11025 bits/sec, so you need to write your code to do the same.