at the moment i am using arduino to drive a 300W brushless motors driver. The control is done by 3 pins: one for direction(HIGH/LOW), one for motor enable(HIGH/LOW) and one for speed control(300Hz to 3kHz). So controlling one motor is no problem at all, i jsut use delay function whit on off on pin(i banged code together in hurry) to get out the frequncy. But now the problems is becouse i want to drive 3 BLDC motor drives, so i need to be able to output 3 different frequencys. Entire arduino(atmega328) is here only to do this, all of my main code runs on atmega2560.
I was thinking of just using micros count to switch HIGH or LOW whit different speeds on different pins, and generate frequency that way for each individual motor driver. I think this should work, since the frequency arent really that high(for 3kHz signal, one pulse lasts 333micros, so 167 for HIGH and 166 for LOW). Or are there any dedicated ICs that should do the trick here?
i need to generate 3 diferent frequency(not a fixed values, but variable, from 300 to 3kHz) each on one output, at same time on one arduino uno, depending on what are the data the arduino receives via i2c from my main processor.
Is this possible to do on an arduino uno (atmega328)?
But, you are limited to one tone (frequency) per timer. On the Arduino Uno there are three timers. One is used by the core (essentially not available to you) so you can play up to two tones at once.
Edit:
it is possible to make lots of tones with one timer, but it does require some programming skills. You need a fast timer. Then you need some data structure to manage the state of the several channels (one channel = one tone). You'll have to figure out the rest for yourself...