This subject has been hot lately! Please check old posts for info you require before posting.
Presumably you need this for the QG as in your last post?
Take a look here:
Its assembler, but its pretty easy in these newer chips so I am sure you can covert it to C if you have too.
Retrieving data ...