5 Content Prologue 9 1 What you will need 12 2 Tutorial 17 2.1

3. Basic. 33. 3.1. LCD display. 33. 3.2. Running light. 39. 3.3. Secret doorbell. 45. 3.4. Serial communication. 51. 3.4.1. RS232. 51. 3.4.2. USB. 58. 3.5. Analog to ...
83KB taille 0 téléchargements 123 vues
Content

Prologue

9

1

What you will need

12

2 2.1 2.2 2.3 2.4 2.5 2.6

Tutorial Concept Hardware Software Simulation Downloading Operational

17 17 17 22 29 31 32

3 3.1 3.2 3.3 3.4 3.4.1 3.4.2 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.11.1 3.11.2 3.12

Basic LCD display Running light Secret doorbell Serial communication RS232 USB Analog to Digital Conversion Dark activated switch Youth deterrent Sound activated switch Air to fuel ratio Digital clock Debugging Simulation Serial connection Bootloader

33 33 39 45 51 51 58 62 66 70 77 80 87 91 93 94 96

4 4.1 4.2 4.3 4.3.1 4.3.2 4.4 4.5

Advanced Vref+ Record short sounds Cricket High quality version Low cost version Custom Characters Animation

100 100 105 111 111 116 119 123 5

4.6 4.7 4.8 4.9 4.10 4.11 4.12 4.13 4.14

Random A fan on PWM Persistence of vision Flash memory USART connection GPS tracking Use PPP to access EEPROM Poetry box Voice command

124 128 135 139 144 149 155 159 163

5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8

Sensors Infrared object detection Photometer Ultrasonic range finder Digital thermometer Data sampling the fridge Heat loss in a residential building Capture sound frequency Tow away alarm

169 169 172 178 184 189 197 202 212

6 6.1 6.2 6.3

Cell phone Send a text message Receive a text message Remote control

217 217 221 225

7 7.1 7.2

CAN bus Remote LEDs Monitor

232 232 240

8 8.1 8.2 8.3 8.4

Internet Ping (Are you there?) Webserver Send an alarm e-mail UDP remote control

248 248 258 265 276

9 9.1 9.2

Design your own E-block Analog test signal Microphone pre-amplifier

282 282 284

10 10.1 10.2 10.3

Migration between PIC, AVR and ARM Software Hardware Example

288 288 289 293

6

11 11.1

Going into production Youth deterrent (continued)

296 296

12 12.1 12.2 12.3 12.4 12.5

Appendix ASCII table Visual Basic communications Tips and tricks Microcontroller Mathematics E-block connections

302 302 303 305 314 320

Index

327

7