Quote Originally Posted by mind
...Since I hate reading old posts where the person has the same problem as I did, and solved it, but there is no mention of the solution, I have included working code below.
Richard, so do we hate this.

Tell us what the actual problem was, or do you want us to compare your non working code with the working code and then both of them with the datasheet(s)?