Microprocessors lesson 3 IO port, delays' - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Microprocessors lesson 3 IO port, delays'

Description:

CC5x compiler user's manual. Preparation. MPLab & C-compiler ... See CC5X user's manual. extensions and limitations. Registers are predefined variables. ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 20
Provided by: wwwhomeC
Category:

less

Transcript and Presenter's Notes

Title: Microprocessors lesson 3 IO port, delays'


1
Microprocessors
lesson 3 I/O port,
delays.
2
Topics lesson 3
  • Questions / remarks
  • Consolidation
  • Organisation
  • Logbook
  • CC5x compiler users manual
  • Preparation
  • MPLab C-compiler
  • Architecture Clock
  • PICkit1 board
  • Architecture
  • PC definition
  • Memory map
  • Presentation
  • I/O port
  • LEDs
  • PICkit1 board (hardware)
  • Lab Problem 1
  • Next week (3th hour)
  • Delays introduction

3
Device overview
Memory map
4
Program memory map
5
Memory organisationData
Memory map
6
Hardware description (LEDs)
7
Digital I/O (1)
FromReference Manuals for the mid-range MCU
Family (document 33023a)
My first problem
8
Digital I/O (2)port code snip
/example set RA4 as digital output,
low level/ void initDIO() //see data sheet for
values ANSEL ?? CMCON0 ?? void
LED0() PORTA0x3F//reset all latches
TRISA0b.1110.1111//RA4 as output
PORTA0b.0001.0000// RA 4 High
9
Design programs in C
  • See CC5X users manualextensions and limitations
  • Registers are predefined variables.PIC16Fxxx.H
    file
  • Problems with simulation

10
Presentations
  • LEDs
  • I/O ports basics

11
Lab
  • Problem 1see description

12
Self tuition for next week
  • Also see preparation lesson 4
  • Finish Problem 1
  • Logbook evaluation
  • Start Problem 2
  • Presentation about TIMER0

13
Delay introduction
  • Software
  • Using clock cycles
  • loop elements
  • Hardware
  • Timer device,
  • polling based
  • interrupt based.

14
Delay(3) Software
  • Advantage easy to program
  • Disadvantage Difficult to make a exact time
    delay
  • Disadvantage processor is busy in delay loop.

15
Delay(2) software
//code snip Simple Loop uns z z0 Action()
while (zlt1270) //1270 is an example z
//Additional dummy statements //will make
the delay longer
16
Delay(4) HardwareTimer module
  • Separate hardware module.
  • Easy to calculate.
  • Advantage processor is free during timer count.
    Clock cycles free for other activities

17
Delay (5) Hardware Timer 0
8-bit timer/counter Readable and writable
8-bit prescaler (software programmable)
Internal or external clock select Interrupt
on overflow Edge select for external clock
18
Problem 2
  • Design and implement a running light
    (LED0..LED7).
  • Software based on a loop.
  • Hardwarebased on TIMER 0

19
Logbook evaluation
Write a Comment
User Comments (0)
About PowerShow.com