Creating a component for HT711

Moderator: Benj

User avatar
CamargoF
Posts: 21
Joined: Thu Aug 02, 2018 8:16 pm
Location: Sao Paulo, SP - Brazil
Has thanked: 6 times
Been thanked: 5 times
Contact:

Creating a component for HT711

Postby CamargoF » Sun Aug 05, 2018 4:25 pm

I would like to transform my HT711 code on component for FC8 and I would like to request some help:
  • Is the best reference the wiki https://www.matrixtsl.com/wiki/index.php?title=Using_CAL_Components?
  • What is the CAL to be used since I am addressing the bit ports directly?
  • Is it possible to convert my current implementaion to component inside my current project or I must create an independent project for it?
  • How this port can be simulated?
  • How can be create something on console to allow the simulation? (Defining a value to be read)
  • How to test if the component is properly written for FC8?

Thank you for any help.

Best regards,

Fernando

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

Re: Creating a component for HT711

Postby Benj » Mon Aug 06, 2018 10:32 am

Hello,



The best reference is this section of the wiki.
https://www.matrixtsl.com/wiki/index.ph ... t_Creation

What is the CAL to be used since I am addressing the bit ports directly?


For I/O you simply need to make single digital pin type properties and then reference the properties using a calculation icon. No CAL is required for I/O.

https://www.matrixtsl.com/wiki/index.ph ... a_Property

I've put together this page for you which should also help.

https://www.matrixtsl.com/wiki/index.ph ... Properties

Is it possible to convert my current implementaion to component inside my current project or I must create an independent project for it?


Your current project should be fine, unless you want to clean up the code and keep the component source separate.

How can be create something on console to allow the simulation? (Defining a value to be read)


You can add data to the console by using the console simulation API. e.g. simulation icons.
https://www.matrixtsl.com/wiki/index.ph ... PI_Console

Here is a walk through guide.
https://www.matrixtsl.com/wiki/index.ph ... ta_Console

How to test if the component is properly written for FC8?


Main way is to test it well once exported. Try and include some corner case conditions such as compiling with different target devices.