Getting the O in I/O to work on a typical microcontroller Activating a FLASH memory “output line” Part 1 Main part of Laboratory 1 Also needed for “voice.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

Getting the O in I/O to work on a typical microcontroller Activating a FLASH memory “output line” Part 1 Main part of Laboratory 1 Also needed for “voice.
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Processor System Architecture
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Microcomputer Systems 1
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 3 – New instruction recap Tutorial.
Boot Issues Processor comparison TigerSHARC multi-processor system Blackfin single-core.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
HD44780 LCD programming From the Hardware Side Design and implementation details on the way to a valid SPI-LCD interface driver.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Getting the O in I/O to work on a typical microcontroller Ideas of how to send output signals to the radio controlled car. The theory behind the LED controller.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
Just enough information to program a Blackfin Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment.
Blackfin BF533 EZ-KIT Control The O in I/O
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Parallel Ports of PC Methods of interfacing Examples.
HD44780 LCD programming From the Hardware Side
Peripherals and their Control An overview of industrially available “peripheral devices” that use “pulse-width modulation” for information passing. Review.
Input Laboratory: GPIO Pin control needed to have the Blackfin accept your commands Re-uses information from ENEL353 and ENCM369 courses and text books.
Assembly Language Review Being able to repeat on the Blackfin the things we were able to do on the MIPS 9/19/2015 Review of 50% OF ENCM369 in 50 minutes1.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
3-1 Digital I/O A group of I/O pins is called a PORT  A port is where data enters/leaves the system. Digital I/O pins are usually grouped into 8,16 or.
MICROPROCESSOR INPUT/OUTPUT
By, Prof. Tambe S. S. S.N.D. College of Engineering and Research Center Department of Electrical Engineering.
Over-view of Lab. 1 See the Lab. 1 web-site and later lecture notes for more details.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 2.
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Lab. 1 – Required Tasks. For more details – see the Lab. 1 web-site.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Over-view of Lab. 1 See the Lab. 1 web-site and the lecture notes for more details.
Multi-threaded projects Services and Drivers Alternate ways of doing Labs 1, 2, 3 and 4.
Handling multiple input signals Version #2 – co-operative scheduler Version #3 – pre-emptive scheduler.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
بسم الله الرحمن الرحيم MEMORY AND I/O.
CSIT 301 (Blum)1 Instructions at the Lowest Level Some of this material can be found in Chapter 3 of Computer Architecture (Carter)
Lab. 1 – GPIO Pin control Using information ENEL353 and ENCM369 text books combined with Blackfin DATA manual.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Assembly Language Review Being able to repeat on the Blackfin the things we were able to do on the MIPS 3/3/2016 Review of 50% OF ENCM369 in 50 minutes1.
“Lab. 5” – Updating Lab. 3 to use DMA Test we understand DMA by using some simple memory to memory DMA Make life more interesting, since hardware is involved,
Copyright © 2005 – Curt Hill MicroProgramming Programming at a different level.
Over-view of Lab. 1 See the Lab. 1 web-site and latter lecture notes for more details.
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
CPU Lesson 2.
Microprocessor or Microcontroller
See the Lab. 1 web-site and later lecture notes for more details
Introduction of microprocessor
Microcomputer Systems 1
Number Representations and Basic Processor Architecture
TigerSHARC processor and evaluation board
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Assembly Language Review
Moving Arrays -- 2 Completion of ideas needed for a general and complete program Final concepts needed for Final DMA.
Lab. 4 – Part 1 Demonstrating and understanding multi-processor boot
Assembly Language Review
See the Lab. 1 web-site and later lecture notes for more details
Moving Arrays -- 2 Completion of ideas needed for a general and complete program Final concepts needed for Final DMA.
HD44780 LCD programming From the Hardware Side
HD44780 LCD programming From the Hardware Side
Explaining issues with DCremoval( )
Lab. 1 – GPIO Pin control Using information ENEL353 and ENCM369 text books combined with Blackfin DATA manual.
Input Laboratory: GPIO Pin control needed to have the Blackfin accept your commands Re-uses information from ENEL353 and ENCM369 courses and text books.
Blackfin BF533 EZ-KIT Control The O in I/O
Presentation transcript:

Getting the O in I/O to work on a typical microcontroller Activating a FLASH memory “output line” Part 1 Main part of Laboratory 1 Also needed for “voice activated car control project”

Agenda Processors need to send out control signals (high / low 1 / 0 true / false) –General purpose input / output lines (GPIO lines) on Blackfin chip (16) –FLASH memory chip has additional I/O ports connected to Ez-Lite KIT LED’s What do we need to have happen to make the FLASH memory work on a microcontroller as we want. (In this example turning the board LED’s on and off) What new Blackfin assembly language instructions do we need to learn in order to operate the LEDs? Blackfin BF533 I/O2

Radio controlled car In principle we could Connect LED1 output up to turn right signal line of radio transmitter Connect LED2 up to go forward signal line of radio transmitter Connect LED up to turn left signal line of radio transmitter “IN PRINCIPLE” means – we might start off this way while we initially explore ideas to control the car. However we may (or may not) finish the project a different way. Blackfin BF533 I/O3

Programmable Flags Most micro-controllers have general purpose input or output lines capable of generating “true” or “false” values Blackfin 533 has 16 GPIO lines Blackfin BF533 I/O4

Where are the GPIO pins found? Blackfin BF533 I/O5

GPIO lines are very useful They are used to sent control signals to many of the peripherals that are found on the Blackfin Evaluation Board. –Video Control –Audio Control –Input -- Buttons – GPIO PF8, 9, 10, 11 –Output – GPIO PF0, 1, 6, 7 –SPI interface control -- PF5 –Pins are functionally multiplexed – meaning pins can perform different functions at different times. Blackfin BF533 I/O6

Additional I/O pins available Blackfin BF533 I/O7

Need to control LED on board Controlled using special “additional” parallel port interface attached to “flash” memory chip Blackfin BF533 I/O8 PROJECT USE LEDs used to indicate direction radio-controlled car will move LEFT RIGHT FORWARD BACK CONTROL ON

FLASH MEMORY UNIT Major task of this unit is to store the code need to “boot” (start) the processor Blackfin BF533 I/O9 2 PSD4256G6V From STMicroElectronics The FLASH part we need during Lab. 1 Additional I/O pins

LEDs connected to FLASH port Blackfin BF533 I/O10 BACK FORWARD RIGHT LEFT ??? CONTROL ON These pins are connected to other things on the board DON’T CHANGE THEIR BEHAVIOUR WHEN YOU CODE THE LED OPERATION

Steps to activating LEDs 1.Get the FLASH memory to work correctly (set many FLASH registers) –Write the code for InitFlashASM( ) 2.Get the FLASH I/O Port to work correctly as output for pins PB5  PB0, leaving other pins unchanged –Write the code for InitFlashPortASM( ) 3.Write the value we want to LEDs –WriteFlashLEDASM( int value) 4.Read back the value the LEDs show –int ReadFlashLEDASM( ) for testing Blackfin BF533 I/O11

FLASH MEMORY UNIT Controlled through “EBIU” External Bus Interface Unit EBIU are common on most processors (although often by different name) Blackfin BF533 I/O12 FLASH SDRAM CONTROLLER

Key information about EBIU Three busses come into the EBIU from the Blackfin processor core Forwards data to SDRAM and FLASH –How does EBIU “know” whether data has to be send to FLASH unit (I/O)and which data to the SDRAM units (memory store)????? Blackfin BF533 I/O13

SDRAM and FLASH In later laboratories –we will build a stand-alone microcontroller system, which means we will need to understand how to program the flash memory so that the processor “knows” what to do when powered-up. Common practice on processors for boot process reads start up code from FLASH –we will need to process “large arrays” – too large to fit into the “internal fast” Blackfin “L1” memory so they must be placed in SDRAM. Common practice on processors In this laboratory, we need to program the “extra” FLASH chip I/O pins which are connected to the LED’s – control the lights now, control car later. Blackfin BF533 I/O14

What we know When the processor powers up – it must read its “boot” program from the FLASH memory The processor does not know what sort of FLASH it will be connected to When processor powers up, it will “assume” that it is connected to “slowest FLASH” in existence. (common practice) The first part of the program the processor reads in (boot code) can change the processor to read FLASH more efficiently (faster). Blackfin BF533 I/O15

Controlling FLASH operation Blackfin BF533 I/O16 What we need to worry about It is common for most microcontroller peripherals to have a “GLOBAL” control register and one or more “specific” control registers

InitFlashASM( ) Get the FLASH memory to work correctly May be “many” processes (threads) running on the Blackfin evaluation board (e.g. Audio). All these processes (threads) may want to use the flash memory for other purposes – meaning InitFlashASM( ) may have already been called by another thread before your code uses it (or perhaps your code is run more than once) InitFlashASM( ) { /* Concept only */ If FLASH memory already configured – return without changing the initialization Else { configure Memory Bank control register THEN configure Global control (turns on the FLASH) } Blackfin BF533 I/O17

Set the Bank control register Reset value – the way the processor powers up Will probably work “as is” but not efficient – “slow reads” by default (common practice for hardware) Blackfin BF533 I/O18 Default Slow (15 cycles for each read and write operation)

Memory control access speed Blackfin BF533 I/O19 DEFAULT Processor sends out address and waits 15 cycles before sending a “do a read operation” command to memory. The processor waits another 15 cycles before the actual read occurs.

Set General Control Register Reset value (power up state) leaves “CLKOUT” disabled – is that important? Blackfin BF533 I/O20 What parts of the operation of this register must we “know” Unanswered at this time. We don’t know what needs to be known

InitFlashPortASM( ) Get the Port to work correctly as output for pins PB5  PB0, leaving other pin behaviour (6 and 7) unchanged. Documentation says the “Flash Direction” register allows you to choose whether the pin works as an “in” pin or works as an “out” pin (common practice) Blackfin BF533 I/O21

InitFlashPortASM( ) Get the Port to work correctly as output for pins PB5  PB0, leaving other pins unchanged. (Set as “Output” to control the lights) Blackfin BF533 I/O22 Used during Write and Read operations Leftmost LED 5 LED 4 LED 3 LED 2 LED1 LED0 Name of part Write 1 to turn on, 0 for off

Key issues -- InitFlashPortASM() Set direction to 1 (output) on lower 6 pins leaving other direction values unchanged NEED TO REVIEW ENCM369 – OR assembly code instruction needed – 8 bit values (byte) –Read EBIU “direction” register into processor core data register (makes a copy) (HOW?) –Set another processor data register to 0x3F ( ). Need to know basic binary and hexadecimal patterns for common numbers – decimal confusing when used to show “on” and “off” values – no calculators allowed in exams and quizzes –OR the two data registers (HOW?) –Write “modified copy” back into “direction register” (HOW?) PROBLEM to overcome – how do we do “byte” read and writes to Blackfin memory using “C++”? Blackfin BF533 I/O23

WriteFlashLEDASM( ) Write ‘1’ (on) or ‘0’ (off) to the Port to activate LEDs connected to pins PB5  PB0, leaving other pins on that port unchanged in value. (common practice) Blackfin BF533 I/O24 Leftmost LED 5 LED 4 LED 3 LED 2 LED1 LED0

Key issues WriteFlashLEDASM( in_value) Write ‘1’ (on) or ‘0’ (off) to the Port to activate LEDs connected to pins PB5  PB0, leaving other pins unchanged. HOW TO DO THIS OPERATION 1.Read 8-bit byte “LED data register” into 32-bit processor data register (makes a copy in R1) 2.Keep “top” 2 bits (AND operation) of copied value (8 bit) in 32-bit register 3.Keep “bottom” 6 bits of “in-par” 32-bit in_value (R0) that is passed into the subroutine 4.OR the two processor data registers (R0, R1 5.Write “modified 32-bit copy” back into “LED data register” – 8-bit byte operation needed PROBLEM mixing “byte (8)” and “long word (32)” operations Blackfin BF533 I/O25

Things we need to learn How do we put a 32-bit value (long int) into a register (data Rn or pointer Pn)? How do we put an 8 or 32-bit value into memory? How do we handle byte operations (8-bit)? How do we do AND and OR operations on Blackfin? How similar is Blackfin to MIPS when handling these issues (ENCM369)? Meaning can we use ENCM369 ideas with the Blackfin? Blackfin BF533 I/O26

Agenda tackled Processors need to send out control signals –General purpose input / output GPIO on processor Not enough GPIO lines –FLASH memory chip has additional I/O ports connected to Ez-Lite KIT LED’s What do we need to have happen to make the FLASH memory work as we want? What new Blackfin assembly language instructions do we need to learn? Blackfin BF533 I/O27