1 / 17

UEE072HM

UEE072HM. Embedded and Real-Time Systems. We will mainly look at embedded systems Systems which have the computer system embedded within their application area, normally using a specialised single board computer (SBC)

slade
Download Presentation

UEE072HM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UEE072HM

  2. Embedded and Real-Time Systems • We will mainly look at embedded systems • Systems which have the computer system embedded within their application area, normally using a specialised single board computer (SBC) • There is a difference between embedded and real-time – one does not imply the other • Hard real-time vs soft real-time

  3. Embedded Systems Development • Embedded systems require host-target development – this means • The development is done on a different machine than the target • The code must be downloaded to run • Can be running on different CPU and architecture

  4. Embedded Systems Development • Embedded systems development requires • Mixed language programming – HLL plus assembler • Increased knowledge of tools – compiler, linker and librarians • Use of specialised tools – i.e. down loaders • Special skills to debug code

  5. Using C for Embedded Systems #define ADDRESS 0xFFFF41 main() { char *mem_p; mem_p=(char*)ADDRESS; while !(*mem_p ) ;// do nothing } • A major requirement is for direct memory access, this is achieved using pointers. • This style of code is quite common

  6. Using C for Embedded Systems #define ADDRESS 0xFFFF41 #define MASK 0x3 main() { volatile char *mem_p; mem_p=(char*)ADDRESS; while !(*mem_p & MASK ) ;// do nothing } • Note • Use of # define • Use of char * • Use of volatile • Casting of return value • Use of binary op &

  7. Using C for Embedded Systems • Using C in Embedded Systems you will need to know more about • Compilation process • Linking • Storage issues

  8. Using C for Embedded Systems • Compilation issues • Passing parameters • Naming conventions • Symbol table and map generation • Assembler output

  9. Using C for Embedded Systems • Why link HLL and ALP? • Speed • Special instructions • Code size

  10. Using C for Embedded Systems • Ways to link HLL & ALP - passing parameters • Parameter blocks • No recursion • Using registers • Limited numbers of registers • Using the stack • Most favoured method • Many use a combination of the above

  11. Using C for Embedded Systems • Using the stack for parameter passing, it requires • Creation of stack frame/frame pointer • Instructions to allocate/deallocate a stack frame • In 68000 • link and unlk instructions

  12. Using C for Embedded Systems • We need to understand • Program counter • Frame pointer • Stack pointer • Stack

  13. Using C for Embedded Systems • On reaching the following C instruction • gets(sr) • We will get the following 68000 code • jsr _gets()

  14. Using C for Embedded Systems • Once in gets with the following C • char * gets( chat * s) • { • int str[10]; • The following assembler will be created • _get: • link a5, #-40

  15. Using C for Embedded Systems • With the following recursive call • char * gets( chat * s) • { • int str[10]; • gets(sr);

  16. Using C for Embedded Systems • On the final } or return statement we would get the following 68000 • unlk a5

More Related