TOOTHPIC RF Solutions, TOOTHPIC Datasheet - Page 104

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)
BMTEvent and FxPEvent may be called from the Low Priority interrupt, so you should save any other static
variables used by the functions calls by BMTEvent and FxPEvent.
Software Interrupts
If you have a long task which requires a high priority interrupt for some reason, you can use a software
interrupt to trigger a low priority interrupt upon completion of the high priority interrupt. For example, the
BlueMatik UART interrupt handler quickly stores each received byte in a buffer. Then it decides whether the
received byte is the last byte of an AT message from BlueMatik. If it is, a software interrupt is used to trigger a
low priority interrupt which then interprets the command. The command can then be interpreted at leisure and
high priority interrupt events will still be handled immediately.
The PIC18LF6720 instruction set does not provide a software interrupt instruction, so Timer 2 is configured to
generate an immediate low priority interrupt. The public data byte SWIflags is used to record which event
generated the interrupt. The bit flags are:
The FlexiPanel server uses SWI_RestartSlave and SWI_RefreshDialog but the developer is also free to
do so.
The SWI_Tick interrupt may miss beats if other low priority interrupts take longer than a second to process.
The RealTimeClock clock values will, however, remain correct since these are incremented in a high priority
interrupt by the ToothPIC Services.
The following variables and macros are defined in ToothPIC.h and/or ToothPIC303.c:
Examples:
Page 104
Definition
SWIflags
SWIInit
SetSWI( SWI_Flag )
IsSWI( IntFlag )
ClearSWI( SWI_Flag )
SetSWI( SWI_SWI1 );
// low priority interrupt handler
void LowInterrupt (void)
{
bit value
0x01
0x02
0x04
0x08
0x10
0x20
0x40
0x80
9-Apr-06
if (IsSWI( SWI_BMTData ) )
{
ClearSWI( SWI_BMTData );
// process new data;
// can return now - if other interrupt flags are set,
Toothpick 3.0.00007
SWI_Flag bit field
SWI_ATResponse
SWI_FxPData
SWI_BMTData
SWI_RestartSlave
SWI_RefreshDialog
SWI_Tick
SWI_SWI2
SWI_SWI1
Function
Bit fields indicate cause of interrupt
Initializes Timer 2 for software interrupt this is called for you
before main() is called
Triggers software interrupt SWI_Flag
True if software interrupt SWI_Flag was triggered
Clears interrupt SWI_Flag.
DS380-8
Function
Internal use – responding to BlueMatik AT message
Internal use – responding to FlexiPanel message
BlueMatik data received
Starts BlueMatik slave mode
Resends dialog info to client
Called once a second by the real time clock
Free for developer use
Free for developer use
© FlexiPanel Ltd
// interrupt SWI_SWI1 will occur ASAP
// Clear interrupt flag
Patents apply and/or pending
www.FlexiPanel.com

Related parts for TOOTHPIC