|
Облако тегов |
|
|
Circuit Cellar, Electronics, Elektor, Everyday Practical Electronics, Nuts and Volts, Антенны, аудио, Журнал, Измерения, источники питания, Микросхемы, приборы, Радіоаматор, Радио, Радио (жур.), Радиоаматор, Радиоконструктор, Радиолюбитель, радиолюбителю, Радиолюбителям, Радиомир, Радиоприем, радиоприемник, радиосвязь, радиоэлектроника, ремонт, Ремонт и Сервис, Связь, Серия Ремонт, справочник, схема, Схемотехника, Схемы, Телевидение, Телевизоры, трансформаторы, усилитель, Электрик, Электроника, Электротехника
Показать все теги
|
|
|
|
|
|
Авторские права | |
|
Все книги на сайте представлены исключительно в ознакомительных целях!
Авторам, желающим внести поправки, просим связаться с администрацией.
Администрация
|
|
|
|
|
|
|
|
Микроэлектроника, Программирование: Programming the PIC Microcontroller with MBASIC
|
|
|
Просмотров: 1134 добавил: MIHAIL62 25-02-2013, 06:58
|
|
Название: Programming the PIC Microcontroller with MBASIC
Автор: Jack Smith
Издательство: Newnes
Год: 2005
Страниц: 800
Язык: Английский
|
The Microchip PIC family of microcontrollers is the most popular series of microcontrollers in the world. However, no microcontroller is of any use without software to make it perform useful functions. This comprehensive reference focuses on designing with Microchips mid-range PIC line using MBASIC, a powerful but easy to learn programming language. It illustrates MBASICs abilities through a series of design examples, beginning with simple PIC-based projects and proceeding through more advanced designs.
Unlike other references however, it also covers essential hardware and software design fundamentals of the PIC microcontroller series, including programming in assembly language when needed to supplement the capabilities of MBASIC. Details of hardware/software interfacing to the PIC are also provided.
Contents
Preface...............................................................................................................................*
Acknowledgmen ts.........................................................................................-................xii
What's on the CD-ROM?................................................................................................xiii
CHAPTER 1: What is a PIC®?............................................................................................1
PICs "101"..................................................................................................................................1
How Do I Tell Them Apart?..........................................................................................................2
Which One Should I Use?............................................................................................................4
How Do I Pick One?....................................................................................................................7
So, Which One Do I Really Want to Use?.....................................................................................8
Basic Micro's MBasic876 Compiler...............................................................................................8
References...................................................................................................................................9
CHAPTER 2: MBasic Compiler and Development Boards.............................................10
The Compiler Package...............................................................................................................10
BASIC and Its Essentials.............................................................................................................11
Development Boards.................................................................................................................13
Programming Style....................................................................................................................15
Building the Circuits and Standard Assumptions .......................................................................16
Pins, Ports and Input/Output......................................................................................................17
Pseudo-Code and Planning the Program....................................................................................23
Inside the Compiler...................................................................................................................25
References.................................................................................................................................27
CHAPTER 3: The Basics - Output.................................................................-..................28
Pin Architectures.......................................................................................................................28
LED Indicators...........................................................................................................................31
Switching Inductive Loads.........................................................................................................34
Low Side Switching...................................................................................................................36
Isolated Switching.....................................................................................................................45
Special Purpose Switching.........................................................................................................50
Fast Switching—Sound from a PIC.............................................................................................50
References.................................................................................................................................51
CHAPTER 4: The Basics - Digital Input...........................................................................53
Introduction..............................................................................................................................53
Switch Bounce and Sealing Current...........................................................................................58
Isolated Switching.....................................................................................................................62
Reading a Keypad.....................................................................................................................63
References.................................................................................................................................66
CHAPTER 5; LCD Modules...............................................................................................67
Selecting a Display.....................................................................................................................67
VFD Displays..............................................................................................................................69
Connection to PIC.....................................................................................................................69
Hello World...............................................................................................................................72
LCD Module Memory, Shifts and Lines.......................................................................................74
Font Selection...........................................................................................................................79
Custom Characters....................................................................................................................80
References.................................................................................................................................85
CHAPTER 6: Reading Complex Input Switches.............................................................86
Pin Saving Techniques................................................................................................................86
Rotary Encoders........................................................................................................................91
Reading a Relative Encoder........................................................................................................95
Dual Encoders and LCD...........................................................................................................100
References...............................................................................................................................106
CHAPTER 7: Seven-Segment LED Displays..................................................................107
LED Display Selection...............................................................................................................107
Circuit Design..........................................................................................................................108
References...............................................................................................................................119
CHAPTER 8: Introductory Stepper Motors..................................................................120
Stepper Motor Basics...............................................................................................................120
Programs.................................................................................................................................133
References...............................................................................................................................150
CHAPTER 9: RS-232 Serial Interface.............................................................................151
How to Connect to Your PC....................................................................................................151
Voltage Levels in RS-232 and Level Conversion........................................................................152
Standard Pin Connections........................................................................................................154
Asynchronous Transmission, Start Bits, Stop Bits and Bit Order.................................................154
MBasic's Procedures for Serial Communications.......................................................................156
Programs.................................................................................................................................159
References...............................................................................................................................186
CHAPTER 10: Interrupts and Timers in MBasic............................................................187
Interrupts and Timers—Overview.............................................................................................187
Interrupts................................................................................................................................188
Timers.....................................................................................................................................194
Capture and Compare.............................................................................................................203
References...............................................................................................................................210
CHAPTER 11: An a log-to-Digital Conversion...............................................................211
Introduction to Analog-to-Digital Conversion...........................................................................211
Resolution and Accuracy.........................................................................................................212
Self-Contained DVM...............................................................................................................218
References...............................................................................................................................230
CHAPTER 12: Digital Temperature Sensors and Real-Time Clocks.............................231
DS18B20 Temperature Sensor..................................................................................................231
DS1302 Real-Time Clock.........................................................................................................243
Combination Date, Time and Temperature..............................................................................252
References...............................................................................................................................259
CHAPTER 13: Assembler 101........................................................................................260
The Basics...............................................................................................................................260
Opcodes.................................................................................................................................267
References...............................................................................................................................280
CHAPTER 14:ln-Line Assembler...................................................................................281
Adding Assembler to MBasic Programs....................................................................................281
Bo It-In Assembler Functions.....................................................................................................295
References...............................................................................................................................316
CHAPTER 15: Interrupt Handlers and Timers in Assembler.......................................317
ISRASM - MBasic's Gateway to Assembler Interrupt Service Routines.......................................317
Program Examples...................................................................................................................323
References...............................................................................................................................334
CHAPTER 16: Digital-to-Analog Conversion...............................................................335
Introduction to Digital-to-Analog Conversion...........................................................................335
Resolution - Accuracy and Signal-to-Noise Ratio......................................................................336
Henry Nyquist and his Sampling Theorem................................................................................337
DAC Circuit Design..................................................................................................................339
Alternative Analog Output Solutions.......................................................................................352
References...............................................................................................................................358
CHAPTER 17: DTMF Tone Decoding and Telephone Interface...................................360
What is Touch-Tone Signaling?................................................................................................360
Generating Touch-Tone Signals................................................................................................361
Decoding a Touch-Tone Signal.................................................................................................361
References...............................................................................................................................388
CHAPTER 18: External Memory....................................................................................389
l2C-Bus Devices........................................................................................................................389
Practical Use of External EEPROM............................................................................................403
Parallel Access Memory...........................................................................................................408
References...............................................................................................................................416
CHAPTER 19: Advanced Stepper Motors................................................-....................418
Microstepping.........................................................................................................................418
Programs.................................................................................................................................420
References...............................................................................................................................452
CHAPTER 20: X-10 Home Automation.........................................................................453
How X-10 Works.....................................................................................................................453
Programs.................................................................................................................................459
References...............................................................................................................................486
CHAPTER 21: Digital Potentiometers and Controllable Filter....................................487
Getting Started with an MCP41010........................................................................................489
RS-232 Control of an MCP41010............................................................................................493
Daisy Chaining Multiple MCP42010 Devices............................................................................498
RS-232 Command of Multiple Daisy Chained MCP42010 Devices...........................................501
Logarithmic Response for Audio Volume Control.....................................................................506
Electronically Tunable Low-Pass Filter Using MCP42010........................................................... 511
References...............................................................................................................................515
CHAPTER 22: Infrared Remote Controls......................................................................517
Common Encoding Standards.................................................................................................518
IR Receiver...............................................................................................................................520
Characterizing Wide/Narrow Pulse Intervals.............................................................................522
Decoding a REC-80 Controller.................................................................................................532
References...............................................................................................................................541
CHAPTER 23: AC Power Control...................................................................................542
Introduction to Triacs...............................................................................................................543
Snubberless versus Standard; dV/dt and dl/dt Issues.................................................................545
Triggering a Triac ....................................................................................................................548
Phase and Cycle Control..........................................................................................................549
Power Control Board...............................................................................................................551
Programs.................................................................................................................................555
References...............................................................................................................................565
CHAPTER 24: DC Motor Control...................................................................................567
Introduction to Control Theory................................................................................................567
Measure Motor Speed (Tachometer Output Pulse Width).........................................................568
Error = Target Width - Measured Width .................................................................................572
The Control Algorithm.............................................................................................................572
Motor Control Programs..........................................................................................................573
References...............................................................................................................................594
CHAPTER 25: Bar Code Reader.....................................................................................595
BarCodes "101"....................................................................................................................595
Bar Code Wand.......................................................................................................................599
Programs.................................................................................................................................602
References...............................................................................................................................631
CHAPTER 26: Sending Morse Code.............................................................................- 633
Morse Code 101.....................................................................................................................633
Programs.................................................................................................................................635
References...............................................................................................................................660
CHAPTER 27: Morse Code Reader................................................................................661
Sending and Receiving Morse..................................................................................................661
Tone Detector Circuit...............................................................................................................663
Programs.................................................................................................................................668
References...............................................................................................................................689
CHAPTER 28: Weather Station and Data Logger........................................................691
Sensor Selection......................................................................................................................691
Connecting the Sensors and Memory......................................................................................698
Initial Tests...............................................................................................................................700
References...............................................................................................................................728
CHAPTER 29: Migrating from v5.2.1.x to 5.3.0.0 and the Undocumented MBasic.....729
Migrating from v5.2.1 .x to 5.3.0.0..........................................................................................729
Undocumented MBasic...........................................................................................................733
APPENDIX A: Parts List and Suppliers........................................................................745
Suppliers.................................................................................................................................745
Generic Components Required................................................................................................746
Specific Components...............................................................................................................748
APPENDIX B: Function Index........................................................................................755
About the Author.........................................................................................................760
Index..............................................................................................................................761
Ключевые теги: Microcontroller
|
|
|
Содержание Оглавление
|
|
|
|
|
Другие новости по теме:
|
|
|
|
|
|
|
|
|
Информация |
|
|
|
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации. |
|
|
|
|
|
|
|
Календарь |
|
|
« Август 2016 »
|
Пн |
Вт |
Ср |
Чт |
Пт |
Сб |
Вс |
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
|
|
|