Bit-Bang PWM at high speed


i maintain library output of ir signals. use hardware pwm directly manipulating registers , setting output frequency. call pwm it's 33% on in instances. need able vary frequency between 36 khz , 57 khz. works fine if have pwm pin available , timer available. variety of arduino platforms grows it's bit difficult maintain. able output specific frequency using pin make code more hardware independent.

i need function such "send_frequency(freq,count)" cycle , output been @ specified frequency specified number of cycles.

my concern @ speeds i'm talking about, , ordinary c++ while or loops , delaymicroseconds might not fast enough. might have write in-line assembly code although might defeat goal of hardware independence.

my bottom line question is… know of existing library this? hate put lot of effort if has solved problem. google searches haven't turned work @ speed. thought check experts here see if else had tried or knew of existing code before go reinventing wheel.

i thinking blink without delay style - 36 khz 27.8us , 57 khz 17.5us, watching micros() pass won't cut it.


Arduino Forum > Using Arduino > Programming Questions > Bit-Bang PWM at high speed


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support