SD card projects using the PIC microcontroller

PIC Microcontrollers are a favorite in industry and with hobbyists.These microcontrollers are versatile, simple, and low cost making them perfect for many different applications.The 8-bit PIC is widely used in consumer electronic goods, office automation, and personal projects.

Saved in:
Bibliographic Details
Main Author Ibrahim, Dogan
Format eBook Book
LanguageEnglish
Published Burlington, MA Newnes 2010
Elsevier Science & Technology
Newnes/Elsevier
Edition1
Subjects
Online AccessGet full text
ISBN185617719X
9781856177191
DOI10.1016/C2009-0-20198-X

Cover

Table of Contents:
  • 3.17 Card Reset State -- 3.18 Summary -- 3.19 Exercises -- Chapter 4. Programming with the MPLAB C18 Compiler -- 4.1 C Programming Languages for PIC18 Microcontrollers -- 4.2 MPLAB C18 Compiler -- 4.2.1 Installing the MPLAB C18 Compiler -- 4.3 An Example Program -- 4.3.1 Building the Project -- 4.3.2 Simulating the Project -- 4.4 Flashing LED Example -- 4.4.1 Building and Simulating the Project -- 4.5 Structure of the MPLAB C18 Compiler -- 4.5.1 Comments -- 4.5.2 Terminating Program Statements -- 4.5.3 White Spaces -- 4.5.4 Case Sensitivity -- 4.5.5 Variable Names -- 4.5.6 Variable Types -- 4.5.7 Constants -- 4.5.8 Escape Sequences -- 4.5.9 Static Variables -- 4.5.10 External Variables -- 4.5.11 Volatile Variables -- 4.5.12 Enumerated Variables -- 4.5.13 Arrays -- 4.5.14 Pointers -- 4.5.15 Structures -- 4.5.16 Unions -- 4.5.17 Operators in C -- 4.5.18 Modifying the Flow of Control -- 4.5.19 Iteration Statements -- 4.5.20 Mixing C18 with Assembly Language Statements -- 4.6 PIC Microcontroller I/O Port Programming -- 4.7 Programming Examples -- 4.8 Functions -- 4.8.1 Function Prototypes -- 4.8.2 Passing Arrays to Functions -- 4.8.3 Passing Variables by Reference to Functions -- 4.8.4 Static Function Variables -- 4.9 MPLAB C18 Library Functions -- 4.9.1 Delay Functions -- 4.9.2 Character Classification Functions -- 4.9.3 Data Conversion Functions -- 4.9.4 Memory and String Manipulation Functions -- 4.9.5 Reset Functions -- 4.9.6 Character Output Functions -- 4.9.7 Math Library Functions -- 4.9.8 LCD Functions -- 4.9.9 Software CAN2510 Functions -- 4.9.10 Software I2C Bus Functions -- 4.9.11 Software SPI Bus Functions -- 4.9.12 Software UART Functions -- 4.9.13 Hardware Analog-to-Digital (A/D) Converter Functions -- 4.9.14 Hardware Input Capture Functions -- 4.9.15 Hardware I2C Functions -- 4.9.16 Hardware I/O Port Functions
  • 1.18 Adding Binary Numbers -- 1.19 Subtracting Binary Numbers -- 1.20 Multiplication of Binary Numbers -- 1.21 Division of Binary Numbers -- 1.22 Floating Point Numbers -- 1.23 Converting a Floating Point Number into Decimal -- 1.23.1 Normalizing the Floating Point Numbers -- 1.23.2 Converting a Decimal Number into Floating Point -- 1.23.3 Multiplication and Division of Floating Point Numbers -- 1.23.4 Addition and Subtraction of Floating Point Numbers -- 1.24 Binary-Coded Decimal Numbers -- 1.25 Summary -- 1.26 Exercises -- Chapter 2. PIC18F Microcontroller Series -- 2.1 PIC18FXX2 Architecture -- 2.1.1 Program Memory Organization -- 2.1.2 Data Memory Organization -- 2.1.3 The Configuration Registers -- 2.1.4 The Power Supply -- 2.1.5 The Reset -- 2.1.6 The Clock Sources -- 2.1.7 Watchdog Timer -- 2.1.8 Parallel I/O Ports -- 2.1.9 Timers -- 2.1.10 Capture/Compare/PWM Modules -- 2.1.11 Pulse Width Modulation Module -- 2.1.12 Analog-to-Digital Converter Module -- 2.1.13 Interrupts -- 2.2 Summary -- 2.3 Exercises -- Chapter 3. Memory Cards -- 3.1 Memory Card Types -- 3.2 Smart Media Card -- 3.3 Multimedia Card -- 3.4 Compact Flash Card -- 3.5 Memory Stick Card -- 3.6 Microdrive -- 3.7 xD Card -- 3.8 Secure Digital Card -- 3.8.1 Standard SD Cards -- 3.8.2 High-Capacity SD Cards -- 3.9 Memory Card Readers -- 3.10 Memory Card Physical Properties -- 3.11 Memory Card Technical Properties -- 3.12 Detailed SD Card Structure -- 3.12.1 SD Card Pin Configuration -- 3.12.2 SD Card Interface -- 3.13 SD Card Internal Registers -- 3.13.1 OCR Register -- 3.13.2 CID Register -- 3.13.3 CSD Register -- 3.13.4 RCA Register -- 3.13.5 DSR Register -- 3.13.6 SCR Register -- 3.13.7 SD Status Register -- 3.14 Calculating the SD Card Capacity -- 3.15 SD Card SPI Bus Protocol -- 3.15.1 Data Read -- 3.15.2 Data Write -- 3.15.3 Response Tokens -- 3.16 Data Tokens
  • 6.6 Project 5 - Seven-Segment LED Counter -- 6.6.1 Project Description -- 6.6.2 Project Hardware -- 6.6.3 Project PDL -- 6.6.4 Project Program -- 6.6.5 Modified Program -- 6.7 Project 6 - Two-Digit Multiplexed Seven-Segment LED -- 6.7.1 Project Description -- 6.7.2 Project Hardware -- 6.7.3 Project PDL -- 6.7.4 Project Program -- 6.8 Project 7 - Two-Digit Multiplexed Seven-Segment LED Counter With Timer Interrupt -- 6.8.1 Project Description -- 6.8.2 Project Hardware -- 6.8.3 Project PDL -- 6.8.4 Project Program -- 6.8.5 Modifying the Program -- 6.9 Project 8 - Four-Digit Multiplexed Seven-Segment LED Counter With Timer Interrupt -- 6.9.1 Project Description -- 6.9.2 Project Hardware -- 6.9.3 Project PDL -- 6.9.4 Project Program -- 6.9.5 Modifying the Program -- 6.9.6 Using MPLAB C18 Compiler Timer Library Routines -- 6.10 Summary -- 6.11 Exercises -- Chapter 7. Serial Peripheral Interface Bus Operation -- 7.1 The Master Synchronous Serial Port Module -- 7.2 MSSP in SPI Mode -- 7.3 SPI Mode Registers -- 7.3.1 SSPSTAT -- 7.3.2 SSPCON1 -- 7.4 Operation in SPI Mode -- 7.4.1 Configuration of MSSP for SPI Master Mode -- 7.5 SPI Bus MPLAB C18 Library Functions -- 7.5.1 CloseSPI -- 7.5.2 DataRdySPI -- 7.5.3 getcSPI -- 7.5.4 getsSPI -- 7.5.5 OpenSPI -- 7.5.6 putcSPI -- 7.5.7 putsSPI -- 7.5.8 ReadSPI -- 7.5.9 WriteSPI -- 7.6 Example of an SPI Bus Project -- 7.6.1 TC72 Temperature Sensor -- 7.6.2 The Circuit Diagram -- 7.6.3 The Program -- 7.6.4 Displaying Negative Temperatures -- 7.6.5 Displaying the Fractional Part -- 7.7 Summary -- 7.8 Exercises -- Chapter 8. MPLAB C18 SD Card Functions and Procedures -- 8.1 Installation of the MDD Library -- 8.2 MDD Library Functions -- 8.2.1 File and Disk Manipulation Functions -- 8.2.2 Library Options -- 8.2.3 Memory Usage -- 8.2.4 Library Setup -- 8.3 Sequence of Function Calls -- 8.3.1 Reading from an Existing File
  • Front Cover -- Half Title Page -- Title Page -- Copyright Page -- Copyright Exceptions -- Table of Contents -- Preface -- About the Web Site -- Chapter 1. Microcontroller Systems -- 1.1 Introduction -- 1.2 Microcontroller Systems -- 1.2.1 Random Access Memory -- 1.2.2 Read Only Memory -- 1.2.3 Programmable Read Only Memory -- 1.2.4 Erasable Programmable Read Only Memory -- 1.2.5 Electrically Erasable Programmable Read Only Memory -- 1.2.6 Flash EEPROM -- 1.3 Microcontroller Features -- 1.3.1 Buses -- 1.3.2 Supply Voltage -- 1.3.3 The Clock -- 1.3.4 Timers -- 1.3.5 Watchdog -- 1.3.6 Reset Input -- 1.3.7 Interrupts -- 1.3.8 Brown-Out Detector -- 1.3.9 A/D Converter -- 1.3.10 Serial I/O -- 1.3.11 EEPROM Data Memory -- 1.3.12 LCD Drivers -- 1.3.13 Analog Comparator -- 1.3.14 Real-Time Clock -- 1.3.15 Sleep Mode -- 1.3.16 Power-on Reset -- 1.3.17 Low-Power Operation -- 1.3.18 Current Sink/Source Capability -- 1.3.19 USB Interface -- 1.3.20 Motor Control Interface -- 1.3.21 Controller Area Network Interface -- 1.3.22 Ethernet Interface -- 1.3.23 ZigBee Interface -- 1.4 Microcontroller Architectures -- 1.4.1 Reduced Instruction Set Computer and Complex Instruction Set Computer -- 1.5 Choosing a PIC Microcontroller -- 1.6 Number Systems -- 1.6.1 Decimal Number System -- 1.6.2 Binary Number System -- 1.6.3 Octal Number System -- 1.6.4 Hexadecimal Number System -- 1.7 Converting Binary Numbers into Decimal -- 1.8 Converting Decimal Numbers into Binary -- 1.9 Converting Binary Numbers into Hexadecimal -- 1.10 Converting Hexadecimal Numbers into Binary -- 1.11 Converting Hexadecimal Numbers into Decimal -- 1.12 Converting Decimal Numbers into Hexadecimal -- 1.13 Converting Octal Numbers into Decimal -- 1.14 Converting Decimal Numbers into Octal -- 1.15 Converting Octal Numbers into Binary -- 1.16 Converting Binary Numbers into Octal -- 1.17 Negative Numbers
  • 4.9.17 Hardware Microwire Functions -- 4.9.18 Hardware Pulse Width Modulation Functions -- 4.9.19 Hardware SPI Functions -- 4.9.20 Hardware Timer Functions -- 4.9.21 Hardware USART Functions -- 4.10 Summary -- 4.11 Exercises -- Chapter 5. PIC18 Microcontroller Development Tools -- 5.1 Software Development Tools -- 5.1.1 Text Editors -- 5.1.2 Assemblers and Compilers -- 5.1.3 Simulators -- 5.1.4 High-Level Language Simulators -- 5.1.5 Integrated Development Environments -- 5.2 Hardware Development Tools -- 5.2.1 Development Boards -- 5.2.2 Device Programmers -- 5.2.3 In-Circuit Debuggers -- 5.2.4 In-Circuit Emulators -- 5.2.5 Breadboards -- 5.3 Using the MPLAB ICD 3 In-Circuit Debugger -- 5.3.1 The Debugging Process -- 5.3.2 The MPLAB ICD 3 Test Interface Board -- 5.3.3 Programming with the MPLAB ICD 3 Debugger -- 5.3.4 MPLAB ICD 3 Debugging Example I -- 5.3.5 MPLAB ICD 3 Debugging Example II -- 5.3.6 MPLAB ICD 3 Debugging Example III -- 5.4 Summary -- 5.5 Exercises -- Chapter 6. PIC18 Microcontroller MPLAB C18-Based Simple Projects -- 6.1 Program Description Language -- 6.1.1 START-END -- 6.1.2 Sequencing -- 6.1.3 IF-THEN-ELSE-ENDIF -- 6.1.4 DO-ENDDO -- 6.1.5 REPEAT-UNTIL -- 6.2 Project 1 - Chasing LEDs -- 6.2.1 Project Description -- 6.2.2 Project Hardware -- 6.2.3 Project PDL -- 6.2.4 Project Program -- 6.2.5 Further Development -- 6.3 Project 2 - LED Dice -- 6.3.1 Project Description -- 6.3.2 Project Hardware -- 6.3.3 Project PDL -- 6.3.4 Project Program -- 6.3.5 Using a Pseudorandom Number Generator -- 6.4 Project 3 - Two-Dice Project -- 6.4.1 Project Description -- 6.4.2 Project Hardware -- 6.4.3 Project PDL -- 6.4.4 Project Program -- 6.5 Project 4 - Two Dice Project - Fewer I/O Pins -- 6.5.1 Project Description -- 6.5.2 Project Hardware -- 6.5.3 Project PDL -- 6.5.4 Project Program -- 6.5.5 Modifying the Program
  • 8.3.2 Writing Onto an Existing File