Function generator component?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times
Contact:

Function generator component?

Post by echase »

Any plans for a function generator component?

I am trying to simulate a PIC that is comparing two analogue inputs measuring the amplitude and phase of a square wave against a sine wave of same frequency. It is very difficult to simulate this by moving the sliders on 2 analogue inputs unless done at really slow clock speed. Can you think of a better/faster way to do it? All I can think of is to write some Flowcode that generates the waves but then it is difficult to vary its amplitude and phase on the fly unless I use the analogue inputs to inject variability. But all this code has to be removed again before transferring it to the PIC.

A function generator component that output two or more waveforms of set frequency (linked to the simulation frequency), phase and amplitude would be good. Sine, square and other waveforms are useful. Frequency, etc. needs to be alterable on the fly during simulation.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Function generator component?

Post by JonnyW »

Hi there. In Flowcode v5 we are hoping to rework the components to simplify mods and get a tighter working between simulation and execution. For the user to be able to programatically tweak the inputs during simulation is a nice idea, I think.

Until then (and even then) I would recommend trying to abstract your comparison code from the HW components you are using. It may then be easier for you to 'hook in' with some debug function that simulates these inputs, and this can be controlled on the fly with some debug component (e.g. add a keypad and change your debug on button presses). When you are happy with your results you can then remove the debug macro and component and test on the HW.

Im not sure if thats clear, sorry if its not,

Jonny

echase
Posts: 429
Joined: Mon Jun 11, 2007 11:55 am
Has thanked: 49 times
Contact:

Re: Function generator component?

Post by echase »

Sorry debug subjects are beyond me. For the square wave I am simulating it with a switch component to drive the transitions, but it’s difficult to get the timing right when manually pressing it during simulation.

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: Function generator component?

Post by JonnyW »

OK, sorry I couldn't be more help. It sounds like you are doing pretty much the only thing you can do at present so I'm afraid you might have to make do with that at present. It would be nice to be able to provide a formula based on time and Flowcode variables that would simulate output during simulation and I think this would be what you would need but we cant promise anything at this point.

Post Reply