Using the EVB - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Using the EVB

Description:

Type ctrl-A on a blank line to exit the assembler mode. 6. Cycle Counting. Generating Delays ... Let's see about generating a 1 ms delay subroutine. 8. How many ... – PowerPoint PPT presentation

Number of Views:60
Avg rating:3.0/5.0
Slides: 13
Provided by: robertb4
Category:
Tags: evb | about | blank | using

less

Transcript and Presenter's Notes

Title: Using the EVB


1
Using the EVB
  • Connections
  • Downloading .s19 files

2
Connect the PC to the EVB
  • A serial communications cable is attached to
    COM1.
  • It has has a DB-25 connector.
  • Attach the cable to the EVB Terminal Port.
  • Carefully connect the power cables to the power
    supply.
  • RED ? 5V
  • GREEN ? GND

MAKE SURE THAT YOU ARE APPLYING THE CORRECT
VOLTAGES TO THE WIRES AN INCORRECT CONNECTION
COULD CAUSE DAMAGE
3
Talking to the EVB
1. Start the Procomm Plus Terminal
program 2. Check the status bar on the
bottom VT-100, RAW ASCII, 9600, N-8-1 3. Turn
on power to EVB 4. Press RESET Button on
EVB This should bring up a "banner" from the
Buffalo monitor Problems? Check the cable
connections and Procomm settings 5. Type RETURN
to bring up the prompt "gt"
4
Buffalo Monitor Commands
1. Type HELP ltCRgt to bring up a list of the
Buffalo monitor commands Observe these are
identical to the commands you used for the
Simulator Exceptions it has no SCRIPT command
and has no Symbol table information ? need to use
G 6000 in place of GO START 2. Type L T ltCRgt to
ready the EVB to download your program via the
Terminal Port 3. In the Procomm Plus Terminal
window, click on the Send File folder button to
bring up a menu ... MORE ?
5
Buffalo Download Commands
4. Select your .s19 file and it will begin
uploading, When your program is loaded in the
EVB memory, Buffalo responds with done and a
prompt gt 5. You can verify that the program is
in memory by typing ASM ltaddressgt where ltaddressgt
is the starting address of your program, i.e.,
6000 Buffalo will show a single line of
disassembled code i.e., JMP 6033 Press ltCRgt to
see the next instruction Type ctrl-A on a blank
line to exit the assembler mode
6
Cycle Counting
  • Generating Delays

7
Time Delays
  • There are two ways to generate time delays using
    the 68HC11
  • Timer-based interrupts
  • Cycle counting

Let's explore the cycle counting
technique Interrupt methods come later
Let's see about generating a 1 ms delay subroutine
8
Cycle Counting
How long does it take to get from JSR DELAY back
to NEXT?
... JSR DELAY NEXT ...
2 2 3 5
DELAY LDAA 255 LOOP DECA BNE LOOP RTS
6
How many cycles does each instruction take?
Look it up in the PRG!
How many cycles does it take to go thru the loop
once?
5
How many times does it loop? 255
LOOP 255 x 5 1275 1-time 6 2 5 13 Total
cycles 1288
How many cycles does it take to get from JSR
DELAY back to NEXT?
9
Cycle Counting (2)
How long does it take to get from JSR DELAY back
to NEXT?
How long is 1288 cycles?
The 68HC11 clock ticks at a 2 MHz rate That's 2
cycles per microsecond or 1 cycle every 0.5 ?s
644 ?s or 0.644 ms
10
1 ms Time Delay
Error 0.0 ?s !!
1 ms 2000 cycles
248
1288 cycles is too few. Add more cycles in out
of LOOP. Use BRN
Now, how many cycles do we need in the LOOP?
2000 - 13 1987 Number of LOOPs 1987/8 248
3/8 Use 248
LOOP 248 x 8 1984 1-time 6 2 5 3 16
Total cycles 2000 Time delay 1.000 ms
11
Exercise 1
Write a subroutine that produces a time delay of
0.5 s. Debug it using the simulator. Test the
time delay on the EVB by calling it 100 times and
time it using your watch. Remember to initialize
the stack pointer to 004A, a 20-byte user stack
area reserved by Buffalo. Save the program as a
starting point. We will use it later.
12
Exercise 2
SOFTWARE Portion Write a program, based on
Exercise 1 that 1. Loads a bit pattern of 1s and
0s into Port B. 2. Rotates the pattern one
position (right or left) every half
second. HARDWARE Portion Connect the LED card to
Port B and test the shift pattern.
Write a Comment
User Comments (0)
About PowerShow.com