Page 1 of 1

SPI - on the fly

Posted: Fri Jun 28, 2013 7:35 am
by Mantas
Hi,

Would it be possible to make some additional macros to be able to change clock polarity and similar settings on the fly? Just in case you have multiple SPI devices with different settings.

Regards,
Mantas

Re: SPI - on the fly

Posted: Fri Jun 28, 2013 9:15 am
by Benj
Hi Mantas,

I will see how easy it would be to add something to the CAL file. For now you can control the SPI configuration by using a C icon with the following, replacing the 1's with 0's where needed.

Code: Select all

sspcon.CKP  = 1;		//Assign Clock Polarity
sspstat.CKE  = 1;		//Assign Clock Phase
sspstat.SMP  = 1;		//Assign Input Data Phase

Re: SPI - on the fly

Posted: Fri Jun 28, 2013 3:20 pm
by Mantas
But as I can see from the C code it is for PIC mics. For ARMS and AVRS you would need to refer to datasheets for specific C commands. Why not just make a macro where you choose the settings like setings in the component windowby setting ones and zeroes?

Best regards,
Mantas

Re: SPI - on the fly

Posted: Fri Jun 28, 2013 5:28 pm
by Benj
Hi Mantas,
Why not just make a macro where you choose the settings like settings in the component window by setting ones and zeroes?
That would be the best case situation and I should be able to do this for v6 no problem, however it is unlikely we will apply this mod to v5 unless there is a good reason to? If it will make your life easier then I could be persuaded :D

Re: SPI - on the fly

Posted: Sun Jun 30, 2013 8:26 am
by Mantas
Hi Benj,

Save your energy for v6 as v5 will soon be obsolete :) I am waiting for v6 and I am also hoping that I will be able to port my v5 projects to v6! :) Otherwise it will be "cry me a river..." :D

Best regards,
Mantas

Re: SPI - on the fly

Posted: Tue Jul 02, 2013 9:22 pm
by JonnyW
Hi Mantas.

Yes, you will be able to port your projects to v6, though the file format and the structure of the components has changed completely. The format for a v6 project is an XML format, so is human readable and editable - no more corrupted and broken save files!

The components should all convert, though custom components and components with customised code may need to be ported by hand. There is no customise component code feature in v6, and instead you can replace the macros of existing components with your own flowcharts using component inheritance (and produce your own components in this way).

Cheers,

Jonny