Produce DTMF touchTone sequence on Pin. Pin is automatically made an output. Pin may be a constant, 0-15, or a variable that contains a number 0-15 (e.g. B0) or a pin name (e.g. PORTA.0).
Onmsis the number of milliseconds to sound each tone and Offms is the number of milliseconds to pause between each tone. If they are not specified, Onms defaults to 200ms and Offms defaults to 50ms.
Tonesare numbered 0-15. Tones 0-9 are the same as on a telephone keypad. Tone 10 is the * key, Tone 11 is the # key and Tones 12-15 correspond to the extended keys A-D.
DTMFOUTuses FREQOUT to generate the dual tones. FREQOUT generates tones using a form of pulse width modulation. The raw data coming out of the pin looks pretty scary. Some kind of filter is usually necessary to smooth the signal to a sine wave get rid of some of the harmonics that are generated:
DTMFOUTworks best with a 20MHz oscillator. It can also work with a 10MHz oscillator and even at 4MHz, although it will start to get very hard to filter and be of fairly low amplitude. Any other frequency will cause DTMFOUT to generate a frequency that is a ratio of the actual oscillator used and 20MHz which will not be very useful for sending touch tones.
DTMFOUT is not supported on 12-bit core PICmicro MCUs due to RAM and stack constraints.
' Send DTMF tones for 212 on Pin1 DTMFOUT PORTB.1,[2,1,2]
Store constants in on-chip EEPROM. If the optionalLocation value is omitted, the first EEPROM statement starts storing at address 0 and subsequent statements store at the following locations. If the Location value is specified, it denotes the starting location where these values are stored.
Constantcan be a numeric constant or a string constant. Only the least significant byte of numeric values are stored. Strings are stored as consecutive bytes of ASCII values. No length or terminator is automatically added.
EEPROMonly works with microcontrollers with on-chip EEPROM such as the PIC16F84, PIC16C84, and the PIC16F87x series. It will not work on devices with on-chip I2C interfaced serial EEPROM like the 12CE67x and 16CE62x parts. Since EEPROM is non-volatile memory, the data will remain intact even if the power is turned off.
The data is stored in the EEPROM space only once at the time the microcontroller is programmed, not each time the program is run.WRITE can be used to set the values of the on-chip EEPROM at runtime. READ is used to retrieve these stored DATA values at runtime.
' Store 10, 20 and 30 starting at location 5 EEPROM 5,[10,20,30]
ENABLEdebug and interrupt processing that was previously DISABLEd following this instruction.
DISABLEand ENABLE are more like pseudo-ops in that they give the compiler directions, rather than actually generate code. See ON DEBUG and ON INTERRUPT for more information.
Disable ' Disable interrupts in handler myint: led = 1 ' Turn on LED when interrupted Resume ' Return to main program ENABLE ' Enable interrupts after handler
ENABLE DEBUGprocessing that was previously DISABLEd following this instruction.
DISABLE DEBUGand ENABLE DEBUG are more like pseudo-ops in that they give the compiler directions, rather than actually generate code. See ON DEBUG for more information.
ENSABLE DEBUG ' Enable calls to the debug monitor
ENABLE INTERRUPTprocessing that was previously DISABLEd following this instruction.
DISABLE INTERRUPTand ENABLE INTERRUPT are more like pseudo-ops in that they give the compiler directions, rather than actually generate code. See ON INTERRUPT for more information.
Disable Interrupt ' Disable interrupts in handler myint: led = 1 ' Turn on LED when interrupted Resume ' Return to main program ENABLE INTERRUPT ' Enable interrupts after handler