Building Components - Step by Step Guide

A forum where Flowcode v7 user created components can be shared, discussed and reviewed.

Moderator: Benj

johnsondav
Posts: 130
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 69 times
Been thanked: 120 times
Contact:

Building Components - Step by Step Guide

Postby johnsondav » Wed Jul 19, 2017 3:54 pm

RF_ASK Module Component

I have build a component to control a pair of modules - Receiver & transmitter on the 433MHZ frequency. I have included a step-by-step guide to build the component to control these modules.
This is all about how to make your own components, not about the actual modules themselves, although fun to use.

The step by Step Guide:
Component Creation 1.pdf
(3.41 MiB) Downloaded 418 times


The Project that created it:
RF ASK 433MHz Ver2.fcfx
(24.11 KiB) Downloaded 89 times


The actual component:
RF_ASK.fcpx
(3.04 KiB) Downloaded 83 times


All comments on how to improve the guide would be welcome.

Regards
Dave
These users thanked the author johnsondav for the post (total 11):
EtsDriver (Wed Jul 19, 2017 4:07 pm) • QMESAR (Wed Jul 19, 2017 4:09 pm) • Benj (Wed Jul 19, 2017 4:22 pm) • Docara (Wed Jul 19, 2017 5:36 pm) • medelec35 (Wed Jul 19, 2017 6:19 pm) • Steve (Thu Jul 20, 2017 7:11 am) • LeighM (Thu Jul 20, 2017 9:01 am) • jgu1 (Thu Jul 20, 2017 4:06 pm) • Steve001 (Thu Jul 20, 2017 6:07 pm) • JohnCrow (Thu Jul 20, 2017 7:12 pm) and one more user
Rating: 64.71%
 

Docara
Posts: 188
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 12 times
Been thanked: 42 times
Contact:

Re: Building Components - Step by Step Guide

Postby Docara » Wed Jul 19, 2017 5:46 pm

Hello John,

Unbelievable!!

What an amazingly informative and processional looking tutorial, the quality and substance of what you have submitted is exceptional thank you so much

Matrix managers need to hang their collective heads in shame when they compare what they have done (or not) over to what you have produced. All we want is to use their amazing piece of software to its fullest and they don't give us the tools.

Right get your finger out and sort a book out for us LOL

A big collective hug from FC users
Matt
These users thanked the author Docara for the post:
johnsondav (Thu Jul 20, 2017 3:27 pm)
Rating: 5.88%
 

User avatar
Steve
Matrix Staff
Posts: 2916
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 49 times
Been thanked: 278 times
Contact:

Re: Building Components - Step by Step Guide

Postby Steve » Thu Jul 20, 2017 2:32 pm

Hi Dave,

Many thanks - that is truly an awesome document and it looks like a lot of hours have gone into it. I have asked my colleagues to look at it and see if there are any improvements we can make to the document and to the component creation process in general.

I will PM you shortly with something as a token of our appreciation...

Regards,
Steve.
These users thanked the author Steve for the post (total 3):
johnsondav (Thu Jul 20, 2017 3:27 pm) • EtsDriver (Thu Jul 20, 2017 6:24 pm) • QMESAR (Fri Jul 21, 2017 9:35 am)
Rating: 17.65%
 

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 673
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 214 times
Been thanked: 337 times
Contact:

Re: Building Components - Step by Step Guide

Postby QMESAR » Thu Jul 20, 2017 4:00 pm

Hi Dave.

Thank you very much for this document(Tutorial) that was a big job you did , I truly believe it will help many people more than you can imagine.(including me)

I salute you for this effort :D :D
These users thanked the author QMESAR for the post (total 2):
johnsondav (Thu Jul 20, 2017 5:16 pm) • EtsDriver (Fri Jul 21, 2017 4:40 pm)
Rating: 11.76%
 

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 900
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 386 times
Been thanked: 436 times
Contact:

Re: Building Components - Step by Step Guide

Postby Steve001 » Thu Jul 20, 2017 6:11 pm

Hi Dave

A fantastic document, i tried to make a component in V6 a long time ago unsuccessfully. This document will be a great help i will have another go when i get the time.

thank you

Steve
These users thanked the author Steve001 for the post (total 2):
johnsondav (Thu Jul 20, 2017 8:41 pm) • EtsDriver (Fri Jul 21, 2017 4:39 pm)
Rating: 11.76%
 
Success always occurs in private and failure in full view.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1354
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 374 times
Been thanked: 699 times
Contact:

Re: Building Components - Step by Step Guide

Postby JohnCrow » Thu Jul 20, 2017 7:17 pm

Hi Dave
That's a great document.

Like Steve I've tried component creation and not had much success either.

I have those RF components myself, and have used them by programming them "the hard way", now I'll try working through your tutorial and see what happens.

Thanks again.
These users thanked the author JohnCrow for the post (total 2):
johnsondav (Thu Jul 20, 2017 8:41 pm) • EtsDriver (Fri Jul 21, 2017 4:39 pm)
Rating: 11.76%
 
1 in 10 people understand binary, the other one doesn't !

User avatar
Steve
Matrix Staff
Posts: 2916
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 49 times
Been thanked: 278 times
Contact:

Re: Building Components - Step by Step Guide

Postby Steve » Fri Jul 21, 2017 2:31 pm

Hi all,

So you're aware, Dave's excellent document has prompted us to address this area and we're close to producing a tutorial which has a few additional short-cuts (that were added in v7.2) to make component creation even easier.

Leigh's been working on this and has produced the attached *draft* version so far. He's not in today, so early next week we'll look at finalising it and getting it published on the Wiki.

Once again, a big thanks to Dave for kickstarting this!

Regards,
Steve.
Attachments
Flowcode 7 Component Creation.pdf
(597.41 KiB) Downloaded 86 times
These users thanked the author Steve for the post (total 6):
medelec35 (Fri Jul 21, 2017 3:36 pm) • QMESAR (Fri Jul 21, 2017 4:01 pm) • EtsDriver (Fri Jul 21, 2017 4:39 pm) • johnsondav (Fri Jul 21, 2017 7:53 pm) • Steve001 (Fri Jul 21, 2017 7:58 pm) • petesmart (Sat Jul 22, 2017 12:19 pm)
Rating: 35.29%
 

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 673
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 214 times
Been thanked: 337 times
Contact:

Re: Building Components - Step by Step Guide

Postby QMESAR » Fri Jul 21, 2017 4:03 pm

Hi All
This is great stuff Dave did a nice job and Matrix putting the cherry on the cake ,a big thanks to Dave and Steve for this.
This was an area where I always felt I can not handle in FC now I will give it a try again :D :D :D

One request though it is fine adding it to the wiki but please make it available as a .pdf download if possible :)
These users thanked the author QMESAR for the post (total 2):
EtsDriver (Fri Jul 21, 2017 4:40 pm) • Steve001 (Fri Jul 21, 2017 7:58 pm)
Rating: 11.76%
 

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 900
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 386 times
Been thanked: 436 times
Contact:

Re: Building Components - Step by Step Guide

Postby Steve001 » Fri Jul 21, 2017 7:57 pm

Hi Peter

as a work around If you use chrome you can save as a pdf, by going going to the 3 dots in the top left then print (or you could ctrl + p) you get to option to save as a pdf

Steve


:edit just seen Steve's post - thank you as peter says the icing on the cake
These users thanked the author Steve001 for the post:
QMESAR (Sat Jul 22, 2017 5:16 am)
Rating: 5.88%
 
Success always occurs in private and failure in full view.

Docara
Posts: 188
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 12 times
Been thanked: 42 times
Contact:

Re: Building Components - Step by Step Guide

Postby Docara » Fri Jul 21, 2017 8:59 pm

I don't know how to say this without sounding contrite and sarcastic (it is not my intention) but Steve I genuinely would like to thank you on giving a gratuity (presumably) to Dave for the work he has done, I don't know of any company who HAS done something like - especially unprompted.

Matt

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 673
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 214 times
Been thanked: 337 times
Contact:

Re: Building Components - Step by Step Guide

Postby QMESAR » Sat Jul 22, 2017 5:17 am

Steve001 wrote:as a work around If you use chrome you can save as a pdf, by going going to the 3 dots in the top left then print (or you could ctrl + p) you get to option to save as a pdf

Hi Steve,
Thanks a million I will do this for sure :D

jgu1
Posts: 785
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 657 times
Been thanked: 159 times
Contact:

Re: Building Components - Step by Step Guide

Postby jgu1 » Sat Jul 22, 2017 7:32 am

Hi Dave!

Really a nice and big project you have done, Thank's.

I have some of these rx and tx module. The output from them are very 'noisy'. Look forward to test your component. I Will use them togethers with my displayprojects.

You wrote in main page:

"Do not store this component in your main FC7 component folder. I would recommend you save the component somewhere else and use the 'Global Options' under the 'View' menu to set where FC7 should look for your components as shown here".

Do you still recommend to do this, can it destroy other component or conflict with these?

Br
Jorgen

kersing
Valued Contributor
Valued Contributor
Posts: 1653
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 409 times
Been thanked: 894 times
Contact:

Re: Building Components - Step by Step Guide

Postby kersing » Sat Jul 22, 2017 11:06 am

jgu1 wrote:Do you still recommend to do this, can it destroy other component or conflict with these?


The reason to store components in a separate folder is to make sure they do not get lost when you upgrade flowcode. If you store anything in a folder where flowcode is installed it might be deleted during upgrade.
These users thanked the author kersing for the post:
jgu1 (Sat Jul 22, 2017 3:58 pm)
Rating: 5.88%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

johnsondav
Posts: 130
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 69 times
Been thanked: 120 times
Contact:

Re: Building Components - Step by Step Guide

Postby johnsondav » Sat Jul 22, 2017 11:51 am

Hi Jorgen

There are several reasons to keeping what components are developed in a separate folder, as well as those suggested by kersing. It is necessary to help identify what components are still under development as shown below:-

You have the option to declare the status of the new component before it is exported to the location of your choice as shown
Dev_icon_status.jpg
Dev_icon_status.jpg (111.76 KiB) Viewed 2489 times


Then, when you run FC7, you will notice that the component you have available in the list, what status is has by its icon used
Comp_Idtfy.jpg
Comp_Idtfy.jpg (71.23 KiB) Viewed 2489 times


Its just another very important feature that FC7 has available.

Not only that, but imagine if several users are helping to develop a devices functionality. Only when it is accepted as finished would you promote its status and maybe accepted as finished would you add it to any permanent library.

Regards
Dave
These users thanked the author johnsondav for the post:
jgu1 (Sat Jul 22, 2017 3:54 pm)
Rating: 5.88%
 

jgu1
Posts: 785
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 657 times
Been thanked: 159 times
Contact:

Re: Building Components - Step by Step Guide

Postby jgu1 » Sat Jul 22, 2017 3:55 pm

Hi Dave and Kersing!

Thank's for the explanation. I do as you recommend.

Br Jorgen :D

User avatar
LeighM
Matrix Staff
Posts: 1052
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 260 times
Been thanked: 391 times
Contact:

Re: Building Components - Step by Step Guide

Postby LeighM » Mon Jul 24, 2017 1:22 pm

Here is an updated/expanded version of the component creation getting started guide...

Flowcode 7 Component Creation.pdf
(679.83 KiB) Downloaded 256 times

I've tried to keep it to the minimum basics.
So all of the previously mentioned tricks, tips and additions of this thread also apply.
These users thanked the author LeighM for the post (total 3):
medelec35 (Mon Jul 24, 2017 1:57 pm) • petesmart (Mon Jul 24, 2017 3:19 pm) • johnsondav (Wed Jul 26, 2017 3:19 pm)
Rating: 17.65%
 

johnsondav
Posts: 130
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 69 times
Been thanked: 120 times
Contact:

Re: Building Components - Step by Step Guide

Postby johnsondav » Wed Jul 26, 2017 3:38 pm

Hi LeighM

I have read your tutorial, with great interest and I found it very enlightening. I am hoping to gain further insight as to how best go about creating my own FC7 components. Some of the techniques you have used do not always seem to work for me on my system, but still I will persevere. I think its a work-flow/procedural thing.

I have spent the last few days experimenting with the creation of a gLCD display, but with limited success followed by failure. I have posted the problems/successes I have had with my other post.

I only wish there were more tutorials to help myself and others master the dark art and mysteries of FC7 component creation. :wink:
However, as before, if I could get the gLCD component to work, another tutorial maybe!

Best Regards
Dave
These users thanked the author johnsondav for the post:
Benj (Wed Jul 26, 2017 5:00 pm)
Rating: 5.88%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 7077
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 1896 times
Been thanked: 2732 times
Contact:

Re: Building Components - Step by Step Guide

Postby medelec35 » Wed Jul 26, 2017 11:49 pm

Hi Dave, and Leigh,
Thank you both for your very informative and interesting tutorials on component creation.
That has inspired me to follow Leigh's Tutorial (Dave's is great, but I already have a LM75B)
After using the newly created LM75B I can confirm there is enough information for a working component to be created.
Results from temperature sensor:
Current room Temperature.png
Current room Temperature.png (13.19 KiB) Viewed 2348 times

Note: Resolution = 0.5C
Both Flowcharts used to Create component and test component are very much work in progress.
If anyone has a LM75A/B and want to create component and get it working on hardware, I'm happy to post flowcharts.


Martin
These users thanked the author medelec35 for the post (total 3):
LeighM (Thu Jul 27, 2017 8:48 am) • Benj (Thu Jul 27, 2017 3:19 pm) • johnsondav (Thu Jul 27, 2017 4:20 pm)
Rating: 17.65%
 
If your hardware is not working as expected, try looking here first:
http://www.matrixmultimedia.com/mmforum ... =26&t=6936

streammaster
Posts: 46
Joined: Mon Jul 31, 2017 11:14 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: Building Components - Step by Step Guide

Postby streammaster » Sun Aug 27, 2017 10:52 am

Hi All,

Firstly I have to say that documents posted in this post are of great help thank everyone who contributed here. I'm relatively new FC user and I'm surprised of lack of comprehensive documentation for the product. I really enjoy using the product but discovering and using (new to me) features is a real struggle because of lack of documentations. Product support based on user forum is a bit not professional and perhaps OK if the product is free, but if you pay thousands of dollars there should be a better way. On line support (when you click on help) provides basic information which is usually already available on the FC screen just rewritten and put on a WEB page. Often there is nothing that may help to explain 'what', 'how' and 'way'. I guess I become in last few months an advanced user and really I'm looking for an advanced user manual and information, but there is no such thing.
Now when I got this off my chest, I can ask the question:
I'm working on TCA6408A component (I2C GPIO expander).
TCA6408A.PNG
TCA6408A.PNG (28.43 KiB) Viewed 1242 times

Hopefully, I will get it all going and I will be happy to share all with you.
Apart from the standard I2C interface (which I can use the CAL-I2C component), I need to introduce two additional pins 'Reset' and 'Interrupt' and wrap some logic to emulate actual chip logic and also enable successful simulation.
Component property.PNG
Component property.PNG (6.01 KiB) Viewed 1242 times

To fully define pins I need information about how to define the hardware property of the pin so the system can generate a define for my pin properties. One pin needs to be an Input and second Output. For SDA and SCL this is done by CAL but I can't find any source of information how to do it 'manually'.
Property.PNG
Property.PNG (10.01 KiB) Viewed 1242 times

Could somebody provide details (and list of all applicable parameters and syntaxes) in order to configure 'Generate a define for the property'?

Thenks,
Igor

johnsondav
Posts: 130
Joined: Thu Jun 28, 2012 7:29 pm
Location: Durham
Has thanked: 69 times
Been thanked: 120 times
Contact:

Re: Building Components - Step by Step Guide

Postby johnsondav » Sun Aug 27, 2017 3:35 pm

Hi Igor

Great looking component you are working on. I am no expert, but if I understand correctly from the illustration you have for the Property Variable you are using, what you are attempting to do is control two pins for controlling the functionality of the component. This is achieved within the code of the component.
Property Variable - will allow you to reference the property in the code following the same syntax rules as a variable name
Visible - is it visible to the user when the component is exported or greyed out
Writable - if the user can write to the property or is it fixed
Generate a define for the property - determines if FC7 will generate a define in the downloadable code

So, if you wish to control either pin within a particular Macro, the variable could be used to either input/output data using the same methods as you would in any FC7 project. An example of output control is shown on page 8 of the LCD tutorial. Not sure if that is much help for you.

Regards
Dave

streammaster
Posts: 46
Joined: Mon Jul 31, 2017 11:14 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: Building Components - Step by Step Guide

Postby streammaster » Mon Aug 28, 2017 2:48 am

Hi Dave,

I agree with you and this is exactly what I will do. The pins value (as variables) can be directly accessed in 'code' making the FC flowcharts.
Why I so much like FC is that takes away all abstraction from designing a microprocessor codes (and it is one of main FC features). We can be focused on designing actual algorithm instead taking care how to talk to our connected hardware. In all other methods designing the software for MCU we deal with 'components' on the very abstract level, as a bunch of header files and hopefully also some pre-designed functions. Instead, in FC we select the MCU chip (a target) and then everything is done in the background. The components provide definitions how the pins will be configured on the target, is it analogue or digital only input or bidirectional and so on. Some MCUs also have the ability to route the pins to internal hardware functionality. This is also created via FC component interface. But none of this is by a miracle.
There is a target MCU configuration file which contains all information about the MCU capability, so once we select it our component will 'offer' different sets of configuration, including pins. You can see for I2C pins on some MCU, if you select a 'CHANNEL", it will offer in some case software only, in another case only Channel1 but on larger MCU we will see also Channel2. Depending on MCU model we will be able to select pins connections, and sometimes this will be predefined and locked out for editing. To have this working we need to define our pins property (for pins which are not already linked to any other (sub) components).
So I do not think that I can just ignore the missing configuration since I'm not sure how the pin is configured. The simulation would work (as it will use the variable only), but when I try to compile the code for the target this will be missing. I could use some component as sub component like a switch and then use the pin assignment as for my component, but in the creation of my component I need to do much more than just a switch or LED.
Even when we select simple LED components, and attached to the pin on MCU this will provide configuration for the MCU config register for the particular pin. If you look into any MCU datasheet you will see that the most of the pages are describing the configuration registers. This is what must be configured in order that the physical chip works. When we do pure simulation we can ignore this fact (not that is then a real simulation) but functionality will work, since we build components which suppose to be available across various MCU (targets). From the surface when we select the pin which we use, we do not only create the physical link by doing this, the FC in the background creates all required for this link to work when it comes to the MCU configuration. This was always the hardest part. Microchip IDE introduced just recently a CCP which provide a graphic interface very similar how we do define pins on our components. The only difference is that FC does this with much more intuition and on right side, not on MCU but on the component in the exact way how we will do our PCB schematic. This to me is the logical way and why I so much appreciate the 'FC way' of doing things.

Maybe my point of view is incorrect and I missing something, but in another hand, the configuration field in pin property confirm my suspicion.
The setting is there I just don't know what to enter into it.

I hope somebody knows.

Regards,

Igor

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

Re: Building Components - Step by Step Guide

Postby Benj » Tue Aug 29, 2017 5:34 pm

Hello Igor,

Hopefully I can help a bit here.

For simple components using simple digital inputs/outputs or analogue inputs you can simply create a property of the right type (single analogue/digital pin) and then reference this in a calculation icon.

For more advanced components such as UART/SPI/I2C/PWM etc you would start with the CAL component from the Tools component menu and simply expose the channel/pin/remap properties shown there. This then brings through all the software/channel1/channel2 functionality and also the pin manipulations such as disabling user editing for hardware channels when remap is not available. It also brings through all the behind the scnenes functions to for example send and receive bytes on the bus. This allows the CAL component to do all the work and allow you to get on with making a new component.

This wiki page gives an overview of the property exposing as well as some tricks to make sure you expose all the relevent properties. e.g. the hidden remap properties.
https://www.matrixtsl.com/wikiv7/index. ... t_Features

streammaster
Posts: 46
Joined: Mon Jul 31, 2017 11:14 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: Building Components - Step by Step Guide

Postby streammaster » Wed Aug 30, 2017 5:34 am

Hi Ben,
Benj wrote:For simple components using simple digital inputs/outputs or analogue inputs you can simply create a property of the right type (single analogue/digital pin) and then reference this in a calculation icon.

Could you please explain me a mechanism which will configure MCU chip when is compiled for real physical MCU?
I still do not understand how this configuration miracle is working? If I choose a 'single digital pin' how the system knows if this is input or output or open collector IO? If I need dynamically to changed pin direction by component code what I do? Bottom line is that I may need to be able to change this property during code execution; such as one wire interface like component DHT11. Is it possible that you can provide a 'source' for the FC project for the creation of the DH11. This will likely provide some information. I know that the DH11 is working in real hardware world because I have it running here on my table.

Could you please dig out the specifications for the 'Generate a define for the property' field? There are a Name expression field and Value expression field.
Could you please send me a document which defines this expression? An expression like this '$(type)_$(module)_$(variable:u) may be what I'm expecting that will define the hardware configuration of the MCU pins for actual chip programming. Like 'type' may be 'Input', 'Output' or 'HiZ'?
Or perhaps this may define the variable so the configuration can be changed dynamically?

I would really appreciate if you can put some light on this feature?

Regards,
Igor

kersing
Valued Contributor
Valued Contributor
Posts: 1653
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 409 times
Been thanked: 894 times
Contact:

Re: Building Components - Step by Step Guide

Postby kersing » Wed Aug 30, 2017 7:15 am

Igor,

The defines do not do anything to configure a pin. It literally generates a text string definition (in the #define C sense of the word) of the property. I've created several components over the past years and rarely need to use the define.

If you want to use a pin for I/O you can set it to a digital/analogue pin as Ben mentioned. Then if you want to use it you just need to use a calculation icon where you enter

Code: Select all

varA = pinName

to read the state of the pin. At that point Flowcode will generate the code to set the pin to input, read the pin and (re)set it to the state it had before the input. Like wise for output

Code: Select all

pinName = varA

generates code to set the pin to output, and set the level. At that point the pin will stay an output pin. (Until you use it for an input operation).

Best regards,

Jac
These users thanked the author kersing for the post:
Benj (Wed Aug 30, 2017 10:52 am)
Rating: 5.88%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

streammaster
Posts: 46
Joined: Mon Jul 31, 2017 11:14 am
Has thanked: 4 times
Been thanked: 5 times
Contact:

Re: Building Components - Step by Step Guide

Postby streammaster » Wed Aug 30, 2017 8:56 am

Hi Jac,

thank you for the quick reply.
I will try. I will have my hardware board at the end of this week ready and see if I can get my peripheral component working correctly.
I just wondering how this works when we have multiple components sharing the same MCU pin, some may be inputs some outputs (at the same time) how microprocessor can determine? Perhaps the pin port direction is locked to last MCU use? So if this is the case then the PIN property is actually a CAL component which has hidden code loaded to the MCU, which dynamically configures MCU pin TRIS? I still do not know how we control pool-up resistor ports? I guess this answer can be provided only by Matrix guys. Here is a topic example https://learn.mikroe.com/ebooks/picmicrocontrollersprogramminginassembly/chapter/io-ports/ the TRIS registers configuration is where I'm not sure how the FC is handling.

Do you by any chance know how I can define in FC for the bus type of the pin (one which is sinking only, needs the pool up resistor never is the source)? Do I need to use the port in such way so I write to port only if I have '0' and if I have '1' i just do nothing?

Regards,
Igor