udamonic.com
  • Start
    • What is a Scamp?
    • Getting Started
    • Getting Started (Windows)
  • Learn
    • What is Forth?
    • Arithmetic
    • The Stack
    • Creating Words
    • Compilation Tricks
    • Decompilation
    • Comments
    • Characters and Strings
    • Accessing Memory
    • Constants, Variables and Values
    • Flow Control
    • Loops
    • Data Structures
    • Doubles, Triples and Quads
    • FlashForth Dictionary Reference
    • Scamp Dictionary Reference
  • Extras
    • Interrupts
    • Timers
    • Multitasking
    • Delays and Tick Count
    • Processor Words
    • Starting up with turnkey
    • Changing the Prompt
    • Formatting Text on Screen
  • Interfacing
    • Using the LED Array
    • Temperature Sensor
    • Input/Output
    • Analog Input
    • Serial >
      • Serial Communication
      • Scamp2 UART Pins
    • I2C >
      • I2C Overview
      • I2C Commands
    • SPI
    • PWM
    • Peripheral Pin Select
    • Input Capture
    • Digital Signal Modulator
  • Create
    • Creating PCBs >
      • Designing PCBs
      • Fabricating PCBs
      • Soldering
    • Sensing >
      • Measuring Temperature
    • LEDs >
      • Adding LEDs
      • LED arc-welder effect
    • Displays >
      • Adding a 7 Segment Display
      • Adding a Touch LCD
      • Touch LCD GUI
      • Game of Pong
    • Adding Extra GPIO
    • Adding a Low Side Switch
    • FizzBuzz
    • Adding MRAM
    • Model Train Control
    • Adding a Real Time Clock
    • Scamp Projects on Youtube
  • Resources
  • Store
  • About
  • Contact

Measuring Temperature Using the Onboard Sensor
​

Scamp1 (Rev C) and Scamp2 computers have a footprint for an optional onboard PCT2075 temperature sensor (not included), which can be fitted by the user. Scamp3 computers have a STLM75 sensor included. The datasheet for the Scamp2 sensor can be found here: https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf.
The datasheet for the Scamp3 sensor can be found here: www.st.com/resource/en/datasheet/stlm75.pdf

Both sensors are software compatible with each other. 
Dictionary support for this sensor is included in the Scamp's BSP. 
Picture
The sensor is mapped to I2C address $48 on a Scamp3.
The sensor is compatible with the common LM75 temperature sensors, but with increased accuracy. Note that the sensor measures the temperature of the PCB to which it is attached, which may not be exactly the same as local ambient weather conditions. 

The word: ​
temp
reads the sensor over the I2C bus and returns two values to the stack. ​The values are the (integer) temperature in degrees Celsius, and the fractional temperature in milli degrees Celsius.

For example, if temp returned  25  750, then the temperature reading is 25.750°C.
The absolute accuracy of the sensor is ±1°C ​over -25°C to +100°C range, so for most applications it makes sense to just drop the fractional component. To read the absolute temperature:
temp drop
The fractional part of the temperature reading is useful if you're interested in small differential changes over a short time, rather than an absolute reading. 

Site powered by Weebly. Managed by Hostwinds
  • Start
    • What is a Scamp?
    • Getting Started
    • Getting Started (Windows)
  • Learn
    • What is Forth?
    • Arithmetic
    • The Stack
    • Creating Words
    • Compilation Tricks
    • Decompilation
    • Comments
    • Characters and Strings
    • Accessing Memory
    • Constants, Variables and Values
    • Flow Control
    • Loops
    • Data Structures
    • Doubles, Triples and Quads
    • FlashForth Dictionary Reference
    • Scamp Dictionary Reference
  • Extras
    • Interrupts
    • Timers
    • Multitasking
    • Delays and Tick Count
    • Processor Words
    • Starting up with turnkey
    • Changing the Prompt
    • Formatting Text on Screen
  • Interfacing
    • Using the LED Array
    • Temperature Sensor
    • Input/Output
    • Analog Input
    • Serial >
      • Serial Communication
      • Scamp2 UART Pins
    • I2C >
      • I2C Overview
      • I2C Commands
    • SPI
    • PWM
    • Peripheral Pin Select
    • Input Capture
    • Digital Signal Modulator
  • Create
    • Creating PCBs >
      • Designing PCBs
      • Fabricating PCBs
      • Soldering
    • Sensing >
      • Measuring Temperature
    • LEDs >
      • Adding LEDs
      • LED arc-welder effect
    • Displays >
      • Adding a 7 Segment Display
      • Adding a Touch LCD
      • Touch LCD GUI
      • Game of Pong
    • Adding Extra GPIO
    • Adding a Low Side Switch
    • FizzBuzz
    • Adding MRAM
    • Model Train Control
    • Adding a Real Time Clock
    • Scamp Projects on Youtube
  • Resources
  • Store
  • About
  • Contact