Shop OBEX P1 Docs P2 Docs Learn Events
Need help with uM-FPU — Parallax Forums

Need help with uM-FPU

HIBITDACHIBITDAC Posts: 40
edited 2009-05-26 22:29 in BASIC Stamp
Im trying to read a thermistor though a LTC1298 then do all the calculations in the uM-FPU.

I'm reading the voltage across the thermistor, subtract that from 5 which gives me the voltage across the 10k ohm resistor that it is in series with. Then then calculating the current, then dividing the voltage across the thermistor by the current to give me the resistance of the thermistor. Once i get the resistance i have to use the following equation is get the temperature. 1/(a+b*(ln(R))+c*(ln(R))^3. a = .000752, b = .000234, and c = .0000000589321. THis equation works perfect in my ti 92-plus. I any having trouble writing anything to the uM-FPU and getting it back out. Any help is appreciated.

Comments

  • HIBITDACHIBITDAC Posts: 40
    edited 2009-03-28 02:10
    Okay got something to work, but now how did I get a DEC number from BYTE00, BYTE01, BYTE02, and BYTE03? I also uploading my updated code.
    1400 x 1050 - 389K
  • FranklinFranklin Posts: 4,747
    edited 2009-03-28 05:45
    You've got the attachment part right how about attaching your actual code instead of a text file.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • HIBITDACHIBITDAC Posts: 40
    edited 2009-03-28 06:32
    Heres the bs2sx file.
  • HIBITDACHIBITDAC Posts: 40
    edited 2009-04-01 06:48
    Okay, New problem. I got everything to work, but I need to compare the temp to a preset value to control a fan speed. Since it writes one number at a time I cant compare that and I cant figure out how to get the whole number into a variable that I can use to compare the 2 values. Any help is greatly appreciated.
  • HIBITDACHIBITDAC Posts: 40
    edited 2009-04-01 22:50
    Any thoughts?
  • halfblinddadohalfblinddado Posts: 59
    edited 2009-04-02 22:06
    I don't know if this helps.

    This code from the FPU outputs a variable called dataWord.

    dataWord······· VAR···· Word············· ' data word
    dataHigh······· VAR···· dataWord.HIGHBYTE ' high byte of dataWord
    dataLow········ VAR···· dataword.LOWBYTE· ' low byte of dataLow


    ·· GOSUB Fpu_Wait
    ·· SHIFTOUT FpuOut, FpuClk, MSBFIRST, [noparse][[/noparse]LREADWORD]
    ·· SHIFTIN FpuIn, FpuClk, MSBPRE, [noparse][[/noparse]dataWord.HIGHBYTE, dataWord.LOWBYTE]

    Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything is working so why do we pay him?"


    "Nothing is working so why do we pay him?"
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-04-03 23:49
    uM-FPU, eh?·-- do you, by any chance, speak Hawaiian?· It's not exact, but it's close enough to true nastiness.· turn.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • HIBITDACHIBITDAC Posts: 40
    edited 2009-04-07 19:38
    halfblinddado said...
    I don't know if this helps.

    This code from the FPU outputs a variable called dataWord.

    dataWord VAR Word ' data word
    dataHigh VAR dataWord.HIGHBYTE ' high byte of dataWord
    dataLow VAR dataword.LOWBYTE ' low byte of dataLow



    GOSUB Fpu_Wait
    SHIFTOUT FpuOut, FpuClk, MSBFIRST, [noparse][[/noparse]LREADWORD]
    SHIFTIN FpuIn, FpuClk, MSBPRE, [noparse][[/noparse]dataWord.HIGHBYTE, dataWord.LOWBYTE]



    Mike

    Tried that but the numbers are way off. Still playing around with the commands
  • HIBITDACHIBITDAC Posts: 40
    edited 2009-05-26 22:29
    Still havent been able to get the numbers from the uM-FPU into usable variables. From what I've seen so far it writes the numbers one by one as it gets them. Does anyone have any ideas how to get them into variables?
Sign In or Register to comment.