H. Huang Transparency No.7-1The 68HC12 MicrocontrollerChapter 7Parallel Input/Output
H. Huang Transparency No.7-10The 68HC12 MicrocontrollerSynchronizing Interface Chip and I/O DevicesHandshake method - used when timing is crucial- Two
H. Huang Transparency No.7-11The 68HC12 MicrocontrollerOverview of 68HC12 Parallel Ports (Figure 1-1 Manual)EEPROMRAMEEPROMCPU12A/D ConverterTimer &am
H. Huang Transparency No.7-12The 68HC12 MicrocontrollerNotice : Most of the ports have two registersData Register Address by which data is exchanged w
H. Huang Transparency No.7-13The 68HC12 MicrocontrollerHC12 can operate in one of 8 Operation ModesNormal OperationModes: Some registers protected aga
H. Huang Transparency No.7-14The 68HC12 MicrocontrollerHC12 Port Overview Port A and Port B (PORTA, DDRA and PORTB, DDRB)- Single chip mode: General p
H. Huang Transparency No.7-15The 68HC12 MicrocontrollerHC12 Port Overview Port E (PEAR and DDRE)- General purpose I/O; or …- Expanded mode: bus contro
H. Huang Transparency No.7-16The 68HC12 MicrocontrollerPort T (PORTT and DDRT)- Timer functions: input capture, output compare, pulse accumulator (PT7
H. Huang Transparency No.7-17The 68HC12 MicrocontrollerExample from the Axiom Project Board: There are four LEDs(LED1 … LED4) connected via Port K.74H
H. Huang Transparency No.7-18The 68HC12 Microcontrollerorg $4000DDRK equ $33 ; Port K’s Data Direction RegisterPORTK equ $32 ; Port K’s Data Register;
H. Huang Transparency No.7-19The 68HC12 MicrocontrollerWhere do we find out what the Port Addresses are ?Manufacturer assigns the register block.•Exam
H. Huang Transparency No.7-2The 68HC12 MicrocontrollerBasic Concepts of I/O- I/O devices (peripheral devices): equipment that exchange data with compu
H. Huang Transparency No.7-20The 68HC12 MicrocontrollerAxiom CML12S MCU with the Axiom Project BoardAxiom CML12S-DP256Development BoardMCUAxiom Projec
H. Huang Transparency No.7-21The 68HC12 MicrocontrollerPort Expansion on the Axiom Project Board•Port K dedicated: LEDs, buzzer and relay• Port P and
H. Huang Transparency No.7-22The 68HC12 MicrocontrollerAxiom CML12S-DP256Development BoardPort Expansion on the Axiom Project Board• A high level view
H. Huang Transparency No.7-23The 68HC12 MicrocontrollerDriving the Single Seven-Segment Display- The segment patterns for 0 to 9 are shown in Table 7.
H. Huang Transparency No.7-24The 68HC12 Microcontroller#include “DP256reg.asm”org $4000bset PTM,#$08 ; Load data into U7 set U7_EN high (PM3) movb
H. Huang Transparency No.7-25The 68HC12 MicrocontrollerInterfacing the 68HC12 to a Keypad- 16-key (4 rows * 4 columns) keypad interfaced to two 4-bit
H. Huang Transparency No.7-26The 68HC12 MicrocontrollerKeypad on the Axiom Project Board7-segmentdisplayLEOE74HC573Q3-Q0D7-D0Axiom CML12S-DP256Develop
H. Huang Transparency No.7-27The 68HC12 MicrocontrollerExample Write an assembly subroutine that waits for the ‘1’ key to be hit.Solution1. Disable SP
H. Huang Transparency No.7-28The 68HC12 Microcontroller#include "DP256reg.asm"org $4000clr SPI1CR1 ; Turn off SPIbset DDRP,#$0F ; set P0-3
H. Huang Transparency No.7-33The 68HC12 MicrocontrollerInterfacing to a Keyboard- Switches can be mechanical, membrane, capacitors, or Hall-effect.-Me
H. Huang Transparency No.7-3The 68HC12 MicrocontrollerInterface (peripheral) chipsFunction: synchronize data transfer between CPU & I/O devicesInt
H. Huang Transparency No.7-34The 68HC12 MicrocontrollerSoftware Debouncing Technique• Program must debounce !• When polling, program must filter oscil
H. Huang Transparency No.7-35The 68HC12 MicrocontrollerSoftware Debouncing Technique : The Adaptive Approachpoll switch until first change is seenloop
H. Huang Transparency No.7-36The 68HC12 MicrocontrollerLiquid Crystal Displays (LCDs)- Most common type: allows light to pass through when activated.
H. Huang Transparency No.7-37The 68HC12 MicrocontrollerThe Axiom Project Board’s LCD- Display capability: 2 lines x 16 characters.- DMC series LCD dis
H. Huang Transparency No.7-38The 68HC12 MicrocontrollerLCD Ports on the Axiom Project Board LCDRWRSEND0D1…D7LEOE74HC573Q4-Q7D7-D0Axiom CML12S-DP256Dev
H. Huang Transparency No.7-39The 68HC12 MicrocontrollerLCD Control Signals (Programmer’s Model)(We already know how to enable the appropriate latch )1
H. Huang Transparency No.7-40The 68HC12 MicrocontrollerLCD Control Signals : What about the EN line ? The Timing Diagram for a LCD Write OperationLCD
H. Huang Transparency No.7-41The 68HC12 MicrocontrollerLCD Instructions- Major instructions are summarized below. Full details are in Table 7.5 in te
H. Huang Transparency No.7-42The 68HC12 MicrocontrollerOutput Data on the Axiom LCD Kit- We can display two rows of data. Each row: 16 characters.- Po
H. Huang Transparency No.7-43The 68HC12 MicrocontrollerExample : Program to Output Characters to the LCD (LCDeg.asm)- Output a character to the upper-
H. Huang Transparency No.7-4The 68HC12 MicrocontrollerProgrammer’s Model of Interface (peripheral) chips- Interface consist of: control registers, sta
H. Huang Transparency No.7-44The 68HC12 MicrocontrollerLCD Setup (Initialization) Reference : LCD_spec.pdf1. Function Set : To Set interface to be 4
H. Huang Transparency No.7-45The 68HC12 MicrocontrollerExample : LCD Program (basicLCD.asm)LCD_RW equ $02 ; LCD RW select (PT1)LCD_RS
H. Huang Transparency No.7-46The 68HC12 MicrocontrollerExample : LCD Program (basicLCD.asm)Lcd2PP_Init:bclr PTT,LCD_RW+LCD_RS+LCD_EN ; RW=0, RS=0 (In
H. Huang Transparency No.7-47The 68HC12 MicrocontrollerExample : LCD Program (basicLCD.asm – Lcd2PP_Init continued )ldaa #$01 ; 4. Clear displayjsr LD
H. Huang Transparency No.7-48The 68HC12 MicrocontrollerLCD2PP_4: ; Writes a nibble to LCD. Destroys a and bbset PTS,#U21_EN ; Set U21_EN high (latch b
H. Huang Transparency No.7-49The 68HC12 MicrocontrollerExample : LCD Program (basicLCD.asm); Write a byte to the LCD Data RegisterLCD2PP_Data:bset PTT
H. Huang Transparency No.7-50The 68HC12 MicrocontrollerExample : LCD Program (basicLCD.asm); Write a byte (in Acc A ) to the LCD, upper 4 bits first
H. Huang Transparency No.7-5The 68HC12 MicrocontrollerI/O Address : Uniquely identifies each port of an interface chip • Motorola HC12: Memory-Mapped
H. Huang Transparency No.7-6The 68HC12 MicrocontrollerI/O Transfer SynchronizationThe role of an interface chip1.Synchronizing data transfer between C
H. Huang Transparency No.7-7The 68HC12 MicrocontrollerSynchronizing Microprocessor and Interface ChipPollingMicroprocessor checks a status bit (interf
H. Huang Transparency No.7-8The 68HC12 MicrocontrollerSynchronizing Interface Chip and the I/O DevicesBrute-force method -- useful when the data timin
H. Huang Transparency No.7-9The 68HC12 MicrocontrollerSynchronizing the Interface Chip and the I/O DevicesStrobe method - strobe signal indicates data
Commentaires sur ces manuels