This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[PWM] what ports to use?

Hi, I'm kinda new to this PWM programming (And microboard program). But I've figured out the next code should start a PWM-signal.

// timer 2 initialise
  T2CON = 0x11;
// reload value
  CRCL = 0x50;
  CRCH = 0xC9;
// compare value
  CCL1 = 0x18;
  CCH1 = 0xFC;
// P1.1 ???
  CCEN = 0x08;
Now, does this code send output to Port 1, Pin 1? Or do we software engineers call that pin 0?

And if so, how can I send output to pin 3? Or start a second PWM signal?

What I need to do:
Send 2 different PWM signals to 2 motors. Am I doing something good here? (Motors are attached to pin0, and pin2)

Plz help this newbie... :)

ps. I did search the forums, and more, couldn't find an easy-to-use example ...

Parents
  • hello,

    i dont know whether you're still working
    any way me i have a problem to generate a square pulse with 25khz using the PCA specifically the pwm of the (AT89C5115) de ATMEL, mais j'arrive pas ...?
    thankx in advance

Reply
  • hello,

    i dont know whether you're still working
    any way me i have a problem to generate a square pulse with 25khz using the PCA specifically the pwm of the (AT89C5115) de ATMEL, mais j'arrive pas ...?
    thankx in advance

Children
No data