Hi All
I need advise as I am inexperienced with FC ,I need to use the Capture Compare module of the PIC18 which is part of the PWM (CCP1 module).
It seems that FC only has a PWM component .
Now my question is which is the correct way to handle this in FC
(1) do I just make and Macro with C code and include it into my Flow diagram
(2) do I create a new component that Initialize the CCP module,setup the pins and do the capture read.
No 2 seems to me to be the correct solution in FC however the information I found in the learning center is very vague on this topic ,is there somewhere a tutorial that starts from scratch till a fully created component
any help or ideas are appreciated.
@Matrix is there any possibility that you could include the Capture modules in FC.The CCP modules are important for capturing pulses and pulse trains
Regards
Peter
Input Capture- Component
Moderator: Benj
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Input Capture- Component
- Attachments
-
- 1.png
- (75.41 KiB) Downloaded 1592 times
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: Input Capture- Component
Hi Peter,
There is not one correct way. I would start by creating a flowchart with the required code to get it working. If at that point you want to reuse the code multiple times you can use the working code to create a component. (BTW, macros can be exported for reuse as well)
A component is basically a flowchart with a macros for the required functionality (initialize, sample, etc) and a set of properties to configure the static parameters (those that will not require changing by the program like the input pin [if applicable])
The disadvantage of starting out with a component is that you have to update the component, export it, open your test program (or reload it if open in a second window), compile, upload, run and check if it works, if not reopen the component to fix the code and start over. Using a single flowchart is less overhead. So I would start with your option 1.
Best regards,
Jac
There is not one correct way. I would start by creating a flowchart with the required code to get it working. If at that point you want to reuse the code multiple times you can use the working code to create a component. (BTW, macros can be exported for reuse as well)
A component is basically a flowchart with a macros for the required functionality (initialize, sample, etc) and a set of properties to configure the static parameters (those that will not require changing by the program like the input pin [if applicable])
The disadvantage of starting out with a component is that you have to update the component, export it, open your test program (or reload it if open in a second window), compile, upload, run and check if it works, if not reopen the component to fix the code and start over. Using a single flowchart is less overhead. So I would start with your option 1.
Best regards,
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: Input Capture- Component
Hi jac
Thank you very much for your view and information.OK I will go for the option 1 for the moment and then maybe also try to export the macro for reuse
Regards
Peter
Thank you very much for your view and information.OK I will go for the option 1 for the moment and then maybe also try to export the macro for reuse
Regards
Peter
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR