![](http://datasheet.mmic.net.cn/260000/PPSMMANUAL_datasheet_15946768/PPSMMANUAL_172.png)
33-6
Device Drivers
Programmer’s Manual
M68328ADS implementation:
Port M pin 6 is assigned as the PENIRQ pin. To enable PENIRQ, the following
sequence is required:
Enable Port M pin 6 pull-up resistor
Discharge the transistor network such that all Vcc are on, ground
are off, i.e. set Port J Data register, 0xFFF439, to 0xF0
Charge up the transistor that is connected to PENIRQ, i.e. set Port
J Data register, 0xFFF439, to 0x0D
Switch Port M pin 6 to interrupt pin, i.e. set Port M Selector register,
0xFFF448, bit 6 to 0
Enable Interrupt Mask Register, 0xFFF304, bit 20 for interrupt
Please refer to the M68328ADS User’s Manual
for details on transistor network
switching.
M68EZ328ADS implementation:
IRQ5(port F1) is assigned as the PENIRQ pin. To enable PENIRQ, the
following sequence is required:
Enable Port F pin 1 pull-up resistor
Discharge the transistor network such that all Vcc are on, ground
are off, i.e. set Port D Data register, to 0xF0
Charge up the transistor that is connected to PENIRQ, i.e. set Port
D Data register, to 0x0D
Switch Port F pin 1 to interrupt pin, i.e. set Port F Selector register,
bit 1 to 0
Enable Interrupt Mask Register, bit 20 for interrupt
Please refer to the M68EZ328ADS User’s Manual
for details on transistor network
switching.
33.2.3
Pen Interrupt Disable
Syntax
void
PenIrptDisable
(void)
Description
This function disables the Pen Interrupt, PENIRQ.
M68328ADS implementation:
Port M pin 6 is assigned as the PENIRQ pin. To disable PENIRQ, the following
sequence is required:
Disable Interrupt Mask Register, 0xFFF304, bit 20 for interrupt
Switch Port M pin 6 to I/O pin, i.e. set Port M Selector register,
0xFFF448, bit 6 to 1
Disable Port M pin 6 pull-up resistor. If not switched off, it will
interfere with A/D sampling
Personal Portable System Manager
Programmer’s Manual
Device Drivers
33-7
Discharge the transistor network such that all Vcc are on, ground
are off, i.e. set Port J Data register, 0xFFF439, to 0xF0
Switch transistor network to idle mode, i.e. set Port J Data register,
0xFFF439, to 0x05
Please refer to M68328ADS User’s Manual
for details on transistor network
switching.
M68EZ328ADS implementation:
IRQ5 is assigned as the PENIRQ
sequence is required:
, the following
Disable Interrupt Mask Register, bit 20 for interrupt
Switch Port F pin 1 to I/O pin, i.e. set Port F Selector register, bit 1
to 1
Disable Port F pin 1 pull-up resistor. If not switched off, it will
interfere with A/D sampling
Discharge the transistor network such that all Vcc are on, ground
are off, i.e. set Port D Data register, to 0xF0
Switch transistor network to idle mode, i.e. set Port D Data register,
to 0x05
Please refer to M68EZ328ADS User’s Manual
for details on transistor network
switching.
Pen Read Device
Syntax
void
PenReadDevice
Description
This function returns a reading for X and Y to the caller and switches the
transistor network accordingly for reading X and Y.
M68328ADS implementation:
For X sampling, the transistors Q4 and Q6 needs to be ON while transistors Q3
and Q5 are OFF, see
, i.e. set Port J Data register, 0xFFF439, to
0xF9. While the transistors are in this setting, Port J pin 7 is asserted to activate
the A/D convertor for the sampling. The digital value returned from the A/D
convertor is stored in the SPIM Data register, 0xFFF800.
For Y sampling, the procedure is the same as X sampling except that the
transistors Q3 and Q5 needs to be ON while transistors Q4 and Q6 are OFF,
see
Figure 31-1
, i.e. set Port J Data register, 0xFFF439, to 0xF6.
The X and Y samples thus obtained are returned to the caller in the pointer
arguments passed in by the caller.
M68EZ328ADS implementation:
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.