
EZ-USB Development Kit Manual - Getting Started
Page -16 EZ-USB Development Kit Manual - Getting Started Rev 1.0
The low address byte is “don’t care”. This means you can very efficiently add software test points
using the following code:
This code example uses the 8051 8-bit indirect addressing mode. The MPAGE register (SFR
0x92) supplies the high address byte, and r0 supplies the low address byte. Register r0 does not
require initialization since the low address byte is “don’t care” for the LED decoding.
To turn the LEDS on and off using C code, declare the external memory locations, and then read
their values into dummy variables:
Note: Program execution at these addresses will NOT activate the LEDs.
Indicator Turn ON by reading Turn OFF by reading
D2 0x88-- 0x80--
D3 0x98-- 0x90--
D4 0xA8-- 0xA0--
D5 0xB8-- 0xB0--
D5ON: mov MPAGE,#B8h ; turn D5 on
movx a,@r0 ; dummy read
;
D5OFF: mov MPAGE,#B0h ; turn D5 off
movx a,@r0 ; dummy read
xdata volatile unsigned char D5ON _at_ 0xB800;
xdata volatile unsigned char D5OFF _at_ 0xB000;
unsigned char dum;
dum = D5ON; // turn D5 on
dum = D5OFF; // turn D5 off
D5 D4
D3
D2
These 4 jumpers must be in place
Comentários a estes Manuais