|
Forum Index : Microcontroller and PC projects : PWM channels 1 and 2
| Author | Message | ||||
| RyanHammond Newbie Joined: 29/03/2018 Location: United StatesPosts: 15 |
Not entirely clear on the PWM channels. Channel 1 has A, B, and C and channel 2 has A and B. If I want to use Channel 2B output only, does this mean that the pin channel 2A is on can't be used as a regular I/O pin? If I only need one PWM pin, is it wise to use only Channel 1A or 2A if I want to use the other PWM pins for other functions? |
||||
| Azure Guru Joined: 09/11/2017 Location: AustraliaPosts: 446 |
If you do not want to use all outputs on a particular channel then specific only the one(s) you want to use in the PWM command, starting form PWM xA. You need to use output A if you only want to use one PWM output. The other pins are available for other purposes as long as you don't specify any of the other outputs in the POWM command. So to set PWM 1A to 1KHz and 50% duty cycle and not use output 1B or 1C, you would code it as: [code]PWM 1,1000, 50[/code] |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
For only one PWM pin you must use outputs 1A or 2A (ie, you cannot specify the B or C outputs without also specifying the previous outputs). Geoff Graham - http://geoffg.net |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |