Hi folks, I am really struggling to get a project to do something I want.
Basically, I have an OLED display, BME module to measure humidity, but I also want to output a 108kHz PWM signal.
Here is the problem - there is a direct conflict because the Wire code uses timer1, and I need this to generate the PWM signal!
I am thinking the only way round this is to find a processor with two 16 bit timers?
I tried softwire but not convinced SSD1306 is compatible,,,
I can show the code if necessary but unless someone has a clever idea without interrupting PWM output I suspect this might be a hardware limitation as opposed to software...
There are different Nano's so which one do you have exactly
Not much experience with the Nano, but I assume it has more than one timer so if you move the PWM to another PWM pin might solve this.
Google gave me
which states
Arduino Nano has 3 Timers and 6 PWM output pins. The relation between timers and PWM outputs is:
Pins 5 and 6: controlled by timer0
Pins 9 and 10: controlled by timer1
Pins 11 and 3: controlled by timer2
So there is an option to switch timer, don't know if the other timers can do the 108 kHz
hI rob, thanks for gettng back to me. It uses the Atmel 328 if that is any help.
Trouble with using the other timers for my PWM is I cannot get the high frequency I need.
I need to literately turn off the prescaler for timer1 to get the high frequency, as far as I can tell I cannot do this with timers 0 or 2.
If I am wrong please correct me.
I am thinking of using a PIC micro on the output of the Atmel. Basically Atmel turns on a 12f1840 which I can then use to generate the PWM, but I'd prefer to do this with a single IC, and I cannot program pics in C as yet, only in assembly LOL