Seems to me , I'm lacking some concepts here. From what I know is that PWMs pins are essential for driving the motors (as they can drive the motors at different speed with diferent duty cycle). So actually I wanted to drive 4 motors with a single Arduino uno but couldn't as it has only 6 PWMs, but with ATMega 16 looks like they don't have a condition on the PWM. Why is so ? or I am lacking some concepts here ?
2 Answers
Firstly, when driving the motor you need one PWM signal for speed and either one or two signals for the direction ( if you don't want braking you can use an external logic inverter and save one control output ). So a chip with 6 hardware PWM and 12 digital outputs (6 with inverters) can control speed and direction on 6 individual motors.
Secondly, it is fairly easy to create PWM signals in software at the frequencies required for small dc motors, so if you want further PWM outputs you can do so. A 328 based arduino has 20 pins which can be used as digital outputs, so could control ten motors with a couple of hex logic inverters.
If you're using a 2 L239D to drive 4 motors you'll have for each motors 3 pins used max per motors. 2 are the input pins which will tell the L239D what's the direction for each motors (cfr the following link, end of the page, there's a complete table about that). They are 5V logic pins, just need to be high or low. These are pins 2/7 and 10/15.
The PWM you're talking about must be in that case the enable. They're used to drive the speed of the dc motors attached to the l239d. 1 input pin per motor. If you don't have PWM you can use classical analog outputs. And if your 4 motors need the same speed you can use one output to control the 4 dc motors, just check the current drawn by te L293D in regards of the max current for a ATMega16 or PIC16 output. These are pins 1 and 9.
ATMega 16 looks like they don't have a condition on the PWM
I'm not sure what you are referring to but a mega16 has actually only 4 PWM channels while a mega168 (like used normally in Arduino) has 6 PWM channels. A device with lower PWM channels can't have an advantage related to PWM usage. \$\endgroup\$