On January 27th, this site will be read-only as we migrate to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,609 Users
  • 2,269,767 Discussions
  • 7,916,794 Comments

Discussions

FRDM-K64 PWM1

2816169
2816169 Member Posts: 4
edited Dec 26, 2014 7:04AM in Java ME Embedded

Is there any difference in configuration between PWM1 (301, PTA0) and PWM2(302, PTC4)?
I have PWM2 working, but cannot get PWM1 function with identical settings.
Does it have anything to do with controllerNumber?
https://docs.oracle.com/javame/8.1/get-started-freescale-k64/dio-devices.htm
For PWM2 it is the same as for GPIOC (2), but for PWM1: ControllerNumber = 1 and ControllerNumber = 0 for  PTA0.

Answers

  • 1069234
    1069234 Member Posts: 2

    Hi,

    the difference between the PWMs is their GPIO output pins.

    controllerNumber == 1 means it generates on PTA0

    controllerNumber == 2 means it generates on PTB4

    PWM's controllerNumber is not related to a GPIO pin port number.

  • 2816169
    2816169 Member Posts: 4

    Thanks.
    Do you have PWM1 working (on PTA0)?
    The following code generates 1KHz, 50% duty perfectly on PTC4 (PWM2), but when I change deviceID to 301 (PWM1) I do not see any pulses on PTA0?
    pwmCh2 = DeviceManager.open(302);

    pwmCh2.setPulsePeriod(1000)
    pwmCh2.startGeneration(500);

  • 1069234
    1069234 Member Posts: 2
    edited Dec 26, 2014 7:04AM

    Hi,

    have checked your example on k64. 2 cycles - the difference is only the ID 301 in the first cycle, 302 in the second.

    have the oscilloscope connected to k64.

    pulses height in case of PWM2 id 302 pin PTC4 is 3v.

                        in case if PWM1 id 301 pin PTA0 is 0.9v

    other pulse parameters looks the same.

    thanks for the finding.

This discussion has been closed.