Course Notes

The mbed platform is becoming widely used in academic circles for teaching embedded systems at undergraduate level, and within companies where often there is a need to self-teach or be trained in new microcontroller skills. The mbed allows quick engagement in advanced topics, and to facilitate this further we have put together a set of course notes, in the form of presentation slides, to help academic and workshop tutors teach, using mbed as the platform.

The notes are in the form of presentation slides, so can be used as standalone pre-developed content as well as taking things further with extended topics and projects.

Course Outline

The content of the course notes is outlined below. We have chosen the topics that allow a quick introduction to the most commonly used technologies and interfaces while providing the background design and programming skills to allow students to learn effectively.

The mbed course notes content and structure is as follows:

  • Digital input and output
  • Analog input and output
  • Pulse width modulation
  • Modular design and programming
  • Parallel data and communication
  • Serial communication with I2C
  • Serial communication with SPI
  • Timers and interrupts
  • Memory and data management

There are a number of topics which have been chosen to naturally support an undergraduate course, or a workshop run over a few days. In all cases examples and exercises are provided to support hands on learning. We also hope the slides stand as a useful self learning programme for anyone new to the mbed.

"We" are Rob Toulson (Anglia Ruskin University) and Tim Wilmshurst (University of Derby), working with the mbed team. We are also the authors of the recently published textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed".

Download Slides

Slides can be accessed and downloaded by selecting below:

/media/uploads/robt/_scaled_digitalinputandoutput.jpg Digital Input and Output

/media/uploads/robt/analoginputandoutput.jpg Analog Input and Output

/media/uploads/robt/pulsewidthmodulation.jpg Pulse Width Modulation

/media/uploads/robt/modulardesign.jpg Modular Design and Programming Techniques

/media/uploads/robt/parallelcomms.jpg Parallel Data and Communication

/media/uploads/robt/seriali2c.jpg Serial Communications with I2C

/media/uploads/robt/serialspi.jpg Serial Communications with SPI

/media/uploads/robt/memoryanddata.jpg Memory and Data Management

/media/uploads/robt/timersandinterrupts.jpg Timers and Interrupts





24 comments:

17 Jun 2011

Nicely done.

Comments on the Digital slide set:

1. Usual practice would be to include current-limiting resistors when attaching LEDs to digital outputs (slide #7).

2. It appears that an SPDT switch is used for the input example in slide #12. But I would suggest a different example. By adding one more slide and introducing the mode() concepts of PullUp and PullDown you could show how to use a simple SPST switch. IMHO this is more common than the use of SPDT switches for digital inputs. Also, a simple diagram might help some students visualize the connections.

3. You might also want to at least mention the concept of contact bounce. Else the students might be quite surprised at the results they get in Exercise 5 :-)

Comments on the Analog slide set:

1. Introduce the idea of blocking. Students should understand that a call to read the analog port takes a non-zero time to execute. This puts a limit on the maximum sampling rate, among other things.

2. It might also be worth mentioning that the ADC input is not ideal. There is a maximum impedance allowable for the signal source - this can be found in the spec sheet.

- I look forward to upcoming topics. Good luck with the project.

18 Jun 2011

I would suggest to put a copy of the slides in Google Docs so that everyone can contribute in developing the slides in a faster paste. I believe all will benefit from it.

19 Jun 2011

how about HTML version?

20 Jun 2011

Hi, thanks for all the comments! We'll take all your suggestions on board as we review and finalise the slides, so thanks again for your feedback.

22 Jun 2011

My suggestion is to have a link on the last slide called "Wanna go deeeper?" (or something like that) which links to another doc with more examples and circuits. For example, for the first topic, circuit and firmware showing how to interface a 7 segment display with some keys to do something with them. Another using some logic gates to do other things, interfacing with sensors, etc. For the second, examples showing how to use the analog out connected to a speaker to produce some sounds, how to connect a mic in an analog in, program a simple filter to modify the sound from the mic to the speaker and so on. I'm more than pleased to help producing those examples (with the help from someone to correct my texts, because my english level is horrible, as anyone can see). If it is possible to me to start right now creating such "deeper" examples, please tell where could I post them for revision/aproaval.

Best regards Xtian Xultz Curitiba - Brazil

24 Jun 2011

I've now uploaded the third set of slides. Thank you all for the feedback so far.

30 Jun 2011

Hi Xultz? Are from asm51? If yes drop me a p.m...

15 Jul 2011

I've uploaded the slides for Serial Communications with I2C. We're trying to get a draft of each set of slides up before making major changes to previous versions, so feedback is always appreciated and will help improve the quality of future slide sets. If anyone has any questions or specific feedback then leave a comment or send me a private message.

19 Jul 2011

Hi there, I just wanted to make some specific responses to the excellent feedback we've had to date..

- Hexley, thanks for this, you make some very good points - I suppose initially we just want to make simple examples that highlight the simple use of the interfaces and allow teachers and students to expand that further in their own way. Everyone has a different educational 'need' so we don't want to try to cover every possible eventuality. Anyway, we can look to include some more advanced digital switch examples with pull-ups etc and you are quite right that debounce issues should be touched on, so thanks for pointing that out. I'll try to take your suggestions re AnalogIn on board too when we update the slides.

- HM, Chema, yes we do intend to make these slides available as .ppt files once we have been round the loop of constructing and reviewing them, but initially we want to keep everything within our defined scope, otherwise it could just grow and grow too big to control - so please feel assured that in due course you will be able to take this content and build on it how you best see fit.

- Xtian, similarly, thanks for your interest and enthusiasm, hopefully you will see that as the slides develop they take on more advanced technologies and examples, so we do have a number of these 'deeper' examples in hand - for example the SPI notes which are nearly ready will include examples with accelerometers and colour LCD displays, so the complexity develops throughout the course of slides. Again, feel free to develop your own examples and post them to the mbed portal, as many other engineers do. We can all learn lots from each other.

I know it's never going to be possible to implement everyone’s suggestions, but the discussion and debate is what gets people thinking and considering the different approaches to learning and teaching and the need to remain broad at times and become focused and analyse deeper at other times. So, while much of this content is drawn from our own specific teaching and experience, we do very much value any feedback we receive, so please keep it coming. All feedback is good feedback!

Cheers, Rob.

19 Jul 2011

I like this sheets very much. Only a few questions about i2c: what about speed ( standard-mode, fast mode en high-speed mode ), distance ( how long cable ), and some i2c chips have also an interrupt line. Maybe is it to much, but good to say something about these 3 points.

26 Jul 2011

I think this is an excellent initiative, as is the whole mbed project.

Coming from an exclusively analogue background, I decided a few years ago that I wanted to "learn a micro". The choices came down to either Microcip PIC or something ARM-based. At that time, PIC won hands-down because of the massive amount of tutorials available - books, websites, third-party tutorials - much of which could be had for free. There were also lots of cheap demo boards to play with! ARM, on the other hand, seemed completely impenetrable with almost nothing available, even if you were willing to pay for it. What little I could find seemed to be written for people who already knew a lot about microcontrollers, which wasn't really what I was looking for...

What I see now is a greatly improving situation, ARM-wise. William Hohl's excellent book is a good introduction to the architecture, and mbed now gives ARM a level of accessibility which is as good as that of the PIC. I still feel, though, that mbed has some catching up to do with regard to tutorials and beginners' guides. I have read Bert van Dam's "ARM Microcontrollers 1", which is a good introduction, though I feel there is still much more of the story to be told. I therefore welcome this project and will be posting my own comments and suggestions soon.

Keep up the good work!

26 Jul 2011

This is just awesome!! keep the good work going. please add a few slide in tutorial for Infrared sensing also

27 Aug 2011

Very interesting course, may I suggest to wire with black (GND), red (3.3V / 5V) color wires.

It will be easier to follow and avoid mistakes :-)

05 Sep 2011

Thanks again for all your feedback - we'll definitely be addressing as many suggestions as possible when we go back over the initial versions.

I've just uploaded a slide set on modular design and programming. This is a tricky subject to cover, but it really opens up the power of programming to enbable large multi-functional projects. I'm concious a number of tutors cover this topic from different angles, so I'd be really happy to hear any comments or suggestions.

Thanks again, Rob.

07 Sep 2011

Excellent just what I needed to brush up, no doubt they will become personal reference materiak.

Thanks Merl

20 Sep 2011

Hello Rob, Thanks for putting together the course notes. They are a great help and well written for help novices get their bearings. This may not be the proper forum to post this question. If not, please point me to the right place. Thank you.

Regarding pg 17 for the serial communications with i2c: I'm trying out exercise #3 and am apparently missing a step when I try to configure the SRF08 to measure a maximum range of 10 ft. I attempted to edit the sample code by inserting the following line into the while loop:

config_r[2] = 0x46;

I calculated Range Register using ((Range Register x 43)+43) = 3053 (10 ft) and converted to hex 0x46. When I compile and place my hand at distances above the sensor, it appears to max out ranging at 20 inch +/-10.

Any tips to get me back on the right path I'd appreciate. Next time I'll hope to offer a more insightful comment to the group.

Regards, Scott Pflumm

30 Sep 2011

I posted my student lab handout on SPST pushbuttons and switches at http://mbed.org/users/4180_1/notebook/pushbuttons/ . Feel free to use that info for the switch slides. It has additional info, videos, and code demos on pullups, contact bounce, and callbacks. Also has examples using small switches that mount directly on a breadboard.

I also posted my student lab notes on drivers, relays, and solid state relays in the cookbook.

05 Mar 2012

Thank you for the exellent course! I would suggest to add some details to "Digital Input and Output" section: - DigitalInOut class description - mode settings to DigitalIn and DigitalInOut

Best Regards, Igor

31 Aug 2012

Hello Rob and Tim,

got Your book and say: well done at the right time.

But: No download of Program Examples, unfortunately.

We are waiting for!

Kind regards

Wolf

14 Sep 2012

Rob,

Congratulations on this excellent initiative. Are these slides available as .ppt files?

Thank you, Marcelo.