Programming Embedded System in C and C - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Programming Embedded System in C and C

Description:

Programming Embedded System in C and C++ What is Embedded System? , ; ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 18
Provided by: systemCml
Category:

less

Transcript and Presenter's Notes

Title: Programming Embedded System in C and C


1
Programming Embedded System in C and C
  • What is Embedded System?
  • ????????????,???????????????????????,??????????.
  • ?? ABS,???,PS,PDA,??,???.

2
C????
  • C???
  • ????????.
  • ??????????.
  • ???????????.
  • C??? ??C???
  • ?????????????.
  • ?????????????????

3
??????????

???
???
??
??
4
Hello World too Hard
  • P2LTCH Port2 I/O Latch Register
  • ?CPU?????,?????
  • ????I/O pin?latch??.

Intel 80188EB ?????? P2LTCH0100 0000
Intel 80188EB ?????? P2LTCH0000 0000
??LED
??LED
5
???????????

C/C
C/C
??
compiler
assembler
compiler
Object code
Object code
Object code
Linker
Relocation code
???
????
6
???????????
3
Reset Reset Code (in assembly) Jmp hw_init
Startup Startup Code (in assembly) Call main
1

Hw_init Hardware Initialization (in
assembly) Jmp startup
Main() /the C/C code Start here /

2
4
7
??????

???
RAM
???
ROM
DRAM
SRAM
EPROM
Masked
Flash
NVRAM
PROM
EEPROM
8
?????
  • Data bus test
  • Address bus test
  • Chip test

9
??
  • On-chip peripheral ????????????????????.
  • External peripheral????????????

10
Device Driver?????
  • Device driver????????????????.
  • ????????????????????.
  • ?????????????????????,
  • ????????,?ISR??????????
  • ?.

11
???????????
  • ???????????????????.
  • ?????????memory-mapped peripheral?I/O mapped
    peripheral.
  • Memory-mapped peripheral????.
  • volatile unsigned short pP2LTCH(unsigned
    short) 0x7200005E
  • void toggleLed(void)
  • pP2LTCH LED_GREEN // read,XOR,set

12
????
  • ????????????,?????????.
  • ????????,???????????.
  • ??ADEOS(A Decent Embeded OS)
  • ??????1000?,??????????????,????C??,??????????
    ???????,?????.

13
Task
  • ???????????????Task,???????Task????????CPU.

??? (Running)
?? (Ready)
??? (Waiting)
14
Scheduler
  • ????????????????Task,??????Task???????.? FIFO ,
    Shorest First , Round Robin ?.
  • ?????????Priority-based????,?????scheduling
    point.
  • Scheduling point?scheduler????Task?????????.
  • scheduling point?????task???task?
  • clock tick.

15
Context Switch
  • ???Task??????Task???
  • ???????????????,?????
  • ??????????.

16
Task Synchronization
  • ??Mutex?????task??????,
  • ?????Mutex?????????.

17
????

Hello Word Task
????LED?Task
LED Driver
Timer Driver
??? Driver
ADEDS OS
??
????
??
Write a Comment
User Comments (0)
About PowerShow.com