Page
18
Board Applications
Using Switches and LEDs
The LEDs are connected through a 1K resistor network to Port B.
The switches are connected to Port D.
The switches and LEDs can be disconnected if required, so to use them, ensure that the jumpers
labeled Port B and Port D are closed. The board is also marked with the port pin connection for
each switch and LED.
The ports must be correctly set in software as input or output. This is accomplished by setting the
direction control registers to 0 for input and 1 for output. Typical set up code would be :
mov r16, $ff ; move literal into temporary store register
out DDRB, r16 ; set direction register to ones for output - LEDs
out PORTB, r16 ; switch all the LEDs on
mov r16, $00 ; move literal into temporary store register
out DDRD, r16 ; set direction register to zeros for input - Switches
Using External Connections
•
All the ports are brought out to headers on the edge of the board. In addition to the port pins,
each header has a connection for ground and Vcc to supply external circuits. Note this
voltage (Vcc) will be either 3.3V or 5V depending on the setting of jumper 1 (JP1) and the
brown out detector will operate.
Note :
If your circuit is to draw significant current ( >250 mA) then a heat sink will be required on
the on-board regulator - LM317. This device is rated at 1.5 Amps but it does need a heat sink to
supply this current. If your circuit will draw more than 1 amp, you may need a separate power
supply. The ports on the device are connected to the headers marked Port A, Port B, Port C, Port
D, Port E and Analog (Port F). The layout of all the headers is the same and is shown in the
diagram.
BIT 1
BIT 3
BIT 5
BIT 7
Vcc
BIT 0
BIT 2
BIT 4
BIT 6
GND
Misc Header
Bit 0 of Port. Same
for all Ports.
Cut Corner shown on
board for orientation
Bit 7 of Port. Same
for all Ports
Extra Connection
for Vcc
Extra Connection
for Ground
Содержание STK300
Страница 1: ...Page 1 STK300 USER MANUAL Published by KANDA SYSTEMS LTD www kanda com...
Страница 33: ...Page 33 Timer 2 Window Timer 2 is an 8 bit Timer Counter Standard Operation...
Страница 42: ...Page 42 Port F Window Port F is input only Any bits not used by the ADC can be used for standard input...
Страница 45: ...Page 45...