ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

My Experiences With Microcontrollers - part 1

Updated on April 22, 2018

Introduction

The Microchip Microcontrollers are one of the most popular integrated circuits thanks to low price, small size and convenience to develop all kinds of digital and electronic projects. This electronic device has the next parts: CPU, data memory, program memory, input and output ports, clock, reset, etc.

Microchip manufactures 8, 16 and 32 bit microcontrollers. To begin, we are going to see how the hardware of an 8-bit microcontroller is organized, ie the PIC16F84A. In later chapters we will compare these characteristics with PIC12F675, PIC16F88, PIC16F887, PIC18F2550 and dsPIC30F4013.

I have programmed this type of microcontroller with compilers provided by MPASM, such as: assembler and C ++ (XC8, XC16, C18 and C30). Another very popular compiler is the CCS PICC.

Pines
Pines
PIC16F84A, example with a servo
PIC16F84A, example with a servo

RISC Processor

The CPU of Microchip microcontrollers uses RISC (Reduced Instruction Set Computer) technology. The RISC processors have a Pipeline structure and execute almost all the instructions at the same time. The PIC16F84A is a microcontroller with 35 instructions. The Harvard architecture allows instructions to be executed in one machine cycle or four clock cycles. It has an 8-bit ALU, a PC5 Program Counter and a W work register.

PORTS

The PIC16F84A has two parallel ports A and B, and the lines of these ports can be programmed as inputs and outputs. Port A has 5 lines RA4: RA0, and port B has 8 lines RA7: RA0. The working direction is controlled by the TRISA and TRISB registerS, in which a bit "0" configures the line as output, and a bit "1" as input.

The RA4 port is equipped with a Schmitt Trigger that provides a good help to eliminate noise.

Port B has lines that can be used for internal interruptions, which will be seen later and in more detail. All lines of port B have a pull-up resistance of high value and connected to the power supply, which is enabled with the following instruction in assembly language:


bcf OPTION_REG, NOT_RBPU

FEEDING

The PIC16F84A is powered by 5 volts

OSCILLATOR

The PIC16F84A has five types of oscillators between pins OSC1 / CLKIN and OSC2 / CLKOUT:
1) Quartz crystal: XT
2) Oscillator with resistance and capacitor: RC
3) High speed crystal: HS
4) Crystal for low frequency and low power consumption: LP
5) External clock signal: External

In the PIC16F84A the most used oscillator is the 4 MHz crystal.

RESET

The reset in a microcontroller causes the reset of its operation from scratch (MCLR), this occurs when a logic level of zero is applied.

MEMORY

The PIC16F84A has the following types of memories:
1) Program memory ROM type Flash of 1 k and 14 bits
2) Data memory divided into:
- RAM consisting of 22 records of specific purpose SFR and 68 records of general purpose.
- Data EEPROM formed by 64 registers of 8 bits.

The PIC16F84A has a program memory in which all the instructions of the control and recording program are stored permanently. This microcontroller supports 1000 recordings and is guaranteed for several tens of years.

In the next chapter we will see everything related to the data memory registers and their configuration.

Application Example

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)