Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.

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.
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
8086.  The 8086 is Intel’s first 16-bit microprocessor  The 8086 can run at different clock speeds  Standard 8086 – 5 MHz  –10 MHz 
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
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.
Assignment Overview Thermal oscillator One of the ENCM415 Laboratory 2 items Oscillator out GND +5V.
6/2/2015 Labs in ENCM415. Laboratory 2 PF control, Copyright M. Smith, ECE, University of Calgary, Canada 1 Temperature Sensor Laboratory 2 Part 2 – Developing.
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.
Over-view of Lab. 1 For more details – see the Lab. 1 web-site There will be a 20 min prelab quiz (based on Assignment 1 and 2) at the start of the lab.
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.
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.
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
NS Training Hardware. Memory Interface Support for SDRAM, asynchronous SRAM, ROM, asynchronous flash and Micron synchronous flash Support for 8,
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Tutorial Essentially all the Blackfin instruction you need for all of ENCM511. The instructions are easy. Its knowing when to use them that is the difficult.
HD44780 LCD programming From the Hardware Side
COMP201 Computer Systems Exceptions and Interrupts.
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.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
MICROPROCESSOR INPUT/OUTPUT
By, Prof. Tambe S. S. S.N.D. College of Engineering and Research Center Department of Electrical Engineering.
Blackfin Array Handling Part 2 Moving an array between locations int * MoveASM( int foo[ ], int fee[ ], int N);
Microcomputers Final Project.  Camera surveillance is an important aspect of Robotics.  Autonomous robots require the use of servos for camera control.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
Lab. 1 – Required Tasks. For more details – see the Lab. 1 web-site.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Over-view of Lab. 1 See the Lab. 1 web-site and the lecture notes for more details.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
Building a simple loop using Blackfin assembly code If you can handle the while-loop correctly in assembly code on any processor, then most of the other.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Lab. 1 – GPIO Pin control Using information ENEL353 and ENCM369 text books combined with Blackfin DATA manual.
Assembly Language Review Being able to repeat on the Blackfin the things we were able to do on the MIPS 2/26/2016 Review of 50% OF ENCM369 in 50 minutes1.
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.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
“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,
Over-view of Lab. 1 See the Lab. 1 web-site and latter lecture notes for more details.
ARM Embedded Programming Lecture 4 Accessing Memory Mapped Registers.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
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.
Tutorial Essentially all the Blackfin instruction you need for all of ENCM511. The instructions are easy. Its knowing when to use them that is the difficult.
Hardware Source: ttp:// under
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Assembly Language Review
Moving Arrays -- 2 Completion of ideas needed for a general and complete program Final concepts needed for Final DMA.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Assembly Language Review
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
HD44780 LCD programming From the Hardware Side
Tutorial Essentially all the Blackfin instruction you need for all of ENCM511. The instructions are easy. Its knowing when to use them that is the difficult.
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.
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Blackfin BF533 EZ-KIT Control The O in I/O
Building a simple loop using Blackfin assembly code
Presentation transcript:

Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2

Blackfin BF533 I/O2 Agenda Processors need to send out control signals (high / low 1 / 0 true / false) –General purpose input / output GPIO on processor chip (16) –FLASH memory chip has additional I/O ports connected to Ez-Lite KIT LED’s Making the FLASH memory I/O port control the Ez-KIT LED’s The new Blackfin assembly language instructions needed

Blackfin BF533 I/O3 Blackfin I/O pins -- REVIEW

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

Blackfin BF533 I/O5 LEDs connected to memory port BACK FORWARD RIGHT LEFT ??? CONTROL ON Might be connected to other things DON’T CHANGE BEHAVIOUR

Blackfin BF533 I/O6 Activating LEDs -- REVIEW Get the FLASH to work correctly –InitFlashASM( ) Get the Port to work correctly as output for pins PB5  PB0, leaving other pins unchanged in behaviour –InitFlashPortASM( ) Write the value we want to LEDs –WriteFlashLEDASM( int value) Read back the value the LEDs show –int ReadFlashLEDASM( )

Blackfin BF533 I/O7 FLASH MEMORY UNIT -- REVIEW “EBIU” External Bus Interface Unit –How does EBIU “know” whether data is to go to FLASH or SDRAM? FLASH SDRAM

Blackfin BF533 I/O8 ANSWER -- Blackfin Memory Map If P0 (pointer register) is set to address 0x then R0 = [P0]; reads a 32-bit value from FLASH BANK 0 If R0 is 6 and P0 is 0x1000 then [P0] = R0; places a 32-bit value into SDRAM

Blackfin BF533 I/O9 FLASH registers -- REVIEW How does Blackfin “match” itself for fastest FLASH operation Depends on which FLASH is used in EZ-Lite KIT

Blackfin BF533 I/O10 Bank control register -- REVIEW Reset value will probably work “as is” but not efficient – “slow reads”

Blackfin BF533 I/O11 General Control Register -- REVIEW Reset value leaves “CLKOUT” disabled – is that important?

Blackfin BF533 I/O12 InitFlashASM( ) -- REVIEW Get the FLASH to work correctly May be “many” processes running on the Blackfin. All these processes may want to use InitFlashASM( ) InitFlashASM( ) { If FLASH memory already configured – return without initializing Else { configure Memory Bank control register THEN configure Global control (turns on the FLASH) }

Blackfin BF533 I/O13 Look in EZ-Kit documentation Recommended settings These settings are specific for FLASH memory used on the EZ-Kit Lite board Turns on clock

Blackfin BF533 I/O14 Set the Bank control register Kit documentation recommends 0x7BB0 7 cycles not not 15 B = cycles 3 cycles IGNORE 4 cycles

Blackfin BF533 I/O15 Control access speed -- REVIEW

Blackfin BF533 I/O16 Set General Control Register Documentation says set to “0xF” for this particular FLASH chip ENABLE ALL

Blackfin BF533 I/O17 Key issues -- REVIEW InitFlashASM( ) Does not sound too big a deal –Set P0 to point to EBIU_AMBCTLO –Then R0 = 0x7BB07BB0 –Then [P0] = R0 –Then make sure “write occurs” NOW as this processor can delay doing writes “until convenient” Do the same for the other “32 bit” registers

Blackfin BF533 I/O18 Build and Test Stub -- REVIEW

Blackfin BF533 I/O19 When stub is tested -- add code NEW BLACKFIN INSTRUCTION SSYNC;

Blackfin BF533 I/O20 Obvious problem – value needed EBIU_AMBCTL0 = ? Code review 2 obvious errors

Blackfin BF533 I/O21 Corrected code – still fails No “=“ in a define statement No “spaces” in number Spell check “0” not “O” DEFECTS in code process Pair programming cost 3 * $5

Blackfin BF533 I/O22 MIPS and Blackfin behave same You can’t load a 32-bit register with a 32-bit immediate value using one instruction WRONG R0 = 0x7BB07BB0; Must load low 16-bit of register R0.L = 0x7BB0; Then load high 16-bits of register R0.H = 0x7B00; You handle P0 = 0xFFC00A04

Blackfin BF533 I/O23 More readable code Self documenting code I do “define” and then cut-and-paste the label

Blackfin BF533 I/O24 InitFlashASM( ) -- Exercise InitFlashASM( ) { If FLASH memory already configured – return without initializing Else { configure Memory Bank control register THEN configure Global control (turns on the FLASH) } } instructions – many cut-and-paste-modify IF CLOCK ACTIVATED THEN ASSUME ANOTHER PROCESS HAS ALREADY SET THE FLASH “AND” on BIT 0 of EBIU_AMG CTL register followed by “IF” set then JUMP

Blackfin BF533 I/O25 WriteFlashLEDASM(long in_value) Write ‘1’ (on) or ‘0’ (off) to the Port to activate LEDs connected to pins PB5  PB0, leaving other pins unchanged.

Blackfin BF533 I/O26 WriteFlashLEDASM(long in_value) –Read “LED data register” into processor data register (makes a copy) –Keep “top” 2 bits (AND operation) of copy –Keep “bottom” 6 bits of “in-par” 32-bit in_value –OR the two processor data registers –Write “modified copy” back into “LED data register” PROBLEM “byte” read and writes

Blackfin BF533 I/O27 Standard ENCM369 problem using different syntax Start with the stub and pseudo-code Typo bottom6bitmask

Blackfin BF533 I/O28 Now identify the registers to use In_par is in R0 We can use R1, R2 and R3 without saving Typo bottom6bitmask

Blackfin BF533 I/O29 Add in the code we understand Fixed typo Still another syntax problem

Blackfin BF533 I/O30 8 bit and 32 bit writes [P0] = R0; 32-bit write (4 bytes) –Places all 32-bits of processor data register into “long word” (32 bit) address starting at memory location P0 –If P0 = 0x1000 – then place “32-bit” value at memory location 0x1000 B[P0] = R0; 8-bit write –Places “bottom” 8-bits of processor data register into “byte” (8 bit) address starting at memory location P0

Blackfin BF533 I/O31 8 bit and 32 bit reads R0 = [P0]; 32-bit read (4 bytes) –Places all 32-bits of “long word” (32 bit) address starting at memory location P0 into processor data register –If P0 = 0x1000 – then place “32-bit” value at memory location 0x1000 R0 = B[P0] (Z); 8-bit read –Places “byte” (8 bit) address starting at memory location P0 into “bottom” 8-bits of processor data register and puts “0” into the “top” 24 bits of register –Must convert “8-bit” read operation into a “32” bit “store in register” operation

Blackfin BF533 I/O32 Add byte read and write operations Is this correct for keeping top 2 bits of an 8-bit value? “DEFECT” if not corrected Still syntax problems ”ERRORS” Fix as exercise

Blackfin BF533 I/O33 InitFlashPortASM() to complete Set direction to 1 on lower pins leaving other direction values unchanged –Read “direction” byte register into processor data register (makes a copy) –Set another processor data register to 0x3F –OR the two data registers (HOW?) –Write “modified copy” back into “direction byte register”

Blackfin BF533 I/O34 Agenda Processors need to send out control signals (high / low 1 / 0 true / false) –General purpose input / output GPIO on processor chip (16) –FLASH memory chip has additional I/O ports connected to Ez-Lite KIT LED’s Making the FLASH memory I/O port control the Ez-KIT LED’s The new Blackfin assembly language instructions needed