To generate a frequency of 1kHz with duty cycle of 50%, just three lines of Java code are necessary:
Iow56 dev56 = devs.getIow56Device();
PWM pwm = new PWM(PWM.PWM_CLOCK_2MHZ,1999,1000);
dev56.addSpecialModeFunctionImpl(pwm);
With toString() method of class PWM, you can see the actual parameters of the generated output:
System.out.println(pwm); provides "PWM:clock[2],period[1999],pulse[1000],frequency[1.0 kHz],duty[50.0 %]"
PS: Since this year, commercial support for IOWJ is available.
IOWJ (advertising) supports new SpecialModeFunction PWM of IO-Warrior 56
Moderator: Guido Körber