10 years, 4 months ago.  This question has been closed. Reason: N/A

PWM OUTPUT to AnalogIn (HELP PLEASE)

I have made this code to generate approximately 1kHz frequency and a very low voltage. How can I send this frequency to AnalogIn Pin19.

Im using LPC1768 model.

/media/uploads/RavneetSingh/analog.png

Thanks

Ravneet

Anyone please help me. I really need this to be done but I cant figure it out. :(

posted by Ravneet S 11 Feb 2014

1 Answer

10 years, 4 months ago.

period_ms in PWM is an integer. Not a float.

micAudioOut.period_us(10);

This will set the pwm to 100 kHz.
Use a simple wire to connect p19 to p22.

Lerche

Hi Chris Thanks for that, but I think I have made mistake while asking question. How can I read the same frequency on pin 19. ?

posted by Ravneet S 11 Feb 2014

Chris, how can I combine this code(my first post) with InterruptIn code. ? This code is generating 1kHz and if I use interruptIn function then I can read the same frequency on Analog pin.

posted by Ravneet S 12 Feb 2014