The Experts below are selected from a list of 4434 Experts worldwide ranked by ideXlab platform
Martin Bates - One of the best experts on this subject based on the ideXlab platform.
-
Chapter 6 – Programming Techniques
PIC Microcontrollers, 2011Co-Authors: Martin BatesAbstract:Publisher Summary This chapter discusses programming techniques and sample programs demonstrating use of the timer, interrupts and data tables are included. Microcontroller (MCU) program execution is driven by a clock signal generated by an internal oscillator, which may be controlled by an external RC circuit or crystal. Accurate event timing and counting are often needed in microcontroller programs. The special file Register timer zero (TMR0) is found in all PIC 16 devices, which is an 8-bit counter/timer Register, which once started runs independently and a block diagram of TMR0 and its associated hardware and control Registers is illustrated by a figure. The simplest mode of operation of TMR0 is counting pulses applied to the relevant input (RA4 in the 16F84A, RA2 in the 16F690), which has the alternative name T0CKI, timer zero clock input. The internal clock is selected as the TMR0 input source by setting the Option Register, Bit 5, to 0, and for accurate timing, a crystal oscillator is necessary, mode XT.
Chuck Hellebuyck - One of the best experts on this subject based on the ideXlab platform.
-
Inside the PIC Microcontroller
Programming PIC Microcontrollers with PICBASIC, 2003Co-Authors: Chuck HellebuyckAbstract:The PicBasic Compiler (PBC) and PicBasic Pro (PBPro) work with the 14-bit core family of Programmable Interface Controller (PIC) microcontrollers, which make the programming very easy. Microchip designed the PICs to share many common attributes, such as memory layout and packaging layout. This chapter describes some of the most common features within PIC Microcontroller devices. Program memory is the space where the PicBasic program resides. In a PIC it is actually 14 bits wide even though PICs are considered 8-bit microcontrollers. Reset vector is the first of very important program memory locations that all 14-bit PICs share. Data memory is where all the variables are stored; this is the RAM. The PIC data memory is also banked just like the program memory. The first section of data memory is reserved for special function Registers. These Registers are the key locations that control most of functions within the PIC. The STATUS Register is located in data memory at location 03h. I/O Registers are the set of Registers that will be used the most. Every I/O port has two Registers that control its operation, a data Register and a direction Register. Analog-to-digital Registers are used specifically to control the A/D ports. One of the features the 14-bit core PICs offer over the 12-bit core PICs is interrupts. An interrupt is an internal hardware circuit that, if enabled, will interrupt the program and jump to another program. The selection of interrupts depends on the PIC device being used. There are two internal Registers to use the internal interrupts: the Option Register and the INTCON Register. The larger PICs have more timers and more Registers to control the added interrupts, serial ports, capture/compare function, serial peripheral controller, and other advanced features.
D.w. Smith - One of the best experts on this subject based on the ideXlab platform.
-
Understanding the headers
PIC in Practice, 2008Co-Authors: D.w. SmithAbstract:This chapter describes the importance of headers in microcontrollers. HEADER84.ASM is the header for the 16F84. This sets PORT A as an INPUT (1 means input) and PORT B as an OUTPUT (0 means output). The Option Register is set to /256 to give timing pulses of 1/32 of a second. The EQUATES section tells the software what numbers the words represent. GOTO makes the program bypass the subroutine section, and GOTO followed by the label START is the position where the device is configured to start before executing the body of the program. DELAYP5 is a similar code but TMR0 is only allowed to count up to 16. The instruction BSF STATUS,5 sets bit 5 in the Status Register. The Special Function Registers enable telling the microcontroller to perform an operation. There are more functions on the 16F818 than the 16F84 so there are more choices in the way it is configured. It is found that the master clear, MCLR, has been switched internally to V dd (5 V), freeing up another I/O line, giving 16 I/O.