668-0003-C Rabbit Semiconductor, 668-0003-C Datasheet - Page 44

no-image

668-0003-C

Manufacturer Part Number
668-0003-C
Description
IC CPU RABBIT2000 30MHZ 100PQFP
Manufacturer
Rabbit Semiconductor
Datasheet

Specifications of 668-0003-C

Rohs Status
RoHS non-compliant
Processor Type
Rabbit 2000 8-Bit
Speed
30MHz
Voltage
2.7V, 3V, 3.3V, 5V
Mounting Type
Surface Mount
Package / Case
100-MQFP, 100-PQFP
Features
-
Other names
316-1004
668-0003

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
668-0003-C
Manufacturer:
Rabbit Semiconductor
Quantity:
10 000
The privileged instructions to manipulate the IP register are listed below.
3.5.4 Critical Sections
Certain library routines may need to disable interrupts during a critical section of code.
Generally these routines are only legal to call if the processor priority is either 0 or 1. A
priority higher than this implies custom hand-coded assembly routines that do not call
general-purpose libraries. The following code can be used to disable priority 1 interrupts.
This code is safe if it is known that the code in the critical section does not have an embed-
ded critical section. If this code is nested, there is the danger of overflowing the IP register.
A different version that can be nested is the following.
The following instructions are also privileged.
3.5.5 Semaphores Using Bit B,(HL)
The
following code.
A semaphore is used to gain control of a resource that can only belong to one task or pro-
gram at a time. This is done by testing a bit to see if it is on, in which case someone else is
using the resource, otherwise setting the bit to indicate ownership of the resource. No
interrupt can be allowed between the test of the bit and the setting of the bit as this might
allow two different program to both think they own the resource.
38
bit B,(HL)
IPSET 0
IPSET 1
IPSET 2
IPSET 3
IPRES
RETI
POP IP
IPSET 1 ; save previous priority and set priority to 1
....critical section...
IPRES
PUSH IP
IPSET 1
....critical section...
POP IP
LD A,xpc
LD xpc,a
BIT B,(HL)
BIT B,(HL)
SET B,(HL)
; if zero flag set the semaphore belongs to us;
; otherwise someone else has it
; restore previous priority
; save previous priority and set priority to 1
; restore previous priority
; shift IP left and set priority 00 in bits 1,0
; rotate IP right 2 bits, restoring previous priority
; pops IP from stack and then pops return address
; pop IP register from stack
instruction is privileged to allow the construction of a semaphore by the
; test a bit in the byte at (HL)
; make sure bit set, does not affect flag
Rabbit 2000 Microprocessor User’s Manual

Related parts for 668-0003-C