ADIS16250: Help with setting up SPI


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hello, I am working trying to display the degrees per second on an LCD. I want to have accuracy with the displayed value, but for now would be happy with just integers. Can someone help me figure it out? Thanks

  2. #2
    Payatronico's Avatar
    Payatronico Guest


    Did you find this post helpful? Yes | No

    Default But...

    Hey, how do you want to aquire the temperature? and I can't understand how do you want to calculate degrees per second? explain me better and I will try to solve your problem. If you don't have an idea I can give you some ones.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    I have a LCD connected to my PIC, and I wish to display the rotation of the Gyro in degrees per second. I need decimals, and I am having trouble working out the math without maxing out the word variables. Thanks

  4. #4
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Give us a little more information or an example of what you are trying to do. With the DIV32 command in PBP, you can work around a lot of math issues by shifting the decimal point to the right before you do the math. By keeping track of the magnitude of your decimal shift, you can display the result as needed.

    Here are a couple of nice threads by Darrel Taylor dealing with exploiting PBP's integer math:
    32-bit Variables and DIV32, Hourmeter 99999.9
    Retrieving 32bit Multiply Result
    Retrieving Div32 Remainder

    Steve

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Lets say I was rotating my Gyro at 600 degrees per second. The sensor's output would be 8191 in decimal according to the datasheet. Now lets say that the sensor is outputing 856 in decimal format. The sensor works at 0.07326 degrees per LSB. That means 0x0000 is 0, 0x0001 is 0.07326, 0x0002 is .14652 and so on. In order to use integer math, I need to use 7326.

    100000 * .07326 = 7326

    7326 * 856 = 6271056

    One problem is 2 digits are cut off. How do I get around this?

  6. #6
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Check out the threads I linked my previous post. The Hourmeter should be particularly helpful. If I get some free time soon, I can try to give you a more specific response if your still stumped. But I bet you will be able to come up with something on you own if you read carefully.

    HTH,
    Steve

Similar Threads

  1. Winbond ISD1700 Voice Recorder
    By RFEFX in forum mel PIC BASIC Pro
    Replies: 58
    Last Post: - 22nd April 2014, 10:00
  2. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  3. Using SPI with External Interrupts
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th June 2008, 04:08
  4. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 15:42
  5. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 18:31

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts