PWM Simulation

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

PWM Simulation

Post by Bachman »

Hello!

PWM -> Properties -> Simulation -> Displayed Periods

Doesn't matter if it's 1, 2 or 3, the result always 1.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PWM Simulation

Post by Benj »

Hello,

Thanks for letting us know. I have removed the property for now.

Please let me know if you think multiple periods is a good feature. If you think it is worth having then I will bring it back and make sure it functions correctly.

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

Re: PWM Simulation

Post by Bachman »

Hello!

I think, one period is enough.

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

Re: PWM Simulation

Post by Bachman »

Hello!

I've dowloaded the new files from here: Flowcode 6 - latest components, bug fixes and improvements (Last update: 03/12/15). With the new files, the PWM component "Diplayed Periods" option gone, but two other bugs come out. With 100 % duty cycle, the blue line does't show. The biggest problem is, the PWM output on the HW always low, the pwm is not working (or always 0 % duty cycle). Test program is attached. I've compiled the program with the new files and with the old ones. As you can see, the checksum of the two result is different.

After found this, i've completly restored the "Flowcode 6" folder from a backup.
With-old-files.jpg
With-old-files.jpg (24.88 KiB) Viewed 6394 times
With-new-files.jpg
With-new-files.jpg (23.15 KiB) Viewed 6394 times
Attachments
PWM_test.fcfx
(3.69 KiB) Downloaded 287 times

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

Re: PWM Simulation

Post by Bachman »

The previous post born because of the original PWM component contain a big bug and i tried to solve it with the newest component. Setting the duty cycle to 255, does not set in the HW to 100 %, while in the simulation looks good. Used the test program from the previous post (1 sec 100 %, 1 sec 0 % Duty Cycle).

Tested on:
12F615
16F628A
18F1320
18F14K22
18F26K22

Tested with oscilloscope and a Logic Analayser, same results:
Logic.jpg
Logic.jpg (178.04 KiB) Viewed 6385 times
Logic_zoomed.jpg
Logic_zoomed.jpg (172.72 KiB) Viewed 6385 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PWM Simulation

Post by Benj »

Hello,

Out of interest if you drop the "Period Overflow" property from 255 to 254 does this solve the problem?

We simply set the chip registers and leave it to get on with it so could be a limitation of the hardware?

Post Reply