Jump to content


  • Content Count

  • Joined

  • Last visited

  1. How much code memory does it need? Will it fits in msp430g2452?
  2. I've made a few tests, this code starts working good from 5Mhz. At lower frequencies readout unstable or impossible. BUT I find a way how to run this algorithm with DCO on 1 MHz. All you need is to rewrite the arduino-like part using defines instread of using functions. This is my code: //------------------------------------------------------------------------------ // Arduino like digitalRead, pinMode, and digitalWrite and some other helper functions. //------------------------------------------------------------------------------ #define LOW 0 #define HIGH 1 #define INPUT 0 #defin
  3. page 3 of datasheet for ds18s20 shows method how we can get more accurate results, than 0.5 degree. After reading scratchpad we will need 4 values: 1) Temperature: ScratchPad[0] 2) Sign: ScratchPad[1] 3) Count_remain: ScratchPad[6] 4) Count_per_C: ScratchPad[7] //it always equals 16 so, code should looks like this: LowByte = ScratchPad[0]; HighByte = ScratchPad[1]; COUNT_REMAIN = ScratchPad[6]; COUNT_PER_C = ScratchPad[7]; if (HighByte) TReading = -LowByte; else TReading = LowByte; Tc_100 = ((TReading * 50) - 25 + ((COUNT_PER_C - COUNT_REMAIN)*100) / COUNT_PER_C)/10
  4. I would like to thank NatureTM for this topic and say that if someone afraid to apply this method, then there is no reason. Official TI page offers code samples for MSP430G2xx1 that includes file msp430x20xx_dco_flashcal.c which almost identical with the file on the second page of this topic, written by zeke and needs no DCO library, so this is at least semi-official method :thumbup:
  • Create New...