DM164120-1 Microchip Technology, DM164120-1 Datasheet

BOARD DEMO PICKIT 2 LP COUNT

DM164120-1

Manufacturer Part Number
DM164120-1
Description
BOARD DEMO PICKIT 2 LP COUNT
Manufacturer
Microchip Technology
Type
MCUr
Datasheet

Specifications of DM164120-1

Contents
3 Boards (1 Populated, 2 Bare)
Processor To Be Evaluated
PIC16F690
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC16
Silicon Core Number
PIC16F
Silicon Family Name
PIC16F6xxx
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
28-pin PIC16C, 16F, 18C, 18F
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM164120-1
Manufacturer:
Microchip Technology
Quantity:
135
Low Pin Count Demo Board
User’s Guide
© 2005 Microchip Technology Inc.
DS51556A

Related parts for DM164120-1

DM164120-1 Summary of contents

Page 1

... Low Pin Count Demo Board © 2005 Microchip Technology Inc. User’s Guide DS51556A ...

Page 2

... PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance and WiperLock are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. ...

Page 3

... Lesson 10: Interrupts ............................................................................................ 29 3.2.11 Lesson 11: Indirect Data Addressing .................................................................... 31 3.2.12 Lesson 12: Look-up Table (ROM Array) ............................................................... 33 Appendix A. Hardware Schematics A.1 Introduction .................................................................................................. 37 Worldwide Sales and Service .................................................................................... 38 © 2005 Microchip Technology Inc. LOW PIN COUNT DEMO BOARD Table of Contents ® Architectural Overview USER’S GUIDE DS51556A-page iii ...

Page 4

... Low Pin Count Demo Board User’s Guide NOTES: DS51556A-page iv © 2005 Microchip Technology Inc. ...

Page 5

... Mid-range PICmicro • Chapter 3. “LPC Demo Board Lessons” – Contains a variety of lessons that demonstrate how to utilize and experiment with the Low Pin Count Demo Board. © 2005 Microchip Technology Inc. LOW PIN COUNT DEMO BOARD USER’S GUIDE Preface NOTICE TO CUSTOMERS ® ...

Page 6

... Optional arguments mcc18 [options] file [options] Choice of mutually exclusive errorlevel {0|1} arguments selection Replaces repeated text var_name [, var_name...] Represents code supplied by void main (void) user { ... } © 2005 Microchip Technology Inc. Examples ® IDE User’s Guide ...

Page 7

... Flash based, 8-bit CMOS Microcontroller device specifications. ® MPLAB IDE, Simulator, Editor User’s Guide (DS51025) Consult this document for more information pertaining to the installation and features of the MPLAB Integrated Development Environment (IDE) Software. © 2005 Microchip Technology Inc. Preface DS51556A-page 3 ...

Page 8

... Programmers – The latest information on Microchip programmers. These include the MPLAB PM3 and PRO MATE Plus and PICkit DS51556A-page 4 ® II device programmers and the PICSTART ® 1 development programmers. ® ® © 2005 Microchip Technology Inc. ...

Page 9

... The Development Systems Information Line numbers are: 1-800-755-2345 – United States and most of Canada 1-480-792-7302 – Other International Locations DOCUMENT REVISION HISTORY Revision A (May 2005) • Initial Release of this Document. © 2005 Microchip Technology Inc. Preface DS51556A-page 5 ...

Page 10

... Low Pin Count Demo Board User’s Guide NOTES: DS51556A-page 6 © 2005 Microchip Technology Inc. ...

Page 11

... Starter Kit CD-ROM. 8-pin DIP Flash Devices: PIC12F508 PIC12F509 PIC12F510 14-pin DIP Flash Devices: PIC16F505 PIC16F506 20-pin DIP Flash Devices: PIC16F685 PIC16F687 © 2005 Microchip Technology Inc. LOW PIN COUNT DEMO BOARD USER’S GUIDE PIC12F629 PIC12F635 PIC12F675 PIC12F683 PIC16F630 PIC16F684 PIC16F676 PIC16F688 ...

Page 12

... RP1, and the light sequence will blink at a different rate. This demo program is developed through the first 7 lessons in this guide. DS51556A-page 8 LPC DEMO BOARD PICkit™ 2 Programming Header LEDs ® microcontrollers. ® microcontroller. 14-pin Expansion Header Generous Prototyping Area Potentiometer © 2005 Microchip Technology Inc. ...

Page 13

... This chapter describes the Mid-range PICmicro Demo Board. FIGURE 2-1: Program Bus OSC1/CLKI OSC2/CLKO Internal Oscillator Block © 2005 Microchip Technology Inc. LOW PIN COUNT DEMO BOARD ® Architectural Overview ® Architectural Overview for the LPC SIMPLIFIED MID-RANGE PICmicro INT 13 Program Counter ...

Page 14

... Literal instructions contain the data operand within the instruction. The Wreg becomes the other operand. Calls and GOTO’s use 11 bits as a literal address. MOVLW'A' Moves the ASCII value of ‘A’ (0x41) into Wreg. DS51556A-page 10 ® MCUs may be clocked by a number of different devices. Unless © 2005 Microchip Technology Inc. ...

Page 15

... The advantage is that as variables come and go through the development process, the cblock keeps the block to a minimum. Using one of the other methods, you may have to go back and find an unused location. © 2005 Microchip Technology Inc. ® Architectural Overview 12 or 0x12 or H'12' ...

Page 16

... Low Pin Count Demo Board User’s Guide NOTES: DS51556A-page 12 © 2005 Microchip Technology Inc. ...

Page 17

... Lesson 7: Reversible Variable Speed Rotate • Lesson 8: Function Calls • Lesson 9: Timer0 • Lesson 10: Interrupts • Lesson 11: Indirect Data Addressing • Lesson 12: Look-up Table (ROM Array) © 2005 Microchip Technology Inc. LOW PIN COUNT DEMO BOARD USER’S GUIDE DS51556A-page 13 ...

Page 18

... We want to make it an output, so the bit must be cleared. Tells the processor to set pin 0 of PORTC. This will force the I/O pin to a high condition turning on the LED. Tells the processor the current instruction. ® microcontroller ® © 2005 Microchip Technology Inc. ...

Page 19

... Counting cycles – Relating clock speed to instruction speed. The processor requires 4 clocks to execute an instruction. Since the internal oscillator as used in these lessons runs at 4 MHz, the instruction rate is 1 MHz. © 2005 Microchip Technology Inc. LPC Demo Board Lessons Clear file register ...

Page 20

... Note the LED now flashes at about rate. DS51556A-page 16 Clears the counter location. Decrements the location, and if the result is zero, the next instruction is skipped. DELAY LOOP Delay Delay,f Loop Delay1 Delay2 Delay1,f Loop Delay2,f Loop © 2005 Microchip Technology Inc. ...

Page 21

... Copy the Display variable to the I/O Port, then • Delay for a little while • Rotate the display FIGURE 3-1: © 2005 Microchip Technology Inc. LPC Demo Board Lessons Loads Wreg with a literal value Moves the contents of Wreg to a file register ...

Page 22

... LEDs PORTC ;Delay .197S Delay1,f OndelayLoop Delay2,f OndelayLoop STATUS,C ;ensure the carry bit is clear Display,f ;Rotate Display right STATUS,C ;Did the bit rotate into the carry? Display,3 ;yes, put it into bit 3. MainLoop © 2005 Microchip Technology Inc. ...

Page 23

... RA0 on the PIC16F690. Here’s the checklist for this lesson: • Configure PORTA as an analog input, TRISA<0> ANSEL<0> • Select clock scaling in ADCON1. • Select channel, justification and V © 2005 Microchip Technology Inc. LPC Demo Board Lessons * 1023 REF REF source in ADCON0 ...

Page 24

... ADCON1 – A/D CONTROL REGISTER 1 (ADDRESS: 9Fh) R/W-0 R/W-0 U-0 ADCS1 ADCS0 — Writable bit U = Unimplemented bit, read as ‘0’ ‘1’ = Bit is set ‘0’ = Bit is cleared U-0 U-0 U-0 — — — bit Bit is unknown © 2005 Microchip Technology Inc. ...

Page 25

... ADON: A/D Enable bit 1 = A/D converter module is enabled 0 = A/D converter is shut off and consumes no operating current Legend Readable bit - n = Value at POR © 2005 Microchip Technology Inc. LPC Demo Board Lessons or a separate reference voltage DD conversion clock. OSC ADCON0 – A/D CONTROL REGISTER (ADDRESS: 1Fh) ...

Page 26

... LEDs ;Delay Loop shortened by the ADResult as ;controlled by the Pot. VARIABLE SPEED ROTATE PROGRAM FLOW Initialize I/O Port Initialize ADC Put Up Display Get ADC Result Delay Using ADC Rotate Display Yes Did it overflow? No Reset Display © 2005 Microchip Technology Inc. ...

Page 27

... Figures 3-4 and 3-5). These methods are still effective but they involve additional cost in material, installation and board real estate. Why suffer the additional expense when software is free and program memory is abundant. FIGURE 3-4: FIGURE 3-5: © 2005 Microchip Technology Inc. LPC Demo Board Lessons FILTERING DEBOUNCE SOLUTION +V R2 ...

Page 28

... The Switch on the LPC Demo Board doesn’t bounce much, but it is good practice to debounce all switches in the system. FIGURE 3-6: DS51556A-page 24 SIMPLE SWITCH DEBOUNCE PROGRAM FLOW Switch has Yes changed states? Increment Counter No Is Counter = 5? Yes Change State Reset Counter Delay Reset Counter © 2005 Microchip Technology Inc. ...

Page 29

... BTFSC STATUS,C BSF GOTO RotateLeft RLF BTFSC Display,4 BSF GOTO © 2005 Microchip Technology Inc. LPC Demo Board Lessons REVERSIBLE VARIABLE SPEED ROTATE EXAMPLE Display,f ;Did the bit rotate into the carry? Display,3 ;yes, put it into bit 3. STATUS,C ;ensure the carry bit is clear ...

Page 30

... Delay MOVWF Delay2 DelayLoop DECFSZ Delay1,f GOTO DECFSZ Delay2,f GOTO RETURN DS51556A-page 26 Invokes functions or subroutines Terminates functions or subroutines Terminates functions or subroutines FUNCTION CALL EXAMPLE ADRESH,w Delay ;call delay function ;returns here when done xxx DelayLoop DelayLoop © 2005 Microchip Technology Inc. ...

Page 31

... Thus, Timer0 Flag will be set every 65536 μs (0.0000001 second * 256 * 256), or about 15 times a second. The main program sits in a loop waiting for the rollover and when it does, it increments the display and then loops back. © 2005 Microchip Technology Inc. LPC Demo Board Lessons TIMER0 SIMPLIFIED ...

Page 32

... Timer0. Sourced from the ;Processor clock ;Maximum Prescaler TRISC ;Make PORTC all output Display STATUS,RP0 ;wait here until Timer0 rolls over ForeverLoop INTCON,T0IF ;flag must be cleared in software Display,f ;increment display variable Display,w ;send to the LEDs ForeverLoop © 2005 Microchip Technology Inc. ...

Page 33

... Next, the ISR has to figure out what triggered the interrupt. It has to check the interrupt flags to determine what caused the interrupt. When it finds the source, then it can service the peripheral. © 2005 Microchip Technology Inc. LPC Demo Board Lessons Return from Interrupt ...

Page 34

... Finally, RETFIE transfers control back to the original program and sets the GIE bit, re-enabling interrupts. FIGURE 3-10: DS51556A-page 30 CONTEXT RESTORE ;this may change the Z bit ;in the Status register ;swap in place ;swap with Wreg destination SWAPF INSTRUCTION Before After © 2005 Microchip Technology Inc. ...

Page 35

... EXAMPLE 3-10: ;insert new value into a queue, enter with new value in ;Wreg MOVF temp MOVF QueuePointer,w MOVWF FSR MOVF temp,w MOVWF INDF © 2005 Microchip Technology Inc. LPC Demo Board Lessons MOVING AVERAGES 102 101 104 99 105 102 101 104 106 ...

Page 36

... The filter averages the last 8 readings. Choosing a power of two for the number of samples allows division by simple rotates instead of longhand. Rather than summing the array every time, it’s faster to keep a running sum, then subtract out the oldest value in the queue and adding in the new value. DS51556A-page 32 © 2005 Microchip Technology Inc. ...

Page 37

... Instead, be sure to check for and handle that case in our code. See the PCL and PCLATH Section in the PIC16F685/687/689/690 Data Sheet (DS41262) for more details of how PCLATH is used. FIGURE 3-12: PC © 2005 Microchip Technology Inc. LPC Demo Board Lessons LOOK-UP TABLE PCL,f ;jump to '0' ...

Page 38

... LEDs. The code changes one bit at a time as the potentiometer rotates across its range (see Example 3-12). Gray Code Converter Decimal DS51556A-page 34 Binary 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000 © 2005 Microchip Technology Inc. ...

Page 39

... RETLW b'1101' RETLW b'1111' RETLW b'1110' RETLW b'1010' RETLW b'1011' RETLW b'1001' RETLW b'1000' © 2005 Microchip Technology Inc. LPC Demo Board Lessons CONVERT BINARY TO GRAY CODE ;mask off invalid entries ;the table ;load starting address of table ;add offset ;did it overflow? PCLATH,f ...

Page 40

... Low Pin Count Demo Board User’s Guide NOTES: DS51556A-page 36 © 2005 Microchip Technology Inc. ...

Page 41

... Appendix A. Hardware Schematics A.1 INTRODUCTION This appendix contains the Low Pin Count Demo Board Diagrams. FIGURE A-1: © 2005 Microchip Technology Inc. TM PICKIT 2 USER’S GUIDE LOW PIN COUNT DEMO BOARD SCHEMATIC DIAGRAM DS51556A-page 37 ...

Page 42

... Fax: 65-6334-8850 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Taiwan - Hsinchu Tel: 886-3-572-9526 Fax: 886-3-572-6459 © 2005 Microchip Technology Inc. EUROPE Austria - Weis Tel: 43-7242-2244-399 Fax: 43-7242-2244-393 Denmark - Ballerup Tel: 45-4450-2828 Fax: 45-4485-2829 France - Massy Tel: 33-1-69-53-63-20 ...

Related keywords