ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 4 Review
ENTC-489 Embedded Real Time Software Development 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
ENTC-489 Embedded Real Time Software Development 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?
ENTC-489 Embedded Real Time Software Development 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?
ENTC-489 Embedded Real Time Software Development ERTSD Vocabulary Five Possible Task States in a Kernel, what does each mean? – Dormant – Ready – Pending – Running – Interrutped
ENTC-489 Embedded Real Time Software Development 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
ENTC-489 Embedded Real Time Software Development 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?
ENTC-489 Embedded Real Time Software Development ERTSD Vocabulary Explain these functions – OSSemCreate() – OSSemPost() – OSSemPend() – OSSemAccess()
ENTC-489 Embedded Real Time Software Development Homework Architecture
ENTC-489 Embedded Real Time Software Development RTOS Demonstration Volunteers – Timer – Kernel – Idle Task – Task 1 – Task 2 – Main
ENTC-489 Embedded Real Time Software Development Break
ENTC-489 Embedded Real Time Software Development 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
ENTC-489 Embedded Real Time Software Development Architecture
ENTC-489 Embedded Real Time Software Development 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
ENTC-489 Embedded Real Time Software Development 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
ENTC-489 Embedded Real Time Software Development 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
ENTC-489 Embedded Real Time Software Development Real Life Example SHT-21 Measures temperature and humidity Fast mode I2C (up to 400 kb/s)
ENTC-489 Embedded Real Time Software Development SHT-21 Performance
ENTC-489 Embedded Real Time Software Development Addressing & Commands 7 Bit address is 0b – Address to write 0b or 0x80 – Address to read 0b or 0x81 Commands:
ENTC-489 Embedded Real Time Software Development 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
ENTC-489 Embedded Real Time Software Development Measure the Humidity