PDA

View Full Version : Pwm



puneetverma24
04-17-2012, 09:57 PM
1)any digital pins can produce pwm , then why we have some special pins for pwm in some microcontrollers.

2)In case of arduino ,we use anolog pins to read anolog values ,is there any way to use these pin to give anolog output.

pratik_1
04-18-2012, 09:19 AM
1 - dedicated PWM pins are more to do with dedicated hardware logic unit inside the uC. Most uCs have a PWm hardware engine that takes care of all the timing signals and IO actions. Otherwise this would have to be done in code by using some sort of Timer Interrupt routine if you want to use a non-PWM digital pins

2. ADCs are fairly common on all uCs but DACs are a diff ball game. They are a bit more complicated and also frankly less used, so the designers usually leave them out of the uCs. There are several DAC chips available if you are looking for one. However there are ways to get analog output from a uCs digital out. Use a PWM + Filter circuit to get the desired analog voltage out.

vinodstanur
04-19-2012, 12:04 AM
Any digital pin can produce PWM
Any digital pins could be used for SPI
Any external interrupt pins could be used as Rx
Any digital pin could be used as Tx

BUT

all these are software implementations. Your valuable processor time is shared for these software stuff..
To solve this issue and to make it more efficient, most mcu have special hardwares for doing these jobs and this will work in background with minimum processor resource (processor time) just for updating the registers controlling these hardwares.....