>-----Original Message----- >From: Stefano Vanzo [mailto:microchip@VANZO.IT] >Sent: 28 January 2004 08:15 >To: PICLIST@MITVMA.MIT.EDU >Subject: [PIC:] Vref+, VDD and PWM on PIC16f818 > > >Hello everyone, > Thanks for reading. I am starting with PWM and have 2 >questions about this project: > 1 analog input with 4.096 Volt ref+ > 1 PWM > 3 digital pins for digital byte output of the analog value > >First question, if i use PWM with FFFF output will it give me >4.096 volts, 5 volts or will it be unknown Firstly, the CCP module has a maximum resolution of 10bits in PWM mode, so 0xFFFF is not a valid duty cycle setting. The actual resolution you get depends on the PWM period you choose (the data sheet shows the relationship between resolution and period). The PWM output has a voltage swing limited by the Vss and Vdd rails, so with 100% duty cycle, the output will be at Vdd (which may be 5 volts in your case). The Vref input is only for the A/D converter. >Second question >after I started PWM does it keep on going by it's own or do i >have to keep on givig it an input to "keep it alive" > You don't have to keep giving it an input, there is no overhead in operating the CCP module in PWM mode. You simply configure the module for PWM operation, set the duty cyclce and it will continue working until power is removed. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics