Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pinguino IDE v12
20-01-2017, 09:35 AM,
#11
RE: Pinguino IDE v12
(20-01-2017, 02:15 AM)derf158 Wrote:
(19-01-2017, 07:31 PM)Aldeen19 Wrote: I tried some code of the "Tone" function mentioned by Fred in the conversation referred by Oliver which is as follows:

Code:
void setup()
{
tone(11, 8500, 1000);
}

void loop()
{

tone(11, 3000, 100);
delay(100);
tone(11,4000, 100);
delay(100);
tone(11,5000, 100);
delay(100);
tone(11, 6000, 100);
delay(100);
tone(11,7000, 100);
delay(100);
tone(11,8000, 100);
delay(100);
tone(11,9000, 100);
delay(100);
tone(11,10000, 100);
delay(100);
}
And it was successful but the frequencies produced does not go below 3000 Hz.
I need to go below this limit so what I have to do? Please help.
Did your sketch above work?
Yes derf158, all these above frequencies are heard from my Pinguino 4550 (20MHz) clocked but not lower 3KHz.
I need to get 50, 100, 500 and 1KHz. It seems that it is impossible unless I lower the clock freq down to 1MHz.
Aldeen19
Reply
20-01-2017, 10:50 AM,
#12
RE: Pinguino IDE v12
(20-01-2017, 09:35 AM)Aldeen19 Wrote:
(20-01-2017, 02:15 AM)derf158 Wrote: Did your sketch above work?
Yes derf158, all these above frequencies are heard from my Pinguino 4550 (20MHz) clocked but not lower 3KHz.
I need to get 50, 100, 500 and 1KHz. It seems that it is impossible unless I lower the clock freq down to 1MHz.

Or you have to use the rewritten audio library. I do not know if your version of the IDE contains these files.
You can download them here:

https://raw.githubusercontent.com/Pingui...es/audio.c
https://raw.githubusercontent.com/Pingui...es/audio.h

You have to replace the old ones in your installation. Maybe it works. The files are part of the IDE since version 11.20150217

Here you can find an example .pde of the new audio library:
https://raw.githubusercontent.com/Pingui...o/tone.pde

Oliver
Reply
20-01-2017, 09:40 PM,
#13
Photo  RE: Pinguino IDE v12
(20-01-2017, 10:50 AM)pinguPlus Wrote:
(20-01-2017, 09:35 AM)Aldeen19 Wrote:
(20-01-2017, 02:15 AM)derf158 Wrote: Did your sketch above work?
Yes derf158, all these above frequencies are heard from my Pinguino 4550 (20MHz) clocked but not lower 3KHz.
I need to get 50, 100, 500 and 1KHz. It seems that it is impossible unless I lower the clock freq down to 1MHz.

Or you have to use the rewritten audio library. I do not know if your version of the IDE contains these files.
You can download them here:

https://raw.githubusercontent.com/Pingui...es/audio.c
https://raw.githubusercontent.com/Pingui...es/audio.h

You have to replace the old ones in your installation. Maybe it works. The files are part of the IDE since version 11.20150217

Here you can find an example .pde of the new audio library:
https://raw.githubusercontent.com/Pingui...o/tone.pde

Oliver
Thank you Oliver. I have installed IDE v12 and did exactly what you have suggested by replacing the old libraries of audio.c and audio.h with the ones mentioned above and then tried to compile the audio tone example but I got an error message!
Please see attached photo of my screen.


Attached Files Thumbnail(s)
   
Aldeen19
Reply
20-01-2017, 10:55 PM,
#14
RE: Pinguino IDE v12
I think that there are two ways to overcome the audio tone frequency range that makes it practically possible to have a freq range between 20Hz to more than 10KHz. First one is by using an external freq prescaler (divide by 10) so when the MCU is generating 10KHz tone the output freq will be down to 1KHz.

The second way is by using and internal divide by 100 or by 10 programmatically so when the MCU generates 10KHz
tone we can set a code for divider by 10 or 100 to be able to get lower freq tone signal at one of the digital pins.
I am wondering whether this could be possibly done by code.
What do you think guys?
Aldeen19
Reply
21-01-2017, 02:21 AM,
#15
RE: Pinguino IDE v12
(20-01-2017, 10:55 PM)Aldeen19 Wrote: I think that there are two ways to overcome the audio tone frequency range that makes it practically possible to have a freq range between 20Hz to more than 10KHz.  First one is by using an external freq prescaler (divide by 10) so when the MCU is generating 10KHz tone the output freq will be down to 1KHz.

The second way is by using and internal divide by 100 or by 10 programmatically so when the MCU generates 10KHz
tone we can set a code for divider by 10 or 100 to be able to get lower freq tone signal at one of the digital pins.
I am wondering whether this could be possibly done by code.
What do you think guys?

try these files i just tried them under windows and the compiled fine with no error in SDCC or XC8

FRED


Attached Files
.c   audio.c (Size: 13.26 KB / Downloads: 3)
.h   audio.h (Size: 5.35 KB / Downloads: 4)
Reply
21-01-2017, 09:22 AM,
#16
RE: Pinguino IDE v12
(21-01-2017, 02:21 AM)derf158 Wrote:
(20-01-2017, 10:55 PM)Aldeen19 Wrote: I think that there are two ways to overcome the audio tone frequency range that makes it practically possible to have a freq range between 20Hz to more than 10KHz.  First one is by using an external freq prescaler (divide by 10) so when the MCU is generating 10KHz tone the output freq will be down to 1KHz.

The second way is by using and internal divide by 100 or by 10 programmatically so when the MCU generates 10KHz
tone we can set a code for divider by 10 or 100 to be able to get lower freq tone signal at one of the digital pins.
I am wondering whether this could be possibly done by code.
What do you think guys?

try these files i just tried them under windows and the compiled fine with no error in SDCC or XC8

FRED
The difficulty I got now is that IDE v12 is not compiling successfully and stops with error message even with the simple blink example ! I tried to re-install it but no use, have no idea what is wrong?
Aldeen19
Reply
21-01-2017, 01:39 PM,
#17
RE: Pinguino IDE v12
(21-01-2017, 09:22 AM)Aldeen19 Wrote: The difficulty I got now is that IDE v12 is not compiling successfully and stops with error message even with the simple blink example ! I tried to re-install it but no use, have no idea what is wrong?

OK, let's find out what happens here.
1) copy the content of the details window of the bug report to the clipboard and post it here.
2) Check your installation: Are the compilers present? (See my screenshot  for details)

Oliver


Attached Files Thumbnail(s)
   
Reply
21-01-2017, 04:39 PM, (This post was last modified: 21-01-2017, 07:52 PM by Aldeen19.)
#18
RE: Pinguino IDE v12
[attachment=836]
(21-01-2017, 01:39 PM)pinguPlus Wrote:
(21-01-2017, 09:22 AM)Aldeen19 Wrote: The difficulty I got now is that IDE v12 is not compiling successfully and stops with error message even with the simple blink example ! I tried to re-install it but no use, have no idea what is wrong?

OK, let's find out what happens here.
1) copy the content of the details window of the bug report to the clipboard and post it here.
2) Check your installation: Are the compilers present? (See my screenshot  for details)

Oliver

Oliver, thanks for your kind cooperation.
Please see the attached two screenshots:


Attached Files Thumbnail(s)
       
Aldeen19
Reply
22-01-2017, 03:38 PM,
#19
RE: Pinguino IDE v12
(21-01-2017, 04:39 PM)Aldeen19 Wrote:
(21-01-2017, 01:39 PM)pinguPlus Wrote:
(21-01-2017, 09:22 AM)Aldeen19 Wrote: The difficulty I got now is that IDE v12 is not compiling successfully and stops with error message even with the simple blink example ! I tried to re-install it but no use, have no idea what is wrong?

OK, let's find out what happens here.
1) copy the content of the details window of the bug report to the clipboard and post it here.
2) Check your installation: Are the compilers present? (See my screenshot  for details)

Oliver

Oliver, thanks for your kind cooperation.
Please see the attached two screenshots:

aldeen,
 are you using windows 7 or 10
fred
Reply
22-01-2017, 06:40 PM, (This post was last modified: 22-01-2017, 07:03 PM by Aldeen19.)
#20
RE: Pinguino IDE v12
(22-01-2017, 03:38 PM)derf158 Wrote:
(21-01-2017, 04:39 PM)Aldeen19 Wrote:
(21-01-2017, 01:39 PM)pinguPlus Wrote:
(21-01-2017, 09:22 AM)Aldeen19 Wrote: The difficulty I got now is that IDE v12 is not compiling successfully and stops with error message even with the simple blink example ! I tried to re-install it but no use, have no idea what is wrong?

OK, let's find out what happens here.
1) copy the content of the details window of the bug report to the clipboard and post it here.
2) Check your installation: Are the compilers present? (See my screenshot  for details)

Oliver

Oliver, thanks for your kind cooperation.
Please see the attached two screenshots:

aldeen,
 are you using windows 7 or 10
fred
I am still using WinXP SP3.  In fact I have IDE rev.999, v11 and v12 all installed on my laptop.  
I think the operating system has nothing to do with it.
Aldeen19
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)