1 / 6

68HC11 “simp2v2,3v2,4v2.asm” Programs

68HC11 “simp2v2,3v2,4v2.asm” Programs. This is our second lab using the 68HC11 microcontroller. We will examine the modified the “simple2.asm” renamed as “simp2v2.asm”. The student will then modify “simp2v2.asm into two additional programs: “simp3v2.asm” and “simp4v2.asm”.

marva
Download Presentation

68HC11 “simp2v2,3v2,4v2.asm” Programs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 68HC11 “simp2v2,3v2,4v2.asm” Programs This is our second lab using the 68HC11 microcontroller. We will examine the modified the “simple2.asm” renamed as “simp2v2.asm”. The student will then modify “simp2v2.asm into two additional programs: “simp3v2.asm” and “simp4v2.asm”. You will need a floppy diskette to hold your programs, for later printing.

  2. MODIFIED simp2v2.asm **************************************************************** *file: simp2v2.asm *This program illustrates flashing PA6.. *Dr. Hoganson, 10/2/02 **************************************************************** org $e000 ;beginning of EEPROM (68HC811E2) rbase equ $0000 ;beginning of register/memory port_a equ rbase+0 ;port A is the first register h_sec equ $ffff ;delay loop value (about 1/2 second) **************************************************************** begin: ldaa #$04 ;value to disable timed interrupt staa $3f ;disables the timed interrupt lds #$ff ;set stack start loop: ldaa #$40 ;write logic high to PA6 (turn on LED) staa port_a ;$0 is location of Port A bsr delay clr port_a ;clear PortA bsr delay bra loop Continued next slide

  3. MODIFIED simple2.asm **************************************************************** * delay loop subroutine **************************************************************** delay: ldy #h_sec ;delay loop (about 1/2 second) dloop: dey iny ;extra iny,dey add delay time dey bne dloop rts **************************************************************** org $fffe ;define the reset vector to point to start of program fdb begin ;begin is the start of the program

  4. Lab Preparation A: – simp3v2.asm • Examine simp2v2.asm to determine how the LEDs are being controlled in the loop. • Determine the changes needed to modify the program, so that all three Port A pins (4,5,6) will be toggled at the same time. In the lab portion, you will wire your 68HC11 to three LEDs to show that status of Port A bits 4,5,6. • Explain in your lab notebook, the changes needed and why, and what specific lines of code must be modified, and what the changed code will look like. [you do not need to hand copy the entire program into the lab notebook, you can work from a printout of simple2.asm] • During the lab, you will edit and modify a copy of simp2v2.asm to create simp3v2.asm. You will assemble simp3v2.asm and download it into the MicroStamp board, for execution and testing.

  5. Lab Preparation B: – simple4.asm • Examine simp2v2.asm to determine how the LEDs are being controlled in the loop. • Determine the changes needed to modify the program, so that Port A pins 6 and 4 will be toggled at the same time but show the opposite. That is, when 6 is on, 4 is off, and when 4 is on, 6 is off. • Explain in your lab notebook, the changes needed and why, and what specific lines of code must be modified, and what the changed code will look like. [you do not need to hand copy the entire program into the lab notebook, you can work from a printout of simple2.asm] • During the lab, you will edit and modify a copy of simp2v2.asm to create simp4v2.asm. You will assemble simp4v2.asm and download it into the MicroStamp board, for execution and testing.

  6. Part C: Wednesday’s Lab Record in your lab notebook, your observations for each of the following steps. • Wire the 68HC11 as we did in the last lab, with power and ground, and LEDs connected to Port A bits 4,5,6. • Verify correct operation by running the demo program as we did in the last lab. • Download the simp2v2.s19 program as is, to verify correct operation. • Edit, assemble, download, and test your simp3v2.s19 program, and verify correct operation. • Edit, assemble, download, and test your simp4v2.s19 program, and verify correct operation. • You will need to save each program on your floppy diskette, and print out a listing of each program, which you will insert into your lab notebook.

More Related