Working With Tibbit #43-2
Before you can start the signal acquisition with Tibbit #43-2, you must configure it.
If your application will only need to perform analog-to-digital conversions from time to time, it can keep the Tibbit in the command mode and use the RA or RH commands to measure the voltages on the Tibbit's inputs whenever needed. In this case, Tibbit #43-2 only requires you to select between the single-ended or differential mode using the SM command:
Command:
Reply: A
Command:
...
If your application requires a steady stream of signal measurements, configure the Tibbit for the data streaming mode. This entails programming four settings:
- SM to select the sampling mode
- SD to choose the data output format
- SR to set the sampling rate
- SC to enable the desired channels
After that, your application should switch into the data streaming mode and start receiving the ADC sampling data:
Command:
Reply: A
Command: SD0
Reply: A
Command: SR400 '
Reply: A
Command: SC1,2 '
Reply: A
Command: D
<
...
The above configuration steps must be performed after every power-up or reset, as the settings configured through these commands are only stored in the PIC microcontroller's RAM.
Another approach would be to configure the Tibbit once and save the configuration into the EEPROM:
Command:
Reply: A
Command: SD0
Reply: A
Command: SR400 '
Reply: A
Command: SC1,2 '
Reply: A
Command: SE '
Reply A
...
Tibbo recommends that you be extra careful with the SE command to avoid excessive EEPROM writing. While modern EEPROMs have a significant number of allowed write cycles, there is still a limit. For more information, see Prolonging and Estimating EEPROM Life. If the write to the EEPROM fails, this command will return the F status code.
Once the desired configuration has been saved into the EEPROM, your application does not have to program the same settings on each power-up and can proceed directly into the data streaming mode:
Command: D
<
...