usb mbed brief loud audio

07 Jun 2011

At the moment I am getting just above 1.00 volts or so and 2000ohms output but I get brief loud audio, is it the capacitor that will choose what the mbed will output. what is the max output for the mbed when powered by usb.

we have documentation for the lpc1768, but this does not seem to apply for the mbed. The lpc1768 has a max input of 3.6v the mbed has max input of 14V where is the support for this

07 Jun 2011

There are 2 3.3 Volt regulators on the MBED, So the maximum Output voltage will be set at slightly less than 3.3 Volts.

the Maximum input of 14Volts (9 volts is probably recommended) relates to the I/P of the voltage regulator. bear in mind that fro 14 Volts down to 3.3 volts, more than 10 Volts, are converted to HEAT, not the best thing for electronics.

If you do just want a simple sounder, then a Pizo element (like in your digital watch) is probably your best bet, as these can be driven from a PWM Output. although you are limited to what sounds it cam make.

if you need something with more range, and volume, use a small coil speaker (found in many MacDonald toys) but you will need an amplifier stage, Maplin should have an 8 pin dill 'Headphone' amp, which has a lot of O/P for size & battery usage.

Enjoy

Ceri

07 Jun 2011

ceri clatworthy wrote:

There are 2 3.3 Volt regulators on the MBED, So the maximum Output voltage will be set at slightly less than 3.3 Volts.

the Maximum input of 14Volts (9 volts is probably recommended) relates to the I/P of the voltage regulator. bear in mind that fro 14 Volts down to 3.3 volts, more than 10 Volts, are converted to HEAT, not the best thing for electronics.

If you do just want a simple sounder, then a Pizo element (like in your digital watch) is probably your best bet, as these can be driven from a PWM Output. although you are limited to what sounds it cam make.

if you need something with more range, and volume, use a small coil speaker (found in many MacDonald toys) but you will need an amplifier stage, Maplin should have an 8 pin dill 'Headphone' amp, which has a lot of O/P for size & battery usage.

Enjoy

Ceri

Ok the thing is I want to use usb for power for now, I have a crystal pizo earphone, but I am getting brief lound audio where the pizo is being driven to its max, which I think is 8ohms I am not sure if it is 8ohms tho, it is the ones they sell at maplins. So I don't feel a need at this stage to buy the headphone amp so the thing I am trying to understand and figure out is why I am getting only brief loud audio when I should be getting loud audio all the time, it happens when I first connect the usb cable, so I thought perharps it could be because of the capacitors, but what I posted above is what I am getting on analog out, unless the mbed first outputs it max audio out and then normalize the audio and it just depends how loud your micrphone input is to how high the earphone output will be, so I would like to know how to set it to drive the pizoearphone the output to its max. Or am I having some kinda voltage and current problem here because I am only getting about 1 volts on the analog out and 2000ohms, should I not be getting 3 volts?

How does pin 18 compare to the PWMOUT as in when you say limited to what sounds it can make.

09 Jun 2011

ceri clatworthy wrote:

Pizo element (like in your digital watch) is probably your best bet, as these can be driven from a PWM Output. although you are limited to what sounds it cam make.

How do I get the mbed to output by pwm ceri, such as with the programs I have posted, gpio? modma?

09 Jun 2011

assign one of the PWM pins 21-26, or the LED's

as PWM: PwmOut led3 (p26); PwmOut led4 (LED4);

simply send a floating point number 0.0 to 1.0, which gives 0 - 100%

you can also adjust Mark/Space ratio, and frequency,

set PWM_Period_MS to 1ms for 1 Khz (very close to middle C on piano)

Enjoy Ceri

09 Jun 2011

ceri clatworthy wrote:

assign one of the PWM pins 21-26, or the LED's

as PWM: PwmOut led3 (p26); PwmOut led4 (LED4);

simply send a floating point number 0.0 to 1.0, which gives 0 - 100%

you can also adjust Mark/Space ratio, and frequency,

set PWM_Period_MS to 1ms for 1 Khz (very close to middle C on piano)

Enjoy Ceri

You lost me Ceri how am I supposed to put that in this code, If I wanna write the adc values to pwm?

#include "mbed.h"
 
/* ADC for the microphone/input, DAC for the speaker/output */
AnalogIn mic(p19);
AnalogOut speaker(p18);
 
#define NUM_SAMPLES   15000
unsigned short buffer[NUM_SAMPLES];
 
int main()
{
    int i;
    for (i = 0; ; ) // infinite loop
    {
        /* read mike */
        buffer[i] = mic.read_u16();
        /* Write to speaker */
        speaker.write_u16(buffer[i]);
        /* Increment index and wrap around */
        i = (i+1) % NUM_SAMPLES;
    }
}