Published:2011/8/4 22:43:00 Author:Amy From:SeekIC
By Ron Coates
Several articles using the PIC16 series of Microchip microcomputers have appeared in this magazine but so far there has been little or no practical use of their more powerful cousins in the 18F practical use of their more powerful cousins in the I bl series. The devices in the l8Fxx2 series of microcontroller that has been recently introduced are pin for pin compa with their predecessors from the 16F87x series and incorporate some significant improvements.
In this first of two article instalments we look briefly at the main differences between the 16F and 1 8F series and in detail at the changes to the structure of the RAM (Data Memory). Table 1 summarizes the key features as compared to the 16F series.
There is an increase in ROM and large increase in RAM and this alone will justify their use for some people. But there are lots of other improvements too:
-Up to 40 MHz clock (compared to 20 MHz).
-Single cycle hardv/are multiplier.
-Long look up tables.
-Ability to v/rite to Flash ROM during program operation.
-Many new instructions.
-Much improved addressing for bofh RAM and ROM.
Memory and its access
Among the main improvements over older PIC series is not only the larger amount of ROM and RAM but also the methods of addressing it. Before discussing this in detail we need to clear up some of the terms Microchip uses.
EEPROM is straightforward since it is never referred to as anything but EEPROM. EEPROM is non-volatile, and its contents may be modified not only during chip programming but also by the code executed by the PIC. EEPROM is also the area of memory that is best employed for the storage of user preferences. An example v/ould be the display of a temperature measuring system that could be in Centigrade or Fahrenheit. If the variable that controls this is held in EEPROM, the user can change it and it will then be remembered, even when the power is turned off.
RAM and Flash ROM are referred to by Microchip as data memory and program memory respectively. Confusing, sure, especially on the PIC18F series as large blocks of data in the form of lookup tables v/ould be stored in ROM. Data stored in RAM is lost when the PIC supply voltage is switched off. ROM data, on the other hand, is retained. Both RAM and ROM data may be changed by the running program. In the first application the author used an 18 series chip for, 12 k of ROM was used for data and less than 1 k for program. In this two-part article we will use the terms RAM and ROM for these areas of memory.
Table 2 shows the memory map for the RAM. When we access RAM directly, we only have one byte (the ’address byte’) available to identify the location (address). Typically you would give your RAM locations— usually called registers — a name that relates to their general function and defines them at the start of your program, for example:
COUNT EQU 0x24
The 0x24 is the location (in hex) in the RAM and you only have a range of 256 possible locations. Since there are far more than 256 bytes of RAM, a banking scheme has to be used to access them all. This was also the case in the PIC 16 series but the arrangement in the PIC 18 series is completely different.
There are potentially sixteen banks available, numbered from 0 to 15. Only banks 0, 1, 2 and 15 are implemented in the ’242 or ’442. The ’252 and ’452 have banks 3, 4 and 5 implemented as well. Bank 15 is used by the Special Function Registers so either three or six banks (768 or 1536 bytes) are available for general purpose registers. These banks can be selected using the Bank Select Register BSR but as we shall see, we would not normally need to worry about this.
Reprinted Url Of This Article: http://www.seekic.com/blog/project_solutions/2011/08/04/Goodbye_'16_welcome_PIC_18F__meet_the_PIC18F_series_(part1)_1.html
Print this Page | Comments | Reading(1602)
Author:Ecco Reading(30204)
Author:Ecco Reading(3463)
Author:Ecco Reading(3183)
Author:Ecco Reading(3662)
Author:Ecco Reading(5234)
Author:Ecco Reading(3249)
Author:Ecco Reading(3390)
Author:Ecco Reading(3531)
Author:Ecco Reading(3937)
Author:Ecco Reading(3709)
Author:Ecco Reading(3678)
Author:Ecco Reading(3715)
Author:Ecco Reading(6029)
Author:Ecco Reading(3694)
Author:Ecco Reading(4480)