Presentation is loading. Please wait.

Presentation is loading. Please wait.

ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 7 Review, Quiz, & Watchdog Timers.

Similar presentations


Presentation on theme: "ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 7 Review, Quiz, & Watchdog Timers."— Presentation transcript:

1 ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 7 Review, Quiz, & Watchdog Timers

2 ENTC-489 Embedded Real Time Software Development Today’s Agenda Announcements Review – Real World I2C Timing Examples Quiz Watchdog timers in Embedded Systems

3 ENTC-489 Embedded Real Time Software Development Announcements In recognition of the need to work during spring break, WDT Extra Credit Program, it will now replace two lowest Quiz/Homework grades Extra credit assignment will be handed out after the quiz which may replace lowest Quiz/Homework grade If you turn in both, you get a do-over on a total of 3 grades! Mid-term exam (25% of your grade) is the week after spring break. – Open book (should have calling information on µC/OS and IQmathLib functions handy) – Calculator recommended – Anything covered in my lectures is fair game!

4 ENTC-489 Embedded Real Time Software Development Overall View of Intensity Running Low = In Idle Task Measure Temperature & Humidity Delay

5 ENTC-489 Embedded Real Time Software Development Code to Get 1mS Time Delays

6 ENTC-489 Embedded Real Time Software Development Zoom on Reading Temperature Read Temp Command NAKed Read ACK, Read Data, Start Humidity Reading

7 ENTC-489 Embedded Real Time Software Development Read Temperature Loop

8 ENTC-489 Embedded Real Time Software Development Read Command with Delayed Stop Start of command based on OSTimeDly() and there are not many higher priority processes so the time is very close to the time set by OSTimeDly() we use for the stop bit generation. Delay varies Service Timer Interrupt

9 ENTC-489 Embedded Real Time Software Development Delay Before Stop

10 ENTC-489 Embedded Real Time Software Development Sending Read Temp Command Service I2C Interrupt Read Temp Command Address + Write Bit Service Timer Interrupt

11 ENTC-489 Embedded Real Time Software Development Command to Read Temperature Read 2 Bytes

12 ENTC-489 Embedded Real Time Software Development Generic Read Command

13 ENTC-489 Embedded Real Time Software Development Waiting for the Conversion I2C Interrupt Service SHT21 NAKs Command Extra from uC port Stop Bit Sent Address + Read Bit Timer Interrupt Service

14 ENTC-489 Embedded Real Time Software Development Reading Before Conversion Done Returns 0 Because of Command NAK

15 ENTC-489 Embedded Real Time Software Development Got the Conversion Address + Read Bit ACK High Order Byte ACK from uC Low Order Byte Stop from uC Start of Humid Cmd Service I2C IRQ

16 ENTC-489 Embedded Real Time Software Development Successful 2 Byte Read bytes_in 0, then 1 maxbytes = 2

17 ENTC-489 Embedded Real Time Software Development Break/Quiz

18 ENTC-489 Embedded Real Time Software Development Kernel Watchdog Timer What is a WDT? Why do I need one? How is a Kernel WDT different than a hardware WDT? Basic WDT Architecture

19 ENTC-489 Embedded Real Time Software Development What is a WDT? An independent, usually hardware mechanism to monitor the health of a software based system. Based on the principle of check in (often called a tickle) by software on a periodic basis If the software fails to tickle in the required time a hardware reset is issued

20 ENTC-489 Embedded Real Time Software Development Why do I need a WDT? Unanticipated events can cause the software to go crazy – Rare interrupt for which there is no handler – Undetected software bug – High energy sub-atomic particle (rare on earth) – Hardware (latch-up is moderately common) causes I/O pins to have unanticipated values WDT allows you to at minimum – Put hardware in a safe condition WDT may allow you to correct or work around the problem

21 ENTC-489 Embedded Real Time Software Development How is a Kernel WDT Different H/W WDT – Usually short timeouts (< 1 second to << 1 second) – Likelihood ALL the software is confused (no kernel) – Always results in a reset, which can be a booger to debug Kernel WDT – Timeout often set to > 1 second, depending on what the tasks are doing and the criticality of the tasks – Likelihood that only one task is malfunctioning, allowing system to operate with a limp – Health task can allow breakpoints when timeouts do occur, making debug a little easier

22 ENTC-489 Embedded Real Time Software Development Health Task Architecture All task pends must have a timeout < the required check-in time Health task must tickle the H/W WDT when everything is good Health task may delete and re-create tasks that do not check-in on time


Download ppt "ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 7 Review, Quiz, & Watchdog Timers."

Similar presentations


Ads by Google