Page 2 of 2

Re: Building Components - Step by Step Guide

Posted: Wed Aug 30, 2017 5:15 pm
by kersing
Igor,

Multiple components accessing the same MCU pin is not a good idea at all. (In my opinion it is a disaster waiting to happen) I doubt very much that would be a supported use of components. Keep in mind component code might change to fix bugs or because of a Flowcode update and things may behave completely different. So my advice is not to go there.

Flowcode at the moment only sets the TRIS registers for the required operation (input or output), if you need pull up or anything like it you will need to use a C code block and add the required code yourself.
If you need open collector pins you first need to check the data sheet of the MCU to see if it is supported. If it is supported you will need to add C code to set the pin for this.

Best regards,

Jac

Re: Building Components - Step by Step Guide

Posted: Wed Aug 30, 2017 8:23 pm
by johnsondav
Hi Igor

I am curious as to how you are connecting your device to the MCU. Looking at the data sheet, it shows these connections - four:
TCA6408A2.jpg
TCA6408A2.jpg (54.51 KiB) Viewed 8478 times
. On the MCU side, there are four required connection for this device (TCA6408A).

Therefore, I would design my component to have just three connections:
- SDA
- SCL
- Reset

As shown above, the reset pin would be missing from the standard FC7 I2C component. This would need to be included in the design of the new component for the TCA6408A to allow power-up function to work correctly. This would leave only the interrupt connection to by added be the user of the component in their project. The standard FC7 I2C component does not have a reset connection available. Therefore, during the building of your component, a 'Digital I/O pin would be added to handle the reset function for the component. When the component is placed into a project, FC7 will allow the user to select an available pin to perform this 'Reset' function, following the functionality designed into the component.
TCA6408A1.jpg
TCA6408A1.jpg (96.72 KiB) Viewed 8478 times
The interrupt I would leave this off your component design and allow the user to connect the interrupt directly using one of the available interrupt pins on the MCU. The user of your component, when writing their code will place an interrupt icon to allow the MCU to begin dealing with the connected device (An interrupt handling routine), as shown here:
TCA6408A3.jpg
TCA6408A3.jpg (87.86 KiB) Viewed 8478 times
Designing a FC7 component for the above device in this way may not suit everyone, but will give you an opportunity to review its performance before getting bogged down in detail. Therefore, get communication to work first, then review.

If I understand the devices start-up function correctly, all port pins of the TCA6408A are set as 'Inputs', may be wrong on that, its how I have read it. Once power-up is complete, programing of the device can begin to set which are input and which are output. From this, the component will have an 'Initialisation' macro which allows the power up function to be performed in a timely manner, then the user can program the I/P's accordingly afterwards by calling further macro calls to the component you will have added during the design of the component.

Hope this helps.

Regards
Dave

Re: Building Components - Step by Step Guide

Posted: Thu Mar 11, 2021 10:19 am
by andeug
Hi Dave,


I am user of Flowcode 9 and I wonder if anyone has built an up-to-date guide for this version of software.
Also, within your guide they are some strange characters, as I have shown in the attached picture. Is it possible to generate again the .pdf or to share the .doc or .docx instead?


Thank you,
Andreas

Re: Building Components - Step by Step Guide

Posted: Sun Mar 14, 2021 5:48 pm
by johnsondav
Hi Andeug

Please find copy of document as requested.
Component Creation 1.pdf
(2.9 MiB) Downloaded 242 times
Best Regards
Dave

Re: Building Components - Step by Step Guide

Posted: Sun Mar 14, 2021 6:00 pm
by johnsondav
Hi Everyone.

Just to add some interest. The RS232 port could be an important component to master, as I am currently working on the RC2014 Z80. Well, not relevant to Flowcode you might say. What I have found is a very cheap way to make a graphics card for approximately £5 using a Raspberry Pi Zero and the firmware called PiGFX.

Here is a link to the firmware:

https://github.com/fbergama/pigfx

Scroll down and have a read. It is so simple to do it should be very easy to include with a PIC RS232 port. I have tested it with a USB keyboard and a modern computer monitor with an HDMI port and works like a dream. Just need to develop a flowcode component to go with it.

It works by getting a character from the keyboard and sends it out via its Tx on the serial port and waits for a reply on the Rx pin. That way you can get your pic to read a USB keyboard and output the graphics text using the power of the Pi Zero.

Dave

Re: Building Components - Step by Step Guide

Posted: Sun Mar 14, 2021 7:41 pm
by mnf
Looks an interesting project..

Good luck and keep us informed. I might have a go at making one if it works....

Martin

Re: Building Components - Step by Step Guide

Posted: Sun Mar 14, 2021 8:16 pm
by chipfryer27
Hi Dave

Thanks for posting the document again.

The original, and subsequent ones never opened properly for me due to fonts and what not. Couldn't open in Acrobat or Foxit or anything. Large chunks would be missing.

This opens perfectly and I can now see why it was praised so highly. A good job well done.

Thanks again for posting.

Regards