TOOTHPIC RF Solutions, TOOTHPIC Datasheet - Page 80

MODULE, BLUETOOTH, DATA ACQUISITION

TOOTHPIC

Manufacturer Part Number
TOOTHPIC
Description
MODULE, BLUETOOTH, DATA ACQUISITION
Manufacturer
RF Solutions
Datasheet

Specifications of TOOTHPIC

Svhc
No SVHC (15-Dec-2010)
ToothPIC Services Reference
ToothPIC Services are pre-installed in the protected memory region 0x0000 to 0xBFFF and are not available
if you choose to overwrite this memory. Certain functions are more suited to inline compilation and are
macros defined in the file ToothPIC.h.
Examples of the use of most services can be seen in the BlueMatik Diagnostic and ToothPIC Diagnostic
Firmware Solutions.
Analog I/O
ToothPIC’s PIC18LF6720 microcontroller supports 12 channels of 10-bit analog to digital conversion. The
ToothPIC Diagnostic Firmware Solution provides an example of its use.
The following macros are defined in ToothPIC.h:
Example:
Page 80
Definition
ADConverterOn10bit
ADConverterOn8bit
ADConverterOff
VRefNegIsVss
VRefNegIsAN2
VRefPosIsVdd
VRefPosIsAN3
SetAnalogNone
SetAnalogAD0
SetAnalogAD0toAD1
SetAnalogAD0toAD2
SetAnalogAD0toAD3
SetAnalogAD0toAD4
SetAnalogAD0toAD5
SetAnalogAD0toAD6
SetAnalogAD0toAD7
SetAnalogAD0toAD8
SetAnalogAD0toAD9
SetAnalogAD0toAD10
SetAnalogAD0toAD11
SetADChan( ch )
StartAtoD
AtoDInProgress
AwaitAtoDComplete
GetADResult8bit(uData)
GetADResult10bit(uData)
// Initialization
SetAnalogAD0toAD11;
ADConverterOn10bit;
VRefNegIsVss;
VRefPosIsVdd;
// Conversion
9-Apr-06
Toothpick 3.0.00007
DS380-8
Function
Turn on A to D converter for 10-bit data conversion
Turn on A to D converter for 8-bit data conversion
Turn off A to D converter
Sets negative voltage reference to Vss
Sets negative voltage reference to AN2
Sets positive voltage reference to Vdd
Sets positive voltage reference to AN3
Sets all ADx pins as digital I/O
Sets AD0 as analog input and all other ADx pins as digital I/O
Sets AD0 and AD1 as analog and all other ADx pins as digital I/O
Sets AD0 to AD2 as analog and all other ADx pins as digital I/O
Sets AD0 to AD3 as analog and all other ADx pins as digital I/O
Sets AD0 to AD4 as analog and all other ADx pins as digital I/O
Sets AD0 to AD5 as analog and all other ADx pins as digital I/O
Sets AD0 to AD6 as analog and all other ADx pins as digital I/O
Sets AD0 to AD7 as analog and all other ADx pins as digital I/O
Sets AD0 to AD8 as analog and all other ADx pins as digital I/O
Sets AD0 to AD9 as analog and all other ADx pins as digital I/O
Sets AD0 to AD10 as analog and AD11 pins as digital I/O
Sets AD0 to AD11 as analog inputs
Selects ADch pin for A to D conversion. A delay is required
between selecting the channel and starting conversion. As a rule
of thumb, call CyclesDelay16plus16times( 9 ) or consult
PIC18LF6720 microcontroller documentation
Starts A to D conversion
Nonzero until A to D conversion is finished
Does not continue until A to D conversion is finished
Places 8-bit A to D result in uData
Places 10-bit A to D result in uData
© FlexiPanel Ltd
Patents apply and/or pending
www.FlexiPanel.com

Related parts for TOOTHPIC