We quickly want to examine the effects of using an AT30TS750A General Call. The temperature sensor default sampling resolution is 9bits, which we’re changing in our setup routine. By using the General Call with a Reset operations code, we can return to the default state just by issuing a quick command. However, in this module, I’ll provide the design goals for your code and the specifications for what you will need to use, and provide a set of working code you can compare against at the end of the module. This is an opportunity for you see how comfortable you are with your understanding to this point.

Objectives

  1. Use buttons on the Education Shield as digital inputs.
  2. Write a function that issues the General Call address followed by a reset command.

Background
I2C Basics
AT30TS750A Functionality Overview
Retrieving Temperature Value
Atmel AT30TS750A Datasheet


Schematic
Education Shield – AT30TS750A Temperature Sensor Subsystem
Education Shield – Shift Register Subsystem


Setup
For this module, you’ll need the following equipment:

1. Place jumpers on the 74HC595 Enable block along the edge of the Education Shield. This will enable the microcontroller to read button presses.

2. Mate the Education Shield with your Arduino UNO R3. If you’re using the AT30TS750A Breakout Board and the Debounce Button Breakout Board, check the labels by the pins and for the AT30TS750A connect 5V to 5V, GND to GND, SC to Analog 5, SD to Analog 4 and AL to Digital2 and for the Debounce Button Board, connect 5V to 5V, GND to GND, and B1 to Digital8 and B2 to Digitl7.

3. Finally, connect your Arduino to your USB cable, and use the Arduino IDE to upload the “Bare Minimum” sketch from the Basics section of the Examples.


Testing the AT30TS750A General Call

The General Call address is an I2C slave address, 0x00, that can be issued to allow interaction with multiple devices at the same time. We’re going to use it to reset our temperature sensor back to it’s default power up state.

The datasheet for the AT30TS750A allows for two different commands, also called Operations Codes or OpCodes to be issued after the General Call…

  1. 0x04 RESET ADDRESS – This is used if the three configurable address pins, A0, A1 and A2, have had their state changed and need a live reset of the I2C address of the device. This could be performed by tying those pins to GPIO pins of your microcontroller, the digital pins of your Arduino for example, however looking at the schematic for the Education Shield, you’ll see that those three pins are permanently tied to ground, so we can’t really play with this command.
  2. 0x06 POWER ON RESET – This command will also perform an address reset, but in addition to that, it causes the configuration values that are specified in the non-volatile configuration registers to overwrite whatever is running in the volatile configuration registers. We’ll use this to test the effects of issuing the General Call address.

Design Challenge

By this point you should be fairly proficient with the registers of the temperature sensor, how to address them with the Wire Library and reading button presses, so rather than simply give you the code (which is still provided below), I’ll give you design goals instead, on which you can base your efforts. You should absolutely reuse code from previous modules to fill in the blanks, no need to write it all from scratch.

Design Goals

  1. Create constants to hold the General Call address, 0x00 and the Reset OpCode, 0x06.
  2. Initialize the AT30TS750A using 12 bit sampling resolution when your code first starts.
  3. Issue the General Call address and the Reset command, when the DATA button is pressed.
  4. Test that the resolution has changed by sampling the temperature both before and after the reset.

Test Conditions

  1. Does your chip start up and provide temperature data using 12 bit resolution? This would be equal to four decimal places of data..
  2. Are you using the General Call correctly?
  3. Is the chip resetting to the default resolution stored in non-volatile RAM?
Issuing General Call with Power On Reset
Issuing General Call with Power On Reset

Example Code


The example code is below. Try to create the code using the design goals above yourself, before referring to it.


Previous Post
AT30TS750A Tutorial 03: Configuring On The Fly
Next Post
AT30TS750A Tutorial: Alarms, Limits and Interrupts
You might also like
Menu