What happens if I run this code say at 4mhz 16F870 ? there will be no output, frequency wont match, or sound will be breaking up?
What happens if I run this code say at 4mhz 16F870 ? there will be no output, frequency wont match, or sound will be breaking up?
on 16F876A, gives error during compile on this:
IPR1.1 = 1 ' TMR2 high priority
Gives same error on 12F1840.
Hi,
> What happens if I run this code say at 4mhz 16F870 ? there will be no output, frequency wont match, or sound will be breaking up?
There's not enough time to actually execute the interrupt service routine before the timer fires another interrupt. The CPU will spend all of its time in the ISR, no time left for you to set the desired frequencies etc and the output frequenices will be wrong and...... Simply - It just won't work. You need 16MHz.
> on 16F876A, gives error during compile on this:
> IPR1.1 = 1 ' TMR2 high priority
The 16F series doesn't have interrupt priorities, remove the line.
> Gives same error on 12F1840.
The 12F series doesn't have interrupt priorities, remove the line.
/Henrik.
Still does not compile on 16F876A -
ASM ERROR:
Symbol not previously defined (wsave), (ssave), (psave).
Compile OK on 12F1840, but ASM warning - Found label after column 1. (Generate), Extraneous arguments on the line
added this for 16F876A:
Have no idea why, but no more errors in compile, will try runtime shortly.Code:wsave VAR BYTE $20 SYSTEM ssave VAR BYTE $22 SYSTEM psave var byte $24 SYSTEM
It works, sort of (20mhz crystal 16F876A).
If any channel duration has same value, these channels won't play.
Also, playback duration is different each time, it might play 4 or 5 times same duration, then 2 times shorter duration, then again normal.
It works properly only when value of output timings is first is the shortest, 2nd medium and 3rd - longest. If in reverse, it will only play last, short one.
Hi,
> Still does not compile on 16F876A -
> ASM ERROR:
> Symbol not previously defined (wsave), (ssave), (psave).
Do you have DT-Ints in the program? I thought I said:> Compile OK on 12F1840, but ASM warning - Found label after column 1. (Generate), Extraneous arguments on the lineYou can not cut'n'paste this into a program using DT-Ints. Try it stand-alone first and we'll see about DT-ints later - if needed.
That's a warning, have you edited the source in any way? I don't get that here.....
> If any channel duration has same value, these channels won't play.
> Also, playback duration is different each time, it might play 4 or 5 times same duration, then 2 times shorter duration, then again normal.
> It works properly only when value of output timings is first is the shortest, 2nd medium and 3rd - longest. If in reverse, it will only play last, short one.
Are you running the program, by itself, on the 16F877 at 20MHz or are you, despite my warning, trying to run it together with the rest of your program AND DT-INTS?
/Henrik.
Bookmarks