Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Rapid BeagleBoard Prototyping with MATLAB and Simulink

You're reading from  Rapid BeagleBoard Prototyping with MATLAB and Simulink

Product type Book
Published in Oct 2013
Publisher Packt
ISBN-13 9781849696043
Pages 152 pages
Edition 1st Edition
Languages
Toc

Table of Contents (15) Chapters close

Rapid BeagleBoard Prototyping with MATLAB and Simulink
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Introducing BeagleBoard 2. Installing Linux on the BeagleBoard 3. C/C++ Development with Eclipse on Windows 4. Automatic Code Generation 5. Digital I/O and Serial Communication 6. Voice Recognition 7. Digital Video-Based Motion Detection Wrapping Up Index

Interfacing sensors via a serial port in C


In the last section, the ZMotion IR sensor was connected to the BeagleBoard through the digital I/O interface, and successfully acquired the value of the ZMotion module into Simulink by using the GPIO Write block and the GPIO Read block. In this section, we will not only discuss how to connect a sensor based on a different interface (that is, serial communication) but also how to develop a software driver to communicate with the sensor. We will use the textual C code approach in this section, and you can migrate the code into a S-Function block for graphical programming in Simulink, which will be discussed later.

Firstly, let's get back to the datasheet of the ZMotion module. To select the Serial Interface Mode, we will need to provide a pull-up resistor (typically 100 KΩ) from TXD/SNS to VDD during the power ON process. If the device detects the voltage on that pin is greater than 2.5V in the power ON process, the device will enable the serial mode...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}