![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced Member | i was working on producing a carrier wave using the PWM feature of the PIC16f877a... however i have few doubts on this.... i have used the PWM calculator provided by http://www.micro-examples.com for calculating the values to be loaded on to various registers.... i obtained the values and verified that they are correct using the formulas given in the datasheet... however i noticed the follwing written... ENSURE THAT THE PWM PIN IS CONFIGURED AS DIGITAL OUTPUT... what is the meaning of this statement? i will be taking the PWM output from pin number 17(CCP1)... do i have to include any specific statement in my code to do the above?? |
| | |
| | (permalink) |
| Experienced Member | You have to set the TRIS on that pin to 0 (zero) |
| | |
| | (permalink) |
| Experienced Member | many thanks... i will be using this carrier generated at CCP1 pin to modulate few data pulses i will be producing at pin number 21 (RD2) of the 16f877a.... in that case should i configure that pin (#21) as digital output also? when i am using CCP1 pin... what should be done with the CCP2 pin (#16)... |
| | |
| | (permalink) |
| Experienced Member | Unless you set CCP2 to run as a second PWM channel you can just treat it like any other I/O pin. |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Latest |
| PWM Period & CCPR1L Questions | Suraj143 | Micro Controllers | 9 | 26th March 2008 12:06 PM |
| PWM signal problem | iznalgnaij | Robotics Chat | 4 | 25th March 2008 12:40 PM |
| PWM algo | fusian | Micro Controllers | 1 | 18th March 2008 03:41 AM |
| PIC PWM outputs? | Andy1845c | Micro Controllers | 33 | 30th November 2007 03:06 AM |
| PWM using software AtoD | jeremygaughan | Micro Controllers | 11 | 27th November 2007 11:11 PM |