Hi,
A forum is not meant that others do your job or post code for you.
Btw: an internet search gives a lot of application notes, tutorials, documents that show how to do it.
Even the most reliable ones: directly from the chip manufacturer
So
* copy code or try to write your own according the available informations
* test your code
* try to rectify your code
If you fail to get it running: Show what you have done so far:
* post our code
* post your expectations and test conditions
* post your calculations
... then there will be a lot of people here to help you to rectify your code.
Klaus