{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

aLec02_texas - Introduction to Embedded Microcomputer...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Embedded Microcomputer Systems Lecture 2.1 Jonathan W. Valvano Recap Embedded system Microcontroller Data Flow graph Overview 9S12 programming TExaS simulator Top down design Introduction to 9S12 programming Registers Control unit ALU Bus interface unit Processor I/O Ports Microcontroller Electrical, mechanical, chemical, or optical devices Embedded system RAM ROM Address/data bus ADC Analog signals 9S12 DAC Register A, 8-bit number from 0 to 255 Z-bit, 0 means result not zero, 1 means result is zero $0240 is Port T, input/output port $0242 is the direction register for PortT (0=in, 1=out) $2000 to $3FFF is RAM, volatile, variables (DG128) $4000 to $FFFF is EEPROM, nonvolatile, program (DG128) ;template org $4000 main stop org $FFFE fdb main Short list of instructions to get started ldaa #10 ;make A=10 ldaa $2000 ;A=contents of memory staa $2000 ;store contents of A into mem deca ;A=A-1 lsra ;A=A/2 (shift right) lsla ;A=A*2 (shift left) adda #10 ;A=A+10 anda #$02 ;A=A&2 (logic and) eora #$08 ;A=A^8 (exclusive or) oraa #$03 ;A=A|3 (logic or) bra loop ;always jump to loop bne loop ;jump to loop if not zero beq loop ;jump to loop if zero stop
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon