Ibrahim Dogan - Advanced PIC Microcontroller Projects in C

Здесь есть возможность читать онлайн «Ibrahim Dogan - Advanced PIC Microcontroller Projects in C» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Город: Burlington, Год выпуска: 2008, ISBN: 2008, Издательство: Elsevier Ltd, Жанр: Программирование, Компьютерное железо, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Advanced PIC Microcontroller Projects in C: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Advanced PIC Microcontroller Projects in C»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

• The only project book on the PIC 18 series using the C programming language
• Features 20 complete, tried and test projects
• Includes a CD-ROM of all the programs, hex listings, diagrams, and data sheets

Advanced PIC Microcontroller Projects in C — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Advanced PIC Microcontroller Projects in C», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

a) 23 b) 128 c) 255 d) 1023

e) 120 f) 32000 g) 160 h) 250

15. Convert the following binary numbers into decimal:

a) 1111 b) 0110 c) 11110000

d) 00001111 e) 10101010 f) 10000000

16. Convert the following octal numbers into decimal:

a) 177 b) 762 c) 777 d) 123

e) 1777 f) 655 g) 177777 h) 207

17. Convert the following decimal numbers into octal:

a) 255 b) 1024 c) 129 d) 2450

e) 4096 f) 256 g) 180 h) 4096

18. Convert the following hexadecimal numbers into decimal:

a) AA b) EF c) 1FF d) FFFF

e) 1AA f) FEF g) F0 h) CC

19. Convert the following binary numbers into hexadecimal:

a) 0101 b) 11111111 c) 1111 d) 1010

e) 1110 f) 10011111 g) 1001 h) 1100

20. Convert the following binary numbers into octal:

a) 111000 b) 000111 c) 1111111 d) 010111

e) 110001 f) 11111111 g) 1000001 h) 110000

21. Convert the following octal numbers into binary:

a) 177 b) 7777 c) 555 d) 111

e) 1777777 f) 55571 g) 171 h) 1777

22. Convert the following hexadecimal numbers into octal:

a) AA b) FF c) FFFF d) 1AC

e) CC f) EE g) EEFF h) AB

23. Convert the following octal numbers into hexadecimal:

a) 177 b) 777 c) 123 d) 23

e) 1111 f) 17777777 g) 349 h) 17

24. Convert the following decimal numbers into floating point:

a) 23.45 b) 1.25 c) 45.86 d) 0.56

25. Convert the following decimal numbers into floating point and then calculate their sum:

0.255 and 1.75

26. Convert the following decimal numbers into floating point and then calculate their product:

2.125 and 3.75

27. Convert the following decimal numbers into BCD:

a) 128 b) 970 c) 900 d) 125

CHAPTER 2

PIC18F Microcontroller Series

PIC16-series microcontrollers have been around for many years. Although these are excellent general purpose microcontrollers, they have certain limitations. For example, the program and data memory capacities are limited, the stack is small, and the interrupt structure is primitive, all interrupt sources sharing the same interrupt vector. PIC16-series microcontrollers also do not provide direct support for advanced peripheral interfaces such as USB, CAN bus, etc., and interfacing with such devices is not easy. The instruction set for these microcontrollers is also limited. For example, there are no multiplication or division instructions, and branching is rather simple, being a combination of skip and goto instructions.

Microchip Inc. has developed the PIC18 series of microcontrollers for use in high-pincount, high-density, and complex applications. The PIC18F microcontrollers offer cost-efficient solutions for general purpose applications written in C that use a real-time operating system (RTOS) and require a complex communication protocol stack such as TCP/IP, CAN, USB, or ZigBee. PIC18F devices provide flash program memory in sizes from 8 to 128Kbytes and data memory from 256 to 4Kbytes, operating at a range of 2.0 to 5.0 volts, at speeds from DC to 40MHz.

The basic features of PIC18F-series microcontrollers are:

• 77 instructions

• PIC16 source code compatible

• Program memory addressing up to 2 Mbytes

• Data memory addressing up to 4 Kbytes

• DC to 40MHz operation

• 8×8 hardware multiplier

• Interrupt priority levels

• 16-bit-wide instructions, 8-bit-wide data path

• Up to two 8-bit timers/counters

• Up to three 16-bit timers/counters

• Up to four external interrupts

• High current (25mA) sink/source capability

• Up to five capture/compare/PWM modules

• Master synchronous serial port module (SPI and I²C modes)

• Up to two USART modules

• Parallel slave port (PSP)

• Fast 10-bit analog-to-digital converter

• Programmable low-voltage detection (LVD) module

• Power-on reset (POR), power-up timer (PWRT), and oscillator start-up timer (OST)

• Watchdog timer (WDT) with on-chip RC oscillator

• In-circuit programming

In addition, some microcontrollers in the PIC18F family offer the following special features:

• Direct CAN 2.0 bus interface

• Direct USB 2.0 bus interface

• Direct LCD control interface

• TCP/IP interface

• ZigBee interface

• Direct motor control interface

Most devices in the PIC18F family are source compatible with each other. Table 2.1 gives the characteristics of some of the popular devices in this family. This chapter offers a detailed study of the PIC18FXX2 microcontrollers. The architectures of most of the other microcontrollers in the PIC18F family are similar.

Table 2.1: The 18FXX2 microcontroller family

Feature PIC18F242 PIC18F252 PIC18F442 PIC18F452
Program memory (Bytes) 16K 32K 16K 32K
Data memory (Bytes) 768 1536 768 1536
EEPROM (Bytes) 256 256 256 256
I/O Ports A,B,C A,B,C A,B,C,D,E A,B,C,D,E
Timers 4 4 4 4
Interrupt sources 17 17 18 18
Capture/compare/PWM 2 2 2 2
Serial communication MSSP USART MSSP USART MSSP USART MSSP USART
A/D converter (10-bit) 5 channels 5 channels 8 channels 8 channels
Low-voltage detect yes yes yes yes
Brown-out reset yes yes yes yes
Packages 28-pin DIP 28-pin SOIC 28-pin DIP 28-pin SOIC 40-pin DIP 44-pin PLCC 44-pin TQFP 40-pin DIP 44-pin PLCC 44-pin TQFP

The reader may be familiar with the programming and applications of the PIC16F series. Before going into the details of the PIC18F series, it is worthwhile to compare the features of the PIC18F series with those of the PIC16F series.

The following are similarities between PIC16F and PIC18F:

• Similar packages and pinouts

• Similar special function register (SFR) names and functions

• Similar peripheral devices

• Subset of PIC18F instruction set

• Similar development tools

The following are new with the PIC18F series:

• Number of instructions doubled

• 16-bit instruction word

• Hardware 8×8 multiplier

• More external interrupts

• Priority-based interrupts

• Enhanced status register

• Increased program and data memory size

• Bigger stack

• Phase-locked loop (PLL) clock generator

• Enhanced input-output port architecture

• Set of configuration registers

• Higher speed of operation

• Lower power operation

2.1 PIC18FXX2 Architecture

As shown in Table 2.1, the PIC18FXX2 series consists of four devices. PIC18F2X2 microcontrollers are 28-pin devices, while PIC18F4X2 microcontrollers are 40-pin devices. The architectures of the two groups are almost identical except that the larger devices have more input-output ports and more A/D converter channels. In this section we shall be looking at the architecture of the PIC18F452 microcontroller in detail. The architectures of other standard PIC18F-series microcontrollers are similar, and the knowledge gained in this section should be enough to understand the operation of other PIC18F-series microcontrollers.

The pin configuration of the PIC18F452 microcontroller (DIP package) is shown in Figure 2.1. This is a 40-pin microcontroller housed in a DIL package, with a pin configuration similar to the popular PIC16F877.

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Advanced PIC Microcontroller Projects in C»

Представляем Вашему вниманию похожие книги на «Advanced PIC Microcontroller Projects in C» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Advanced PIC Microcontroller Projects in C»

Обсуждение, отзывы о книге «Advanced PIC Microcontroller Projects in C» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x