The Serial Peripheral Interface (SPI) Chapter 8 CML9S12-DP256.

Slides:



Advertisements
Similar presentations
Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.
Advertisements

Input/Output (I/O) Ports and Interfacing
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
ECE 371 Unit 13 - Part 1 Serial Peripheral Interface (SPI)
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Calculator 9S12DP256 Lab 2. \ Convert counted string at addr1 to double number ud2 \ ud1 normally zero to begin with \ addr2 points to first invalid character.
HD44780 LCD programming From the Hardware Side Design and implementation details on the way to a valid SPI-LCD interface driver.
Timers Chapter 10 9S12DP256. Timers The 9S12DP256 Programmable Timer Output Compares Pulse Train Using Interrupts Input Capture Measuring the Period of.
The Serial Peripheral Interface (SPI) Chapter 8. SPI Operation of the SPI Keypad Interfacing with Shift Registers 4-Digit Seven-Segment Display.
Spring EE 316 Computer Engineering Junior Lab LCD modules, PROMs, Serial Ports.
Analog-to-Digital Converter Chapter 9 MC9S12DP256.
Digilab DIO2 LCD Module F5.1. DIO2 circuit board block diagram.
Serial Peripheral Interface (SPI)
OUTLINE WHAT ? HOW ? WHY ? BLUEPOST Poster and Message Content Specified by the User Displaying the Poster Content on a Monitor Sending Messages to.
The Serial Communication Interface (SCI) MC9S12-DP256 Chapter 11.
LCD Display DIO2 Board CPLD. DIO2 Board CPLD Interface LCD Display.
The Serial Peripheral Interface (SPI)
Eejit’s guide to using a LCD alphanumeric display with the CCS C compiler 1.Hardware connection 2.The LCD.C include file 3.An example.
Serial Communications Standards (Partly Excerpted from Simpl Primer) Cabling Configuration Protocol.
16x2 LCD Module on DE2-115 數位電路實驗 TA: 吳柏辰 Author: Trumen.
SPI Compatible Devices Design and implementation details on the way to a valid SPI-LCD interface driver.
Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.
Digital Outputs LCD Display
HD44780 LCD programming From the Hardware Side
LCD Interfacing.
CS-280 Dr. Mark L. Hornick 1 Programming for the LCD Display.
EE 316 Computer Engineering Junior Lab Serial Ports, LCD Displays & PROMs.
Parallel Interfacing Chapter 7. Parallel Interfacing Parallel I/O Ports Using Parallel Ports Seven-Segment Displays Keypad Interfacing Liquid Crystal.
Example 12 Pulse-Width Modulation (PWM): Motors and Servos Lecture L8.1.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
Chapter 10 Glass Bliss Using the Parallel Master Port to communicate with Alphanumeric LCD displays.
OCRP RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
HCS12 Technical Training, Rev 2.0 Module 7- SCI, Slide 1 MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other.
The Serial Communication Interface (SCI) MC9S12-C32
Jump, Loop, and Call Instructions
Revised: Aug 1, ECE263 Embedded System Design Lessons 27, 28 Serial Peripheral Interface.
Programming Microcontrollers in C Lecture L7.1. C Data Types TypeSizeRange char1 byte-128 – 127 unsigned char1 byte0 – 255 Int2 bytes – unsigned.
Department of Electronic & Electrical Engineering LCD character display (parallel interface). How to interface a LCD character display to a PIC.
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Embedded Systems February 10, Serial Interface - SPI  Serial Peripheral Interface  Synchronous communications  Clock supplied by the Master.
Vishwakarma government engineering college Prepare by. Hardik Jolapara( ) LCD Interfacing with ATmega16.
A.D.Patel institute of technology Sub : LCD and Keyboard interfacing with AVR. prepared by, chokshi abhi p ( ) Guided by, Prof. Asif Thakor.
Sitarambhai Naranjibhai Patel Institute of Technology and Research Centre, Umrakh, Bardoli. A Presentation On “ 16x2 LCD Interfacing with AVR atmega32.
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
LCD Interfacing using Atmega 32
TOPIC: INTERFACING OF 7-SEGMENT USING SPI PROTOCOL
LCD and Keyboard Interfacing
UNIVERSAL COLLEGE OF ENGINEERING & TECHNOLOGY
DIGITAL CALCULATOR USING 8051
Interfacing of LCD with µP
SERIAL PORT PROGRAMMING
Atmega32 Serial Programming Basics
SPI Compatible Devices
LCD and Keyboard Interfacing
SPI Protocol and DAC Interfacing
LCD and Keyboard Interfacing
Serial Communication Interface
SPI Compatible Devices
Example 13 The Serial Peripheral Interface (SPI)
Example 7 Liquid Crystal Display
LCD and Keyboard Interfacing
SPI Compatible Devices
HD44780 LCD programming From the Hardware Side
HD44780 LCD programming From the Hardware Side
LCD and Keyboard Interfacing
DIO2 Board Projects.
LCD (LIQUID CRISTAL DISPLAY) SCREENS
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
PIC Serial Port Interfacing
PIC Serial Port Interfacing
Presentation transcript:

The Serial Peripheral Interface (SPI) Chapter 8 CML9S12-DP256

PIM_9DP256 Block Diagram

Liquid Crystal Display

Relationship between RS, R/W, and E

CLM912-DP256 LCD PORT 4-bit SPI Interface Write only

File: SPI0.WHP \Serial Peripheral Interface SPI0 HEX 00D8CONSTANT SPI0CR1 \ SPI Control Register 1 00D9CONSTANT SPI0CR2 \ SPI Control Register 1 00DACONSTANT SPI0BR \ SPI Baud Rate Register 00DBCONSTANT SPI0SR \ SPI Status Register 00DDCONSTANT SP0DR \ SPI Data Register : SPI.INIT ( -- ) \ Initialize SPI port 10 SPI0CR2 C! \ enable /SS 00 SPI0BR C! \ 4 MHz (/2) 52 SPI0CR1 C! ; \ CPHA = 0, CPO; = 0 : ?SPI.DONE ( -- f ) \ Is SPI data sent? 7 SPI0SR ?HI ; : SEND.SPI ( c -- ) SP0DR C! \ send char BEGIN ?SPI.DONE \ wait till sent UNTIL SP0DR DROP ; \ clear SPIF

\ LCD for Axiom CML9S12-DP256 load hex2asc.whp load string.whp load spi0.whp DECIMAL : 10ms.delay ( -- ) 7267 FOR NEXT ; : 20ms.delay( -- ) 10ms.delay 10ms.delay ; : 50ms.delay ( -- ) 5 FOR 10ms.delay NEXT ;

HEX \ Write 4-bit instruction : >instr4 ( n -- ) 0F AND DUP send.spi\ EN LO, RS LO DUP 80 OR\ EN HI send.spi send.spi ;\ EN LO \ Write 8-bit instruction : >instr8( n -- ) DUP 4 RSHIFT >instr4 >instr4 ; \ Write 4-bit data : >data4 ( c -- ) 0F AND DUP 40 OR send.spi\ EN LO, RS HI DUP C0 OR send.spi\ EN HI 40 OR send.spi ;\ EN LO \ Write 8-bit data : >data8( n -- ) DUP 4 RSHIFT >data4 >data4 ;

\ Initialize 4-bit wide : lcd.init ( -- ) 50ms.delay 3 >instr4 \ function set 50ms.delay 3 >instr4 \ function set 50ms.delay 3 >instr4 \ function set 50ms.delay 2 >instr4 \ function set 50ms.delay 2C >instr8\ 4-bits, 2 lines 10ms.delay 06 >instr8\ inc cursor 10ms.delay 0f >instr8 \ display on 10ms.delay 01 >instr8 \ clear display 20ms.delay 80 >instr8 \ set addr to 0 10ms.delay 0 send.spi \ turn off all signals 0A BASE ! ; \ decimal default

: clear.lcd ( -- ) 1 >instr8 10ms.delay ; : hex>lcd ( hex -- ) HEX2ASC >data8 ; : type.lcd ( addr len -- ) ?DUP IF 0 DO DUP >data8 10ms.delay 1+ LOOP THEN DROP ; :.lcd ( n -- ) (.) type.lcd ; : u.lcd ( u -- ) (u.) type.lcd ; DECIMAL