manage 32 bits

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

manage 32 bits

Post by maxtisc »

hello everybody,
I need an advice for an application, from a sensor with SPI output I have to read 4 registers in 32 bits, from which I then have to get measures and alarms of operation, which is the correct approach to manage 32 bits?
use array? circular buffer? or other?
Thanks for your help

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: manage 32 bits

Post by medelec35 »

Hi maxtisc,
Attached is a Flowcode 8 macro that reads 32bits (4 lots of 8 bit registers) of FT810.
I believe your device would be read similar to FT810 as that too has only 8 bit words.
Attachments
ft800memRead32.fcm
(3.16 KiB) Downloaded 186 times
Martin

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: manage 32 bits

Post by maxtisc »

Hi Martin
thank you very much for your answer, I uploaded the file, it seems very complicated to me, I ask you if you can explain the various steps to better understand how the macro works.
thank you

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: manage 32 bits

Post by medelec35 »

Hi maxtisc,
it was Ben Who created the macro, so I will see it I can help.
That was just an example.
What is the address you need to read from?
Martin

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: manage 32 bits

Post by maxtisc »

Hi Martin
thanks for your interest, attached the table for reading the registers, while I try to do something
thank's for your job
Attachments
DS000323.docx
(23.7 KiB) Downloaded 162 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: manage 32 bits

Post by medelec35 »

Hi maxtisc,
It would be more helpful If i know what the component is so I can access the full datasheet.
Martin

maxtisc
Posts: 110
Joined: Mon Dec 23, 2013 9:34 pm
Has thanked: 2 times
Been thanked: 9 times
Contact:

Re: manage 32 bits

Post by maxtisc »

Hi Martin
excuse if I answer only now, attached the complete datasheet
thanks
Attachments
TDC-GP22_GP30_flowmeter.pdf
(1.46 MiB) Downloaded 181 times

Post Reply