Section 14. Timer1 HIGHLIGHTS. Timer1. This section of the manual contains the following major topics:

Size: px
Start display at page:

Download "Section 14. Timer1 HIGHLIGHTS. Timer1. This section of the manual contains the following major topics:"

Transcription

1 Section 14. Timer1 HIGHLIGHTS This section of the manual contains the following major topics: 14.1 Introduction Control Register Timer1 Operation in Timer Mode Timer1 Operation in Synchronized Counter Mode Timer1 Operation in Asynchronous Counter Mode Reading and Writing of Timer Timer1 Oscillator Typical Application Sleep Operation Resetting Timer1 Using a CCP Trigger Output Resetting Timer1 Register Pair (TMR1H:TMR1L) Timer1 Prescaler Initialization Design Tips Related Application Notes Revision History Timer Microchip Technology Inc. DS39514A-page 14-1

2 PIC18C Reference Manual 14.1 Introduction The Timer1 module is a 16-bit timer/counter consisting of two 8-bit registers (TMR1H and TMR1L) that are readable and writable. The TMR1 register pair (TMR1H:TMR1L) increments from 0000h to FFFFh and rolls over to 0000h. If enabled, the Timer1 Interrupt is generated on overflow that is latched in the TMR1IF interrupt flag bit. This interrupt can be enabled/disabled by setting/clearing the TMR1IE interrupt enable bit. Timer1 can operate in one of three modes: As a synchronous timer As a synchronous counter As an asynchronous counter The operating mode is determined by clock select bit, TMR1CS (T1CON register), and the synchronization bit, T1SYNC (Figure 14-1). In timer mode, Timer1 increments every instruction cycle. In counter mode, it increments on every rising edge of the external clock input pin T1OSI. Timer1 can be turned on and off using thetmr1on control bit (T1CON register). Timer1 also has an internal reset input, which can be generated by a CCP module. Timer1 has the capability to operate off an external crystal. When the Timer1 oscillator is enabled (T1OSCEN is set), the T1OSI and T1OSO pins become inputs, so their corresponding TRIS values are ignored. Figure 14-1: Timer1 Block Diagram Set TMR1IF flag bit on Overflow TMR1 CLR TMR1H TMR1L T1OSO/T1CKI T1OSI T1OSC T1OSCEN Enable Oscillator (1) Fosc/4 Internal Clock CCP Special Event Trigger TMR1ON on/off 1 0 TMR1CS 0 1 T1SYNC Prescaler 1, 2, 4, 8 2 T1CKPS1:T1CKPS0 Synchronized Clock Input Synchronize det SLEEP input Note 1: When enable bit T1OSCEN is cleared, the inverter and feedback resistor are turned off. This eliminates power drain. DS39514A-page Microchip Technology Inc.

3 Section 14. Timer1 Figure 14-2:Timer1 Block Diagram 16-Bit Read/Write Mode Data Bus<7:0> 8 Write TMR1L Read TMR1L TMR1H 8 8 TMR1IF Overflow Interrupt flag bit T13CKI/ T1OSO T1OSI 8 TMR1 Timer 1 TMR1L High Byte T1OSCEN Enable Oscillator (1) Fosc/4 Internal Clock TMR1ON on/off T1SYNC 1 Prescaler 1, 2, 4, TMR1CS T1CKPS1:T1CKPS0 0 1 Synchronized Clock Input Synchronize det SLEEP input Note 1: When enable bit T1OSCEN is cleared, the inverter and feedback resistor are turned off. This eliminates power drain. 14 Timer Microchip Technology Inc. DS39514A-page 14-3

4 PIC18C Reference Manual 14.2 Control Register Register 14-1 shows the Timer1 Control register. This register controls the operating mode of the Timer1 module and contains the Timer1 oscillator enable bit (T1OSCEN). Register 14-1: T1CON: Timer1 Control Register R/W-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 RD16 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON bit 7 bit 0 bit 7 bit 6 bit 5:4 bit 3 bit 2 bit 1 bit 0 RD16: 16-bit Read/Write Mode Enable bit 1 = Enables register Read/Write of Timer1 in one 16-bit operation 0 = Enables register Read/Write of Timer1 in two 8-bit operations Unimplemented: Read as '0' T1CKPS1:T1CKPS0: Timer1 Input Clock Prescale Select bits 11 = 1:8 Prescale value 10 = 1:4 Prescale value 01 = 1:2 Prescale value 00 = 1:1 Prescale value T1OSCEN: Timer1 Oscillator Enable bit 1 = Timer1 Oscillator is enabled 0 = Timer1 Oscillator is shut off. The oscillator inverter and feedback resistor are turned off to eliminate power drain. T1SYNC: Timer1 External Clock Input Synchronization Select bit When TMR1CS = 1: 1 = Do not synchronize external clock input 0 = Synchronize external clock input When TMR1CS = 0: This bit is ignored. Timer1 uses the internal clock when TMR1CS = 0. TMR1CS: Timer1 Clock Source Select bit 1 = External clock from pin T1OSO/T13CKI (on the rising edge) 0 = Internal clock (FOSC/4) TMR1ON: Timer1Onbit 1 = Enables Timer1 0 =StopsTimer1 Legend R = Readable bit W = Writable bit U = Unimplemented bit, read as 0 - n = Value at POR reset 1 = bit is set 0 = bit is cleared x = bit is unknown DS39514A-page Microchip Technology Inc.

5 Section 14. Timer Timer1 Operation in Timer Mode Timer mode is selected by clearing the TMR1CS (T1CON register) bit. In this mode, the input clock to the timer is FOSC/4. The synchronize control bit, T1SYNC (T1CON register), has no effect since the internal clock is always synchronized Timer1 Operation in Synchronized Counter Mode Counter mode is selected by setting the TMR1CS bit. In this mode, the timer increments on every rising edge of clock input on the T1OSI pin when the Timer1 oscillator enable bit (T1OSCEN) is set, or the T1OSO/T13CKI pin when the T1OSCEN bit is cleared. If the T1SYNC bit is cleared, then the external clock input is synchronized with internal phase clocks. The synchronization is done after the prescaler stage. The prescaler operates asynchronously. The timer increments at the Q4:Q1 edge. In this configuration, during SLEEP mode, Timer1 will not increment even if the external clock is present, since the synchronization circuit is shut off. The prescaler however will continue to increment External Clock Input Timing for Synchronized Counter Mode When an external clock input is used for Timer1 in synchronized counter mode, it must meet certain requirements. The external clock requirement is due to internal phase clock (TSCLK) synchronization. Also, there is a delay in the actual incrementing of TMR1 after synchronization. When the prescaler is 1:1, the external clock input is the same as the prescaler output. The synchronization of T1CKI with the internal phase clocks is accomplished by sampling the prescaler output on alternating TscLK clocks of the internal phase clocks. Therefore, it is necessary for the T1CKI pin to be high for at least 2TscLK (and a small RC delay) and low for at least 2TscLK (and a small RC delay). Refer to parameters 45, 46, and 47 in the Electrical Specifications section. When a prescaler other than 1:1 is used, the external clock input is divided by the asynchronous prescaler so that the prescaler output is symmetrical. In order for the external clock to meet the sampling requirement, the prescaler counter must be taken into account. Therefore, it is necessary for the T1CKI pin to have a period of at least 4TscLK (and a small RC delay) divided by the prescaler value. Another requirement on the T1CKI pin high and low time is that they do not violate the minimum pulse width requirements). Refer to parameters 40, 42, 45, 46, and47 in the Electrical Specifications section. 14 Timer Microchip Technology Inc. DS39514A-page 14-5

6 PIC18C Reference Manual 14.5 Timer1 Operation in Asynchronous Counter Mode If T1SYNC (T1CON register) is set, the external clock input is not synchronized. The timer continues to increment asynchronously to the internal phase clocks. The timer will continue to run during SLEEP and can generate an interrupt on overflow that will wake-up the processor. However, special precautions in software are needed to read/write the timer (Subsection Reading and Writing Timer1 in Asynchronous Counter Mode with RD16 = 0 ). Since the counter can operate in sleep, Timer1 can be used to implement a true real-time clock. The timer increments at the Q4:Q1 and Q2:Q3 edges. In asynchronous counter mode, Timer1 cannot be used as a time-base for capture or compare operations External Clock Input Timing with Unsynchronized Clock If the T1SYNC control bit is set, the timer will increment completely asynchronously. The input clock must meet certain minimum high time and low time requirements. Refer to the Device Data Sheet Electrical Specifications section, timing parameters 45, 46, and 47. DS39514A-page Microchip Technology Inc.

7 Section 14. Timer Reading and Writing of Timer1 Timer1 has modes that allow the 16-bit timer register to be read/written as two 8-bit registers or one 16-bit register. The mode depends on the state of the RD16 bit. The following subsections discuss this operation Timer1 and 16-bit Read/Write Modes bit Mode Timer Write bit Read-Modify-Write Timer1 can be configured for 16-bit reads and writes. When the RD16 control bit (T1CON register) is set, the address for TMR1H is mapped to a buffer register for the high byte of Timer1. A read from TMR1L will load the contents of the high byte of Timer1 into the Timer1 high byte buffer. This provides the user with the ability to accurately read all 16 bits of Timer1 without having to determine whether a read of the high byte followed by a read of the low byte is valid due to a rollover between reads. AwritetothehighbyteofTimer1mustalsotakeplacethroughtheTMR1Hbufferregister.Timer1 high byte is updated with the contents of TMR1H when a write occurs to TMR1L. This allows a user to write all 16 bits to both the high and low bytes of Timer1 at once (See Figure 14-3). The high byte of Timer1 is not directly readable or writable in this mode. All reads and writes must take place through the Timer1 high byte buffer register. Writes to TMR1H do not clear the Timer1 prescaler. The prescaler is only cleared on writes to TMR1L. Read-modify-write instructions like BSF or BCF will read the contents of a register, make the appropriate changes, and place the result back into the register. In the case of Timer1 when configured in 16-bit mode, the read portion of a read-modify-write instruction of TMR1L will not update the contents of the TMR1H buffer. The TMR1H buffer will remain unchanged. When the write of TMR1L portion of the instruction takes place, the contents of TMR1H will be placed into thehighbyteoftimer1. Figure 14-3:Timer1 Block Diagram When Configured in 16-bit Read/Write Mode Data Bus<7:0> Write TMR1L Read TMR1L TMR1IF Overflow Interrupt flag bit T13CKI/ T1OSO 8 8 TMR1H 8 TMR1 Timer 1 high byte TMR1L T1OSC 8 T1OSCEN Enable Oscillator (1) TTIP FOSC/4 Internal Clock TMR1ON on/off T1SYNC 1 Prescaler 1, 2, 4, TMR1CS T1CKPS1:T1CKPS0 0 1 Synchronized Clock Input Synchronize det SLEEP input 14 Timer1 Note 1: When enable bit T1OSCEN is cleared, the inverter and feedback resistor are turned off. This eliminates power drain Microchip Technology Inc. DS39514A-page 14-7

8 PIC18C Reference Manual Reading and Writing Timer1 in Asynchronous Counter Mode with RD16 = 0 Reading TMR1H or TMR1L while the timer is running from an external asynchronous clock will ensure a valid read (taken care of in hardware). However, the user should keep in mind that reading the 16-bit timer in two 8-bit values itself poses certain problems, since the timer may overflow between the reads. For writes, it is recommended that the user simply stop the timer and write the desired values. A write contention may occur by writing to the timer registers while the register is incrementing. This may produce an unpredictable value in the timer register. Reading the 16-bit value requires some care, since two separate reads are required to read the entire 16-bits. Example 14-1 shows why this may not be a straight forward read of the 16-bit register. Example 14-1: Reading 16-bit Register Issues TMR1 Sequence 1 Sequence 2 Action TMPH:TMPL Action TMPH:TMPL 04FFh READ TMR1L xxxxh READ TMR1H xxxxh 0500h StoreinTMPL xxffh StoreinTMPH 04xxh 0501h READ TMR1H xxffh READ TMR1L 04xxh 0502h StoreinTMPH 05FFh StoreinTMPL 0401h DS39514A-page Microchip Technology Inc.

9 Section 14. Timer1 Example 14-2 shows a routine to read the 16-bit timer value without experiencing the issues shown in Example This is useful if the timer cannot be stopped. Example 14-2: Reading a 16-bit Free-Running Timer All interrupts are disabled MOVF TMR1H, W Read high byte MOVWF TMPH MOVF TMR1L, W Read low byte MOVWF TMPL MOVF TMR1H, W Read high byte SUBWF TMPH, W Sub 1st read with 2nd read BTFSC STATUS,Z Is result = 0 GOTO CONTINUE Good 16-bit read TMR1L may have rolled over between the read of the high and low bytes. Reading the high and low bytes now will read a good value. MOVF TMR1H, W Read high byte MOVWF TMPH MOVF TMR1L, W Read low byte MOVWF TMPL Re-enable the Interrupt (if required) CONTINUE Continue with your code Writing a 16-bit value to the 16-bit TMR1 register is straightforward. First the TMR1L register is cleared to ensure that there are many Timer1 clock/oscillator cycles before there is a rollover into the TMR1H register. The TMR1H register is then loaded, and finally the TMR1L register is loaded. Example 14-3 shows a routine that does a 16-bit write to a Free Running Timer. Example 14-3: Writing a 16-bit Free Running Timer All interrupts are disabled CLRF TMR1L Clear Low byte, Ensures no rollover into TMR1H MOVLW HI_BYTE Value to load into TMR1H MOVWF TMR1H, F Write High byte MOVLW LO_BYTE Value to load into TMR1L MOVWF TMR1H, F Write Low byte Re-enable the Interrupt (if required) CONTINUE Continue with your code 14 Timer Microchip Technology Inc. DS39514A-page 14-9

10 PIC18C Reference Manual 14.7 Timer1 Oscillator An alternate crystal oscillator circuit is built into the device. The output of this oscillator can be selected as the input into Timer1. The Timer1 oscillator is primarily intended to operate as a timebase for the timer modules therefore, the oscillator is primarily intended for a 32 khz crystal, which is an ideal frequency for real-time keeping. In real-time applications, the timer needs to increment during SLEEP, so SLEEP does not disable the Timer1 oscillator. For many applications, power consumption is also an issue, so the oscillator is designed to minimize power consumption. The Timer1 oscillator is enabled by setting the T1OSCEN control bit (T1CON register). After the Timer1 oscillator is enabled, the user must provide a software time delay to ensure proper oscillator start-up. Table 14-1 shows the capacitor selection for the Timer1 oscillator. Note: The Timer1 oscillator allows the counter to operate (increment) when the device is in sleep mode. This allows Timer1 to be used as a real-time clock. Table 14-1: Capacitor Selection for the Timer1 Oscillator Osc Type Freq C1 C2 LP 32 khz 33 pf 33 pf 100 khz 15 pf 15 pf 200 khz 15 pf 15 pf Crystals Tested: khz Epson C-001R32.768K-A ± 20 PPM 100 khz Epson C KC-P ± 20 PPM 200 khz STD XTL khz ± 20 PPM Note 1: Higher capacitance increases the stability of oscillator but also increases the start-up time. 2: Since each resonator/crystal has its own characteristics, the user should consult the resonator/crystal manufacturer for appropriate values of external components. DS39514A-page Microchip Technology Inc.

11 Section 14. Timer Typical Application In Figure 14-4 an example application is given, where Timer1 is driven from an external 32 khz oscillator. The external 32 khz oscillator is typically used in applications where real-time needs to be kept, but it is also desirable to have the lowest possible power consumption. The Timer1 oscillator allows the device to be placed in sleep while the timer continues to increment. When Timer1 overflows, the interrupt wakes up the device so that the appropriate registers can be updated. Figure 14-4: Timer1 Application Power-Down Detect OSC1 8 VDD 4 Current Sink Backup Battery TMR1 4 TT1P 32 khz T1OSI T1OSO VSS 4 4x4 Keypad In this example, a 32 khz crystal is used as the time base for the Real Time Clock. If the clock needs to be updated at 1 second intervals, then the Timer1 must be loaded with a value to allow the Timer1 to overflow at the desired rate. In the case of a 1 second Timer1 overflow, the TMR1H register should be loaded with a value of 80k after each overflow. Note: The TMR1L register should never be modified, since an external clock is asychronous to the system clock. Writes to the TRM1L register may corrupt the real time counter value causing inaccuracies. 14 Timer Microchip Technology Inc. DS39514A-page 14-11

12 PIC18C Reference Manual 14.9 Sleep Operation When Timer1 is configured for asynchronous operation, the TMR1 registers will continue to increment for each timer clock (or prescale multiple of clocks). When the TMR1 register overflows, the TMR1IF bit will get set. If enabled, this will generate an interrupt that will wake the processor from sleep mode. The Timer1 oscillator will add a delta current, due to the operation of this circuitry. That is, the power-down current will no longer only be the leakage current of the device, but also the active current of the Timer1 oscillator and other circuitry Resetting Timer1 Using a CCP Trigger Output If a CCP module is configured in compare mode to generate a Special Event Trigger (CCP1M3:CCP1M0 = 1011), this signal resets Timer1. Note: Timer1 must be configured for either timer or synchronized counter mode to take advantage of the special event trigger feature. If Timer1 is running in asynchronous counter mode, this reset operation may not work and should not be used. In the event that a write to Timer1 coincides with a special event trigger from the CCP module, the write will take precedence. In this mode of operation, the CCPRxH:CCPRxL register pair effectively becomes the period register for Timer CCP Trigger and A/D Module The special event trigger from the CCP module does not set interrupt flag bit TMR1IF. Some devices that have the CCP Trigger capability also have an A/D module. These devices may be able to be configured, so the Special Event Trigger not only resets the Timer1 registers, 0but will start an A/D conversion. This allows a constant sampling rate for the A/D, as specified by the value of the compare registers. DS39514A-page Microchip Technology Inc.

13 Section 14. Timer Resetting Timer1 Register Pair (TMR1H:TMR1L) TMR1H and TMR1L registers are not cleared on any reset, only by the CCP special event triggers. T1CON register is reset to 00h on a Power-on Reset or a Brown-out Reset. In any other reset, the register is unaffected. Timer1 is the default time base for the CCP1 and CCP2 modules. The timer can be disabled as the time base for either CCP1, CCP2, or both, and Timer3 can be substituted. This is achieved by setting control bits in the Timer3 control register. This is explained in Section Timer3 and CCPx Enable. When Timer1 is disabled as a the time base for a CCP, the reset on Compare will have no effect on Timer Timer1 Prescaler The prescaler counter is cleared on writes to the TMR1H or TMR1L registers Timer1 Prescaler 16-bit Read/WriteMode Writes to TMR1H do not clear the Timer1 prescaler in 16-bit read/write mode, because a write to TMR1H only modifies the Timer1 latch and does not change the contents of Timer1. The prescaler is only cleared on writes to TMR1L. Table 14-2:Registers Associated with Timer1 as a Timer/Counter Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Value on: POR, BOR Value on all other resets INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF x u PIR TMR1IE (1) 0 0 PIE TMR1IE (1) 0 0 IPR TMR1IP (1) 0 0 TMR1L Holding register for the Least Significant Byte of the 16-bit TMR1 register xxxx xxxx uuuu uuuu TMR1H Holding register for the Most Significant Byte of the 16-bit TMR1 register xxxx xxxx uuuu uuuu T1CON RD16 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON uu uuuu Legend: x = unknown,u = unchanged,- = unimplemented read as '0'. Shaded cells are not used by the Timer1 module. Note 1: The placement of this bit is device dependent. 14 Timer Microchip Technology Inc. DS39514A-page 14-13

14 PIC18C Reference Manual Initialization Since Timer1 has a software programmable clock source, there are three examples to show the initialization of each mode. Example 14-4 shows the initialization for the internal clock source, Example 14-5 shows the initialization for the external clock source, and Example 14-6 shows the initialization of the external oscillator mode. Example 14-4: Timer1 Initialization (Internal Clock Source) CLRF T1CON Stop Timer1, Internal Clock Source, T1 oscillator disabled, prescaler = 1:1 CLRF TMR1H Clear Timer1 High byte register CLRF TMR1L Clear Timer1 Low byte register CLRF INTCON Disable interrupts CLRF PIE1 Disable peripheral interrupts CLRF PIR1 Clear peripheral interrupts Flags MOVLW 0x30 Internal Clock source with 1:8 prescaler MOVWF T1CON Timer1 is stopped and T1 osc is disabled BSF T1CON, TMR1ON Timer1 starts to increment The Timer1 interrupt is disabled, do polling on the overflow bit T1_OVFL_WAIT BTFSS PIR1, TMR1IF GOTO T1_OVFL_WAIT Timer has overflowed BCF PIR1, TMR1IF Example 14-5: Timer1 Initialization (External Clock Source) CLRF T1CON Stop Timer1, Internal Clock Source, T1 oscillator disabled, prescaler = 1:1 CLRF TMR1H Clear Timer1 High byte register CLRF TMR1L Clear Timer1 Low byte register CLRF INTCON Disable interrupts CLRF PIE1 Disable peripheral interrupts CLRF PIR1 Clear peripheral interrupts Flags MOVLW 0x32 External Clock source with 1:8 prescaler MOVWF T1CON Clock source is synchronized to device Timer1 is stopped and T1 osc is disabled BSF T1CON, TMR1ON Timer1 starts to increment The Timer1 interrupt is disabled, do polling on the overflow bit T1_OVFL_WAIT BTFSS PIR1, TMR1IF GOTO T1_OVFL_WAIT Timer has overflowed BCF PIR1, TMR1IF DS39514A-page Microchip Technology Inc.

15 Section 14. Timer1 Example 14-6: Timer1 Initialization (External Oscillator Clock Source) CLRF T1CON Stop Timer1, Internal Clock Source, T1 oscillator disabled, prescaler = 1:1 CLRF TMR1H Clear Timer1 High byte register CLRF TMR1L Clear Timer1 Low byte register CLRF INTCON Disable interrupts CLRF PIE1 Disable peripheral interrupts CLRF PIR1 Clear peripheral interrupts Flags MOVLW 0x3E External Clock source with oscillator MOVWF T1CON circuitry, 1:8 prescaler, Clock source is asynchronous to device Timer1 is stopped BSF T1CON, TMR1ON Timer1 starts to increment The Timer1 interrupt is disabled, do polling on the overflow bit T1_OVFL_WAIT BTFSS PIR1, TMR1IF GOTO T1_OVFL_WAIT Timer has overflowed BCF PIR1, TMR1IF 14 Timer Microchip Technology Inc. DS39514A-page 14-15

16 PIC18C Reference Manual Design Tips Question 1: Timer1 does not seem to be keeping accurate time. Answer 1: There are a few reasons that this could occur: 1. You should never write to Timer1 where that could cause the loss of time. In most cases, that means you should not write to the TMR1L register, but if the conditions are OK, you may write to the TMR1H register. Normally, you write to the TMR1H register if you want the Timer1 overflow interrupt to be sooner than the full 16-bit time-out. 2. You should ensure that your layout uses good PCB layout techniques so noise does not couple onto the Timer1/Timer3 oscillator lines. DS39514A-page Microchip Technology Inc.

17 Section 14. Timer Related Application Notes This section lists application notes that are related to this section of the manual. These application notes may not be written specifically for the Enhanced family (that is they may be written for the Baseline, the Midrange, or High-end families), but the concepts are pertinent, and could be used (with modification and possible limitations). The current application notes related to Timer1 are: Title Application Note # Using Timer1 in Asynchronous Clock Mode AN580 Low Power Real Time Clock AN582 Yet another Clock using the PIC16C92X AN649 Note: Please visit the Microchip Web site for additional software code examples. These code examples are stand alone examples to assist in the understanding of the PIC18CXXX. The web address for these examples is: 14 Timer Microchip Technology Inc. DS39514A-page 14-17

18 PIC18C Reference Manual Revision History Revision A This is the initial released revision of the Timer1 module description. DS39514A-page Microchip Technology Inc.

Section 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics:

Section 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics: Section 13. Timer0 HIGHLIGHTS This section of the manual contains the following major topics: 13.1 Introduction... 13-2 13.2 Control Register... 13-3 13.3 Operation... 13-4 13.4 Timer0 Interrupt... 13-5

More information

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:

Section 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics: M 11 Section 11. HIGHLIGHTS This section of the manual contains the following major topics: 11.1 Introduction...11-2 11.2 Control Register...11-3 11.3 Operation...11-4 11.4 TMR0 Interrupt...11-5 11.5 Using

More information

EE6008-Microcontroller Based System Design Department Of EEE/ DCE

EE6008-Microcontroller Based System Design Department Of EEE/ DCE UNIT- II INTERRUPTS AND TIMERS PART A 1. What are the interrupts available in PIC? (Jan 14) Interrupt Source Enabled by Completion Status External interrupt from INT INTE = 1 INTF = 1 TMR0 interrupt T0IE

More information

Section 16. Basic Sychronous Serial Port (BSSP)

Section 16. Basic Sychronous Serial Port (BSSP) M 16 Section 16. Basic Sychronous Serial Port (BSSP) BSSP HIGHLIGHTS This section of the manual contains the following major topics: 16.1 Introduction...16-2 16.2 Control Registers...16-3 16.3 SPI Mode...16-6

More information

Section 24. Comparator

Section 24. Comparator Section 24. HIGHLIGHTS This section of the manual contains the following major topics: 24.1 Introduction... 24-2 24.2 Control Register... 24-3 24.3 Configuration... 24-4 24.4 Operation... 24-6 24.5 Reference...

More information

Section 28. WDT and SLEEP Mode

Section 28. WDT and SLEEP Mode Section 28. WDT and SLEEP Mode HIGHLIGHTS This section of the manual contains the following major topics: 28 28.1 Introduction... 28-2 28.2 Control Register... 28-3 28.3 Watchdog Timer (WDT) Operation...

More information

PIC16C7X 11.0 SYNCHRONOUS SERIAL PORT (SSP) MODULE SSP Module Overview. Applicable Devices

PIC16C7X 11.0 SYNCHRONOUS SERIAL PORT (SSP) MODULE SSP Module Overview. Applicable Devices Applicable Devices PIC16C7X 11.0 SYNCHRONOUS SERIAL PORT (SSP) MODULE 11.1 SSP Module Overview The Synchronous Serial Port (SSP) module is a serial interface useful for communicating with other peripheral

More information

Section 21. Addressable USART

Section 21. Addressable USART 21 Section 21. Addressable USART Addressable USART HIGHLIGHTS This section of the manual contains the following major topics: 21.1 Introduction... 21-2 21.2 Control Registers... 21-3 21.3 USART Baud Rate

More information

CENG-336 Introduction to Embedded Systems Development. Timers

CENG-336 Introduction to Embedded Systems Development. Timers CENG-336 Introduction to Embedded Systems Development Timers Definitions A counter counts (possibly asynchronous) input pulses from an external signal A timer counts pulses of a fixed, known frequency

More information

These 3 registers contain enable, priority,

These 3 registers contain enable, priority, 8.3.2) Registers Related to Interrupts These registers enable/disable the interrupts, set the priority of the interrupts, and record the status of each interrupt source. RCON INTCON, INTCON2, and INTCON3

More information

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch.

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch. Introduction to microprocessors Feisal Mohammed 3rd January 2001 Additional features 1 Input/Output Ports One of the features that differentiates a microcontroller from a microprocessor is the presence

More information

M PIC16F84A. 18-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller. High Performance RISC CPU Features: Pin Diagrams. Peripheral Features:

M PIC16F84A. 18-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller. High Performance RISC CPU Features: Pin Diagrams. Peripheral Features: M PIC6F84A 8-pinEnhanced FLASH/EEPROM 8-Bit Microcontroller High Performance RISC CPU Features: Pin Diagrams Only 35 single word instructions to learn All instructions single-cycle except for program branches

More information

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory 0907334 6 Experiment 6:Timers Objectives To become familiar with hardware timing

More information

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features

PIC16C52. EPROM-Based 8-Bit CMOS Microcontroller PIC16C52. Pin Diagrams. Feature Highlights. High-Performance RISC CPU. Peripheral Features This document was created with FrameMaker 404 PIC16C52 EPROM-Based 8-Bit CMOS Microcontroller Feature Highlights Pin Diagrams Program Memory Data Memory I/O PDIP, SOIC 384 25 12 High-Performance RISC CPU

More information

Hardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed

Hardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 18th February 2002 CLR Part V Hardware Interfacing There are several features of computers/microcontrollers which have not

More information

PIC16C84. 8-bit CMOS EEPROM Microcontroller PIC16C84. Pin Diagram. High Performance RISC CPU Features: CMOS Technology: Peripheral Features:

PIC16C84. 8-bit CMOS EEPROM Microcontroller PIC16C84. Pin Diagram. High Performance RISC CPU Features: CMOS Technology: Peripheral Features: 8-bit CMOS EEPROM Microcontroller High Performance RISC CPU Features: Only 35 single word instructions to learn All instructions single cycle (400 ns @ 10 MHz) except for program branches which are two-cycle

More information

Section 8. Reset. Reset HIGHLIGHTS. This section of the manual contains the following topics:

Section 8. Reset. Reset HIGHLIGHTS. This section of the manual contains the following topics: Section 8. HIGHLIGHTS This section of the manual contains the following topics: 8.1 Introduction... 8-2 8.2 Clock Source Selection at... 8-5 8.3 POR: Power-on... 8-5 8.4 External (EXTR)... 8-7 8.5 Software

More information

PIC12F629/675 Data Sheet

PIC12F629/675 Data Sheet M PIC12F62/675 Data Sheet 8-Pin FLASH-Based 8-Bit CMOS Microcontrollers 2002 Microchip Technology Inc. Preliminary DS4110A Note the following details of the code protection feature on PICmicro MCUs. The

More information

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features:

PIC16F84A. 18-pin Enhanced Flash/EEPROM 8-Bit Microcontroller. Devices Included in this Data Sheet: Pin Diagrams. High Performance RISC CPU Features: M PIC6F84A 8-pin Enhanced Flash/EEPROM 8-Bit Microcontroller Devices Included in this Data Sheet: PIC6F84A Extended voltage range device available (PIC6LF84A) High Performance RISC CPU Features: Only 35

More information

PIC16C432 OTP 8-Bit CMOS MCU with LIN bus Transceiver

PIC16C432 OTP 8-Bit CMOS MCU with LIN bus Transceiver OTP 8-Bit CMOS MCU with LIN bus Transceiver Devices included in this Data Sheet: High Performance RISC CPU: Only 35 instructions to learn All single cycle instructions (200 ns), except for program branches

More information

PIC12C5XX. 8-Pin, 8-Bit CMOS Microcontroller. CMOS Technology: Devices included in this Data Sheet: High-Performance RISC CPU: Pin Diagram

PIC12C5XX. 8-Pin, 8-Bit CMOS Microcontroller. CMOS Technology: Devices included in this Data Sheet: High-Performance RISC CPU: Pin Diagram This document was created with FrameMaker 404 8-Pin, 8-Bit CMOS Microcontroller PIC12C5XX Devices included in this Data Sheet: PIC12C508 and PIC12C509 are 8-bit microcontrollers packaged in 8-lead packages.

More information

Section 30. In-Circuit Serial Programming (ICSP )

Section 30. In-Circuit Serial Programming (ICSP ) Section 30. In-Circuit Serial Programming (ICSP ) HIGHLIGHTS This section of the manual contains the following major topics: 30. Introduction... 30-2 30.2 Entering In-Circuit Serial Programming Mode...

More information

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan Interrupts and Resets Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.twcgu Interrupts An event that will cause the CPU to stop the normal program execution

More information

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU:

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU: 14-Pin, 8-Bit CMOS Microcontroller Device included in this Data Sheet: PIC16C505 High-Performance RISC CPU: Only 33 instructions to learn Operating speed: - DC - 20 MHz clock input - DC - 200 ns instruction

More information

PIC Microcontroller Introduction

PIC Microcontroller Introduction PIC Microcontroller Introduction The real name of this microcontroller is PICmicro (Peripheral Interface Controller), but it is better known as PIC. Its first ancestor was designed in 1975 by General Instruments.

More information

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU:

PIC16C Pin, 8-Bit CMOS Microcontroller. Device included in this Data Sheet: Special Microcontroller Features: High-Performance RISC CPU: 14-Pin, 8-Bit CMOS Microcontroller Device included in this Data Sheet: PIC16C505 High-Performance RISC CPU: Only 33 instructions to learn Operating speed: - DC - 20 MHz clock input - DC - 200 ns instruction

More information

EEE111A/B Microprocessors

EEE111A/B Microprocessors EEE111A/B Microprocessors Revision Notes Lecture 1: What s it all About? Covers the basic principles of digital signals. The intelligence of virtually all communications, control and electronic devices

More information

The University of Texas at Arlington Lecture 21_Review

The University of Texas at Arlington Lecture 21_Review The University of Texas at Arlington Lecture 21_Review CSE 5442/3442 Agenda Tuesday December 1st Hand back Homework 7,8 and 9. Go over questions and answers Exam 3 Review Note: There will be a take home

More information

PIC16F87XA Data Sheet

PIC16F87XA Data Sheet M Data Sheet 28/40-pin Enhanced FLASH Microcontrollers 2001 Microchip Technology Inc. Advance Information DS39582A 2001 Microchip Technology Inc. Advance Information DS39582A-page 3 Pin Diagram RB7/PGD

More information

PIC16F8X. 8-Bit CMOS Flash/EEPROM Microcontrollers PIC16F8X PIC16CR8X. Pin Diagram. Devices Included in this Data Sheet:

PIC16F8X. 8-Bit CMOS Flash/EEPROM Microcontrollers PIC16F8X PIC16CR8X. Pin Diagram. Devices Included in this Data Sheet: This document was created with FrameMaker 404 PIC16F8X 8-Bit CMOS Flash/EEPROM Microcontrollers Devices Included in this Data Sheet: PIC16F83 PIC16CR83 PIC16F84 PIC16CR84 Extended voltage range devices

More information

PIC Microcontroller Embedded Systems Hadassah College Spring 2012 PIC Microcontroller Dr. Martin Land

PIC Microcontroller Embedded Systems Hadassah College Spring 2012 PIC Microcontroller Dr. Martin Land PIC Microcontroller 1 (MCU) Widely used device from Microchip Technology Sold > 10 billion PIC controllers Several device families Many devices per family Common development environment Widely available

More information

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL NH-67, TRICHY MAIN ROAD, PULIYUR, C.F. 639 114, KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL Subject Name : Embedded System Class/Sem : BE (ECE) / VII Subject Code

More information

Mod-5: PIC 18 Introduction 1. Module 5

Mod-5: PIC 18 Introduction 1. Module 5 Mod-5: PIC 18 Introduction 1 Module 5 Contents: Overview of PIC 18, memory organisation, CPU, registers, pipelining, instruction format, addressing modes, instruction set, interrupts, interrupt operation,

More information

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers

PIC16F8X 18-pin Flash/EEPROM 8-Bit Microcontrollers 18-pin Flash/EEPROM 8-Bit Microcontrollers Devices Included in this Data Sheet: PIC16F83 PIC16F84 PIC16CR83 PIC16CR84 Extended voltage range devices available (PIC16LF8X, PIC16LCR8X) High Performance RISC

More information

Section 8. Reset HIGHLIGHTS. Reset. This section of the manual contains the following major topics:

Section 8. Reset HIGHLIGHTS. Reset. This section of the manual contains the following major topics: Section 8. HIGHLIGHTS This section of the manual contains the following major topics: 8.1 Introduction... 8-2 8.2 Control Registers...8-3 8.3 System...8-6 8.4 Using the RCON Status Bits... 8-11 8.5 Device

More information

PIC16F630/676 Data Sheet

PIC16F630/676 Data Sheet M PIC16F630/676 Data Sheet 14-Pin FLASH-Based 8-Bit CMOS Microcontrollers 2002 Microchip Technology Inc. Preliminary DS4003A Note the following details of the code protection feature on PICmicro MCUs.

More information

PIC Microcontroller. PIC Microcontroller (MCU) Typical Applications. PIC Families

PIC Microcontroller. PIC Microcontroller (MCU) Typical Applications. PIC Families (MCU) PIC Microcontroller Widely used device from Microchip Technology Sold > billion PIC controllers Several device families Many devices per family Common development environment Widely available Large

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002. Semester 2. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J2. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 Semester 2 Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J2 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

PIC10F200/202/204/206 Data Sheet

PIC10F200/202/204/206 Data Sheet Data Sheet 6-Pin, 8-Bit Flash Microcontrollers DS4239A 6-Pin, 8-Bit Flash Microcontrollers Devices Included In ThisData Sheet: PIC0F200 PIC0F202 PIC0F204 PIC0F206 High-Performance RISC CPU: Only 33 single-word

More information

Section 4. Architecture

Section 4. Architecture M Section 4. Architecture HIGHLIGHTS This section of the manual contains the following major topics: 4. Introduction...4-2 4.2 Clocking Scheme/Instruction Cycle...4-5 4.3 Instruction Flow/Pipelining...4-6

More information

ECE 354 Introduction to Lab 2. February 23 rd, 2003

ECE 354 Introduction to Lab 2. February 23 rd, 2003 ECE 354 Introduction to Lab 2 February 23 rd, 2003 Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system supervisors

More information

M Using Timer1 in Asynchronous Clock Mode

M Using Timer1 in Asynchronous Clock Mode M Using Timer1 in Asynchronous Clock Mode AN580 Author INTRODUCTION This application note discusses the use of the PIC16CXXX Timer1 module as an asynchronous clock. The Timer1 module has it own oscillator

More information

PIC16F818/819 Data Sheet

PIC16F818/819 Data Sheet Data Sheet 18/20-Pin Enhanced FLASH Microcontrollers with nanowatt Technology 2002 Microchip Technology Inc. Preliminary DS39598C Note the following details of the code protection feature on Microchip

More information

PIC16F870/ /40-Pin, 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram. Microcontroller Core Features:

PIC16F870/ /40-Pin, 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram. Microcontroller Core Features: 28/40-Pin, 8-Bit CMOS FLASH Microcontrollers Devices Included in this Data Sheet: Pin Diagram PIC16F870 PIC16F871 PDIP Microcontroller Core Features: High performance RISC CPU Only 35 single word instructions

More information

PIC16F /40-Pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

PIC16F /40-Pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features: 28/40-Pin 8-Bit CMOS FLASH Microcontrollers Devices Included in this Data Sheet: PIC16F870 PIC16F871 Microcontroller Core Features: High-performance RISC CPU Only 35 single word instructions to learn All

More information

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses

ECE 354 Computer Systems Lab II. Interrupts, Strings, and Busses ECE 354 Computer Systems Lab II Interrupts, Strings, and Busses Fun Fact Press release from Microchip: Microchip Technology Inc. announced it provides PICmicro field-programmable microcontrollers and system

More information

To Our Valued Customers

To Our Valued Customers Devices Included in this Data Sheet: PIC12C671 PIC12C672 PIC12CE673 PIC12CE674 Note: Throughout this data sheet PIC12C67X refers to the PIC12C671, PIC12C672, PIC12CE673 and PIC12CE674. PIC12CE67X refers

More information

Contents. PIC Mini Data Sheets

Contents. PIC Mini Data Sheets Contents PIC16C5x... 5 PIC16C5x Pin-Outs... 5 PIC16C5x Microcontrollers... 6 Peripheral Features... 6 Internal Architecture... 9 PIC16C5x Registers... 9 PIC16C64... 18 PIC16C64 Pin-Out...18 New and Modified

More information

Timer0..Timer3. Interrupt Description Input Conditions Enable Flag

Timer0..Timer3. Interrupt Description Input Conditions Enable Flag Timer0..Timer3 Timers are pretty useful: likewise, Microchip provides four different timers for you to use. Like all interrupts, you have to Enable the interrupt, Set the conditions of the interrupt, and

More information

Embedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept.

Embedded Systems Design (630470) Lecture 4. Memory Organization. Prof. Kasim M. Al-Aubidy Computer Eng. Dept. Embedded Systems Design (630470) Lecture 4 Memory Organization Prof. Kasim M. Al-Aubidy Computer Eng. Dept. Memory Organization: PIC16F84 has two separate memory blocks, for data and for program. EEPROM

More information

Using Timers of Microchip PIC18F Microcontrollers

Using Timers of Microchip PIC18F Microcontrollers Using Timers of Microchip PIC18F Microcontrollers ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it L.A.P.

More information

PIC16F630/676 Data Sheet

PIC16F630/676 Data Sheet Data Sheet 14-Pin, Flash-Based 8-Bit CMOS Microcontrollers 2007 Microchip Technology Inc. DS40039E Note the following details of the code protection feature on Microchip devices: Microchip products meet

More information

Section 9. Watchdog Timer (WDT)

Section 9. Watchdog Timer (WDT) Section 9. Watchdog Timer (WDT) HIGHLIGHTS This section of the manual contains the following major topics: 9.1 Introduction... 9-2 9.2 WDT Operation... 9-2 9.3 Register Maps...9-5 9.4 Design Tips... 9-6

More information

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!!

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!! THE UNIVERSITY OF THE WEST INDIES EXAMINATIONS OF APRIL MID-TERM 2005 Code and Name of Course: EE25M Introduction to Microprocessors Paper: MidTerm Date and Time: Thursday April 14th 2005 8AM Duration:

More information

PIC10F200/202/204/206

PIC10F200/202/204/206 6-Pin, 8-Bit Flash Microcontrollers Devices Included In This Data Sheet: PIC0F200 PIC0F202 PIC0F204 PIC0F206 High-Performance RISC CPU: Only 33 Single-Word Instructions to Learn All Single-Cycle Instructions

More information

AN587. Interfacing to an LCD Module. Interfacing to an LCD Module INTRODUCTION OPERATION CONTROL SIGNAL FUNCTIONS TABLE 2: CONDITIONAL ASSEMBLY FLAGS

AN587. Interfacing to an LCD Module. Interfacing to an LCD Module INTRODUCTION OPERATION CONTROL SIGNAL FUNCTIONS TABLE 2: CONDITIONAL ASSEMBLY FLAGS Interfacing to an LCD Module AN587 INTRODUCTION TABLE 1: CONTROL SIGNAL FUNCTIONS This application note interfaces a PIC16CXX device to the Hitachi LM02L LCD character display module. This module is a

More information

evsjv `k cigvyy kw³ Kwgkb BANGLADESH ATOMIC ENERGY COMMISSION

evsjv `k cigvyy kw³ Kwgkb BANGLADESH ATOMIC ENERGY COMMISSION Design and Development of Microcontroller Based Programmable Timer for Supply Control Md. Shahzamal, Mohammad Abu Sayid Haque, Md. Nasrul Haque Mia, Md. Anzan-Uz-Zaman, Sardar Masud Rana, Mahbubul Hoq,

More information

Timer2 Interrupts. NDSU Timer2 Interrupts September 20, Background:

Timer2 Interrupts. NDSU Timer2 Interrupts September 20, Background: Background: Timer2 Interrupts The execution time for routines sometimes needs to be set. This chapter loops at several ways to set the sampling rate. Example: Write a routine which increments an 8-bit

More information

PIC12CE5XX. 8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory. Devices Included in this Data Sheet: Pin Diagram: High-Performance RISC CPU:

PIC12CE5XX. 8-Pin, 8-Bit CMOS Microcontroller with EEPROM Data Memory. Devices Included in this Data Sheet: Pin Diagram: High-Performance RISC CPU: Devices Included in this Data Sheet: PIC12CE518 PIC12CE519 High-Performance RISC CPU: Only 33 single word instructions to learn All instructions are single cycle (1 µs) except for program branches which

More information

PIC16C62X Data Sheet. EPROM-Based 8-Bit CMOS Microcontrollers Microchip Technology Inc. DS30235J

PIC16C62X Data Sheet. EPROM-Based 8-Bit CMOS Microcontrollers Microchip Technology Inc. DS30235J Data Sheet EPROM-Based 8-Bit CMOS Microcontrollers 2003 Microchip Technology Inc. DS30235J Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification

More information

BENCHMARK ST72 vs. PIC16

BENCHMARK ST72 vs. PIC16 APPLICATION NOTE BENCHMARK ST72 vs. PIC16 by Microcontroller Division Application Team ABSTRACT This document presents the results of a competitive analysis between the STMicroelectonics ST72254 and the

More information

Embedded System Design

Embedded System Design ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design : Microcontroller 1. Introduction to PIC microcontroller 2. PIC16F84 3. PIC16F877

More information

Section 46. Scalable Comparator Module

Section 46. Scalable Comparator Module 46 Section 46. Scalable Module Scalable Module HIGHLIGHTS This section of the manual contains the following major topics: 46.1 Introduction... 46-2 46.2 Control Register... 46-4 46.3 Operation... 46-7

More information

Section 10. Watchdog Timer and Power Saving Modes

Section 10. Watchdog Timer and Power Saving Modes Section 10. Watchdog Timer and Power Saving Modes HIGHLIGHTS This section of the manual contains the following topics: 10.1 Introduction... 10-2 10.2 Power Saving Modes... 10-2 10.3 Sleep Mode...10-2 10.4

More information

Introduction to PIC Programming

Introduction to PIC Programming Introduction to PIC Programming Baseline Architecture and Assembly Language by David Meiklejohn, Gooligum Electronics Lesson 5: Using Timer0 The lessons until now have covered the essentials of baseline

More information

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN bus Transceiver Microchip Technology Inc. Advance Information DS41139A

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN bus Transceiver Microchip Technology Inc. Advance Information DS41139A Data Sheet 8-Bit CMOS Microcontroller with LIN bus Transceiver 2001 Microchip Technology Inc. Advance Information DS41139A All rights reserved. Copyright 2001, Microchip Technology Incorporated, USA. Information

More information

Section 9. Watchdog Timer and Power-up Timer

Section 9. Watchdog Timer and Power-up Timer Section 9. Watchdog Timer and Power-up Timer HIGHLIGHTS This section of the manual contains the following topics: 9.1 Introduction... 9-2 9.2 Watchdog Timer and Power-up Timer Control Registers... 9-3

More information

Mid-Range Family Peripheral Configuration with C Programming

Mid-Range Family Peripheral Configuration with C Programming Mid-Range Family Peripheral Configuration with C Programming MCU 2 26 Microchip Technology Incorporated. All Rights Reserved. 2ASP Rev. January Slide 28 Objectives At the end of this class you will: Understand

More information

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours

UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT. Year 2 MICROCONTROLLER SYSTEMS. Module Code: EEE305J1. Time allowed: 3 Hours UNIVERSITY OF ULSTER UNIVERSITY EXAMINATIONS : 2001/2002 RESIT Year 2 MICROCONTROLLER SYSTEMS Module Code: EEE305J1 Time allowed: 3 Hours Answer as many questions as you can. Not more than TWO questions

More information

More Fun with Timer Interrupts

More Fun with Timer Interrupts More Fun with Timer Interrupts Chords Objective: Play a musical chord each time you press a button: Button RC0 RC1 RC2 Timer Timer0 Timer1 Timer3 RB0 A3 C4 E4 RB1 B3 D4 F4 RB2 C4 E4 G4 Calculations: Assume

More information

Using the 8-Bit Parallel Slave Port

Using the 8-Bit Parallel Slave Port M AN579 Using the 8-Bit Parallel Slave Port Author: INTRODUCTION PIC16C64/74 microcontrollers from Microchip Technology Inc. can be interfaced with ease into a multi-microprocessor environment using its

More information

PIC18CXX2. High Performance Microcontrollers with 10-bit A/D. High Performance RISC CPU: Pin Diagrams PIC18C4X2. Analog Features: Peripheral Features:

PIC18CXX2. High Performance Microcontrollers with 10-bit A/D. High Performance RISC CPU: Pin Diagrams PIC18C4X2. Analog Features: Peripheral Features: High Performance Microcontrollers with 10-bit A/D High Performance RISC CPU: C compiler optimized architecture/instruction set - Source code compatible with the PIC16CXX instruction set Linear program

More information

Embedded Systems Programming and Architectures

Embedded Systems Programming and Architectures Embedded Systems Programming and Architectures Lecture No 10 : Data acquisition and data transfer Dr John Kalomiros Assis. Professor Department of Post Graduate studies in Communications and Informatics

More information

ME 6405 Introduction to Mechatronics

ME 6405 Introduction to Mechatronics ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Microchip PIC Manufacturer Information: Company: Website: http://www.microchip.com Reasons for success: Became the hobbyist's

More information

Embedded systems. Exercise session 3. Microcontroller Programming Lab Preparation

Embedded systems. Exercise session 3. Microcontroller Programming Lab Preparation Embedded systems Exercise session 3 Microcontroller Programming Lab Preparation Communications Contact Mail : michael.fonder@ulg.ac.be Office : 1.82a, Montefiore Website for the exercise sessions and the

More information

Section 37. Real-Time Clock and Calendar (RTCC)

Section 37. Real-Time Clock and Calendar (RTCC) Section 37. Real-Time Clock and Calendar (RTCC) HIGHLIGHTS This section of the manual contains the following major topics: 37 37.1 Introduction... 37-2 37.2 RTCC Module Registers... 37-3 37.3 RTCC Operation...

More information

Chapter 11: Interrupt On Change

Chapter 11: Interrupt On Change Chapter 11: Interrupt On Change The last two chapters included examples that used the external interrupt on Port C, pin 1 to determine when a button had been pressed. This approach works very well on most

More information

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN Transceiver Microchip Technology Inc. Preliminary DS41139B

PIC16C433 Data Sheet. 8-Bit CMOS Microcontroller with LIN Transceiver Microchip Technology Inc. Preliminary DS41139B Data Sheet 8-Bit CMOS Microcontroller with LIN Transceiver 2002 Microchip Technology Inc. Preliminary DS41139B Note the following details of the code protection feature on Microchip devices: Microchip

More information

Section 29. Device Configuration Bits

Section 29. Device Configuration Bits Section 29. Device Configuration Bits HIGHLIGHTS This section of the manual contains the following major topics: 29.1 Introduction... 29-2 29.2 Configuration Word Bits... 29-3 29.3 Program Verification/Code

More information

PIC16F8X PIC16F8X. 18-pin Flash/EEPROM 8-Bit Microcontrollers

PIC16F8X PIC16F8X. 18-pin Flash/EEPROM 8-Bit Microcontrollers Devices Included in this Data Sheet: PIC6F83 PIC6F84 PIC6CR83 PIC6CR84 Extended voltage range devices available (PIC6LF8X, PIC6LCR8X) High Performance RISC CPU Features: Only 35 single word instrucs to

More information

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features: PIC16F7X 2/40-pin -Bit CMOS FLASH Microcontrollers Devices Included in this Data Sheet: PIC16F7 PIC16F74 PIC16F76 PIC16F77 Microcontroller Core Features: High-performance RISC CPU Only 5 single word instructions

More information

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS

PIC16F87X 13.0 INSTRUCTION SET SUMMARY INSTRUCTIONS DESCRIPTIONS PIC6F87X 3.0 INSTRUCTION SET SUMMARY Each PIC6F87X instruction is a 4bit word, divided into an OPCODE which specifies the instruction type and one or more operands which further specify the operation of

More information

PIC 16F84A programming (II)

PIC 16F84A programming (II) Lecture (05) PIC 16F84A programming (II) Dr. Ahmed M. ElShafee ١ Introduction to 16F84 ٣ PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture. Program memory (FLASH) EEPROM RAM PORTA

More information

PIC18CXX2. High-Performance Microcontrollers with 10-Bit A/D * * High Performance RISC CPU: Pin Diagrams PIC18C4X2.

PIC18CXX2. High-Performance Microcontrollers with 10-Bit A/D * * High Performance RISC CPU: Pin Diagrams PIC18C4X2. High-Performance Microcontrollers with 10-Bit A/D * * * * High Performance RISC CPU: C-compiler optimized architecture/instruction set - Source code compatible with the PIC16CXX instruction set Linear

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE6008 Microcontroller based system design Year: IV DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6008 Microcontroller based system design Semester : VII UNIT I Introduction to PIC Microcontroller

More information

DRPIC166X IP Core. High Performance 8-bit RISC Microcontroller v. 2.17

DRPIC166X IP Core. High Performance 8-bit RISC Microcontroller v. 2.17 2017 DRPIC166X IP Core High Performance 8-bit RISC Microcontroller v. 2.17 C O M P A N Y O V E R V I E W Digital Core Design is a leading IP Core provider and a System-on-Chip design house. The company

More information

Interrupts on PIC18F252 Part 2

Interrupts on PIC18F252 Part 2 Interrupts on PIC18F252 Part 2 Following pages list Special Function Registers (SFRs) involved in interrupt configuration and operation on PIC18F252 microcontroller. (Copied from Microchip s PIC18Fxx2

More information

PIC16F872 Data Sheet. 28-Pin, 8-Bit CMOS Flash Microcontroller with 10-Bit A/D Microchip Technology Inc. DS30221C

PIC16F872 Data Sheet. 28-Pin, 8-Bit CMOS Flash Microcontroller with 10-Bit A/D Microchip Technology Inc. DS30221C Data Sheet 28-Pin, 8-Bit CMOS Flash Microcontroller with 10-Bit A/D 2006 Microchip Technology Inc. DS30221C Note the following details of the code protection feature on Microchip devices: Microchip products

More information

MDT10P General Description. 2. Features. 3. Applications

MDT10P General Description. 2. Features. 3. Applications 1. General Description This EPROM-Based 8-bit micro-controller uses a fully static CMOS technology process to achieve higher speed and smaller size with the low power consumption and high noise immunity.

More information

Flow Charts and Assembler Programs

Flow Charts and Assembler Programs Flow Charts and Assembler Programs Flow Charts: A flow chart is a graphical way to display how a program works (i.e. the algorithm). The purpose of a flow chart is to make the program easier to understand.

More information

Section 10. Power-Saving Features

Section 10. Power-Saving Features Section 10. Power-Saving Features HIGHLIGHTS This section of the manual contains the following major topics: 10.1 Introduction... 10-2 10.2 Microcontroller Clock Manipulation... 10-2 10.3 Instruction-Based

More information

EE 361L Digital Systems and Computer Design Laboratory

EE 361L Digital Systems and Computer Design Laboratory EE 361L Digital Systems and Computer Design Laboratory University of Hawaii Department of Electrical Engineering by Galen Sasaki and Ashok Balusubramaniam Quick Overview of PIC16F8X Version 1.0 Date: 9/4/01

More information

Microprocessors B (17.384) Spring Lecture Outline

Microprocessors B (17.384) Spring Lecture Outline Microprocessors B (17.384) Spring 2013 Lecture Outline Class # 04 February 12, 2013 Dohn Bowden 1 Today s Lecture Administrative Microcontroller Hardware and/or Interface Programming/Software Lab Homework

More information

Speed Control of a DC Motor using Digital Control

Speed Control of a DC Motor using Digital Control Speed Control of a DC Motor using Digital Control The scope of this project is threefold. The first part of the project is to control an LCD display and use it as part of a digital tachometer. Secondly,

More information

Performance & Applications

Performance & Applications EE25M Introduction to microprocessors original author: Feisal Mohammed updated: 15th March 2002 CLR Part VI Performance & Applications It is possible to predict the execution time of code, on the basis

More information

Introduction to PIC Programming

Introduction to PIC Programming Introduction to PIC Programming Programming Baseline PICs in C by David Meiklejohn, Gooligum Electronics Lesson 3: Using Timer 0 As demonstrated in the previous lessons, C can be a viable choice for programming

More information

PIC16C745/ Bit CMOS Microcontrollers with USB. Pin Diagrams. Devices included in this data sheet: Microcontroller Core Features:

PIC16C745/ Bit CMOS Microcontrollers with USB. Pin Diagrams. Devices included in this data sheet: Microcontroller Core Features: 8-Bit CMOS Microcontrollers with USB Devices included in this data sheet: PIC16C745 PIC16C765 Microcontroller Core Features: High-performance RISC CPU Only 35 single word instructions Device Memory Program

More information

Micro-Controller: PIC16C74 < Part 5: Interrupt >

Micro-Controller: PIC16C74 < Part 5: Interrupt > Micro-Controller: PIC16C74 < Part 5: Interrupt > I. Overview Introduction PIC16c74 can have many sources of interrupt. These sources generally include one interrupt source for each peripheral module, though

More information

Section 9. Watchdog Timer (WDT) and Power-Saving Modes

Section 9. Watchdog Timer (WDT) and Power-Saving Modes Section 9. Watchdog Timer (WDT) and Power-Saving Modes HIGHLIGHTS This section of the manual contains the following topics: 9.1 Introduction... 9-2 9.2 Power-Saving Modes... 9-2 9.3 Watchdog Timer (WDT)...

More information

Outlines. PIC Programming in C and Assembly. Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University

Outlines. PIC Programming in C and Assembly. Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University PIC ming in C and Assembly Outlines Microprocessor vs. MicroController PIC in depth PIC ming Assembly ming Krerk Piromsopa, Ph.D. Department of Computer Engineering Chulalongkorn University Embedded C

More information