Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:45 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PWM channels 1 and 2

Author Message
RyanHammond
Newbie

Joined: 29/03/2018
Location: United States
Posts: 15
Posted: 12:12am 26 Jun 2018
Copy link to clipboard 
Print this post

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: Australia
Posts: 446
Posted: 12:48am 26 Jun 2018
Copy link to clipboard 
Print this post

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]

Edited by Azure 2018-06-27
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 12:30pm 26 Jun 2018
Copy link to clipboard 
Print this post

  RyanHammond said   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?

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
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025