Joined: 28 Aug 2011 Posts: 5 Location: Vail Arizona USA
The first 12 notes of the top octive musical scale?
Posted: Thu Nov 07, 2013 12:13 am
Dear programmers.
How can I code the PIC18F67J10 trainer PCB to generate the first 12 monochromatic top octave square wave notes on the music scale? On the free connector output port pins. How would I write a simple CCS C code snippet to setup a 16 Bit timer in this IC and when it reaches for example divide by 508 it will interrupt the chip? Then it must change the state of the pin on one of the free connector output port pins.
From your examples I should add onto it the code to generate the 11 more tone outputs.
I know that the old National IC that did this task is discontinued and is now obsolete.
Thank you.
Mark A Carter _________________ Mark A Carter
KD7PHW
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Thu Nov 07, 2013 12:24 am
This CCS example doesn't use your proposed method but you can start
by looking at it:
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
Posted: Fri Nov 08, 2013 4:14 am
Are you wanting to generate all twelve tones at the same time, or just one at once?
If you examine the data sheet for the TOS chips, you will see there were two versions with different divisor ratios.
One version was accurate to 3 cents, the other to 1 cent.
(One cent being 1semitone/100 i.e. ~1 part in 2000)
The 3 cents version gave some musical fifths which were just intoned. The upper tone frequency was exactly 3/2 the lower one. They did not sound right.
The hardware PWM output from many smaller PICs will do 50% duty ratio and 10 bit resolution. That should do the job for you, if you only want one tone at a time.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum