Hello Mikat
Glad its all working correctly now.
Modifying the component code to allow you to define your own ports and pins in Flowcode is fairly simple.
Near the top of the Custom_Code.C file you will find the following section.
Code: Select all
//Common defines
#define MX_DATA_PORT portd //%a
#define MX_DATA_TRIS trisd //%b
#define MX_CONTROL_PORT portc //%c
#define MX_CONTROL_TRIS trisc //%d
#define MX_CS1 0 //%e
#define MX_CS2 1 //%f
#define MX_DAT_INST 2 //%g
#define MX_ENABLE 3 //%h
#define MX_READ_WRITE 4 //%i
Simply replace with this.
Code: Select all
//Common defines
#define MX_DATA_PORT %a
#define MX_DATA_TRIS %b
#define MX_CONTROL_PORT %c
#define MX_CONTROL_TRIS %d
#define MX_CS1 %e
#define MX_CS2 %f
#define MX_DAT_INST %g
#define MX_ENABLE %h
#define MX_READ_WRITE %i
Once you have done this you can enter the parameters directly into the properties of the custom component in Flowcode.
Unfortunatly this way means that you will have to re-enter the parameters for every program you create that uses the custom component. A work around for this is to create a blank Flowchart containing a custom component, define your connections as needed and then use this file as a template for creating programs with that particular set of pin connections.