1 / 21

Embedded Real Time Software Development

Embedded Real Time Software Development. Week 4 Review. Today’s Agenda. Review Development Tools and Turning in H/W ERTSD Vocabulary Tasks and Task States OS Timers Counting Semaphores Binary Semaphores Mutexes I2C Understanding I2C communication

gertrudek
Download Presentation

Embedded Real Time Software Development

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. Embedded Real Time Software Development Week 4 Review

  2. Today’s Agenda • Review • Development Tools and Turning in H/W • ERTSD Vocabulary • Tasks and Task States • OS Timers • Counting Semaphores • Binary Semaphores • Mutexes • I2C • Understanding I2C communication • SHT21 Temperature/Humidity Sensor Operation

  3. ERTSD Vocabulary • What is the difference between a kernel and an operating system? • Compare • Superloops • Foreground/Background Systems • Kernel • Interrupts are (Foreground? Background?) • What makes a function reentrant?

  4. ERTSD Vocabulary • Define Real-Time • Hard Real-Time • Soft Real-Time • What makes software deterministic? • What does the term deterministic have to do with the term Real-Time? • What is the difference between a cooperative kernel and a preemptive kernel?

  5. ERTSD Vocabulary • Five Possible Task States in a Kernel, what does each mean? • Dormant • Ready • Pending • Running • Interrutped

  6. ERTSD Vocabulary • In uC/OS-II which is a higher priority? • 15 • 31 • What do these parameters do in OSTaskCreate()? • void (*task)(void *pd) • void *pdata • OS_STK *ptos • UINT8U prio

  7. ERTSD Vocabulary • What is a semaphore? • Binary • Counting • What is “deadlock” when applied to a kernel? • How can you avoid deadlock? • What is “priority inversion”? • What is a Mutex? Why would you use one?

  8. ERTSD Vocabulary • Explain these functions • OSSemCreate() • OSSemPost() • OSSemPend() • OSSemAccess()

  9. Homework Architecture

  10. RTOS Demonstration • Volunteers • Timer • Kernel • Idle Task • Task 1 • Task 2 • Main

  11. Break

  12. What is I2C • Multi master, Multi slave serial protocol • Two Wires, SDA & SCL • 7 Bit addresses • Speed • 100 kb/s Standard • 400 kb/s Fast mode • 1 Mb/s Fast mode + • 3.4 Mb/s High Speed mode • 5 Mb/s Ultra-Fast mode

  13. Architecture

  14. Message Structure • Start Condition indicates the master is setting up communication • Ack, the “sender” releases SDA and the “receiver” pulls it low if no error • Stop Condition lets all devices on the bus know to listen for a Start Condition again

  15. Clock Stretching • After receiving last data bit, the slave holds the clock line low until it is ready. • Ack is set to the correct state, usually 0 • Clock line is released for master to continue

  16. Repeated Start Condition • Used when more than one message must be sent to complete an operation. • e.g. reading a byte from an EEPROM Master, Slave, S=Start, P=Stop <S><DevAddr><ACK><MemoryAddr><ACK> <S><Data><ACK><Data><ACK><Data><NAK><P>

  17. Real Life Example SHT-21 • Measures temperature and humidity • Fast mode I2C (up to 400 kb/s)

  18. SHT-21 Performance

  19. Addressing & Commands • 7 Bit address is 0b1000000 • Address to write 0b10000000 or 0x80 • Address to read 0b10000001 or 0x81 • Commands:

  20. Why are there 2 measurement commands? • 4 mS Hold, freezes I2C bus for 160 potential message bytes • 85 mS Hold, freezes I2C bus for 3400 potential message bytes • The SHT-21 is not our only I2C device on this board

  21. Measure the Humidity

More Related