PWM on VM110N under android

Hello,

I created an app on Android to control the VM110N via USB on a mini-PC where is installed androidx86 and I can control output, read input… etc
My problem is that I can’t use the PWM output. There is no library speaking about them and no function in the libk8055 to use them (maybe counter but I didn’t understand how and can’t modify the frequency).

Is it possible to know how to make PWM signal or what byte(s) in the WriteData is/are used to generate an appropriate PWM ?

I read that is possible to have different frequency (3 different frequency) on these output PWM via the setPWM function in the Delphi k8055.dll or something like this. I would like do the same but with AndroidStudio.
Info: I create my library .java for Android based on the libk8055.c, I just need now to use PWM.

Thx

as far as I know the PWM is tied to the analog output

Yes, the analog outputs and PWM outputs are always activated /deactivated together.

Here you can find more info about the undocumented DLL function SetPWM().
viewtopic.php?f=3&t=10451
viewtopic.php?f=12&t=9005

Thanks for the topic, this is exactly what I searched.
But my card (PVM110N-1 exactly) is not working like that… The byte[1] is used to set the digital output channels, byte[2], byte[3] for the output analog. I can’t set the PWM even when the analog channel is set.
In same case, the value “23” to set PWM or other value in the K8055N DLL source are not working for me.

I use the k8055lib from this site : libk8055.sourceforge.net/

I just adapt it to Android and the byte[] used to control the card are really not the same as the byte[] describe on the topic “Using VM110N on a Mac (as opposed to a P8055)”…

With this lib, this is working on linux and on android for me, the lone problem is the PWM that I can’t control. I need the 2KHz signal and the best would be to be able to modify the duty cycle.

I’m gonna make some test but a send_buffer with a table of 9 byte, I can’t search all the combinations :smiley:

Using this function call you’ll get 50% duty cycle at 2.93kHz:
SetPWM(1,127,1);