Arizona 17 manual

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

Ir para a página of

Bom manual de uso

As regras impõem ao revendedor a obrigação de fornecer ao comprador o manual com o produto Arizona 17. A falta de manual ou informações incorretas fornecidas ao consumidor são a base de uma queixa por não conformidade do produto com o contrato. De acordo com a lei, pode anexar o manual em uma outra forma de que em papel, o que é frequentemente utilizado, anexando uma forma gráfica ou manual electrónicoArizona 17 vídeos instrutivos para os usuários. A condição é uma forma legível e compreensível.

O que é a instrução?

A palavra vem do latim "Instructio" ou instruir. Portanto, no manual Arizona 17 você pode encontrar uma descrição das fases do processo. O objetivo do manual é instruir, facilitar o arranque, a utilização do equipamento ou a execução de determinadas tarefas. O manual é uma coleção de informações sobre o objeto / serviço, um guia.

Infelizmente, pequenos usuários tomam o tempo para ler o manual Arizona 17, e um bom manual não só permite conhecer uma série de funcionalidades adicionais do dispositivo, mas evita a formação da maioria das falhas.

Então, o que deve conter o manual perfeito?

Primeiro, o manual Arizona 17 deve conte:
- dados técnicos do dispositivo Arizona 17
- nome do fabricante e ano de fabricação do dispositivo Arizona 17
- instruções de utilização, regulação e manutenção do dispositivo Arizona 17
- sinais de segurança e certificados que comprovam a conformidade com as normas pertinentes

Por que você não ler manuais?

Normalmente, isso é devido à falta de tempo e à certeza quanto à funcionalidade específica do dispositivo adquirido. Infelizmente, a mesma ligação e o arranque Arizona 17 não são suficientes. O manual contém uma série de orientações sobre funcionalidades específicas, a segurança, os métodos de manutenção (mesmo sobre produtos que devem ser usados), possíveis defeitos Arizona 17 e formas de resolver problemas comuns durante o uso. No final, no manual podemos encontrar as coordenadas do serviço Arizona na ausência da eficácia das soluções propostas. Atualmente, muito apreciados são manuais na forma de animações interessantes e vídeos de instrução que de uma forma melhor do que o o folheto falam ao usuário. Este tipo de manual é a chance que o usuário percorrer todo o vídeo instrutivo, sem ignorar especificações e descrições técnicas complicadas Arizona 17, como para a versão papel.

Por que ler manuais?

Primeiro de tudo, contem a resposta sobre a construção, as possibilidades do dispositivo Arizona 17, uso dos acessórios individuais e uma gama de informações para desfrutar plenamente todos os recursos e facilidades.

Após a compra bem sucedida de um equipamento / dispositivo, é bom ter um momento para se familiarizar com cada parte do manual Arizona 17. Atualmente, são cuidadosamente preparados e traduzidos para sejam não só compreensíveis para os usuários, mas para cumprir a sua função básica de informação

Índice do manual

  • Página 1

    PICDEM™ 17 DEMONSTRATION BOARD U SER ’ S GUIDE  2001 Microchip Technology Inc. DS39024B[...]

  • Página 2

    DS39024B  2001 Microchip Technology Inc. “All rights reserved. Copyright © 2001, Microchip T echnology Incorporated, USA. Information contained in this publication regarding device applications and the like is i ntended t hrough suggestion only and may be superseded by updates. No rep- resentation or warranty is given and no liability is assu[...]

  • Página 3

     2001 Microchip Technology Inc. DS39024B-page 3 M PICDEM ™ 17 DEMON STRATION BOARD USER ’ S GUIDE T able of Contents PREFACE Welcome ... .............. .............. .......... .............. .............. .............. ...... 1 Documentation Lay out . ..... ......... ..... .... ..... ..... ......... ..... .... ..... ..... ...... 1 Chapte[...]

  • Página 4

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 4  2001 Microchip Technology Inc. 2.7 Down loading HEX Files to t he PICDEM 17 Demo nstrati on Board . 9 2.8 Running HEX files from the PICDEM 17 Demonstration Bo ard .... 10 2.9 Runnin g Diagno stics on the P ICDEM 17 Demonstr ation Boar d ... 11 2.10 Modifying Me mory Contents .[...]

  • Página 5

     2001 Microchip Technology Inc. DS39024B-page 5 Table of Contents 6.2 Highlights .. .............. .............. .............. .............. .............. .............. 57 6.3 MPLAB IDE P roject Files ........... .............. .............. .............. ......... 57 6.4 PICmicro C Libraries .................. ..... .... ..... ..........[...]

  • Página 6

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 6  2001 Microchip Technology Inc. App endi x B. RS-2 32 Co mm uni cati on Pro tocol B.1 Introductio n .............. .............. .............. .............. .............. ............. 81 B.2 Overview ........ .............. .............. .............. .......... .........[...]

  • Página 7

     2001 Microchip T echnology Inc. DS 39024B-page 1 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 PREF ACE We l c o m e Thank y ou for pur chasing t he PICDEM 1 7 produc t demonstr ation bo ard for the PIC1 7C7XX family of microcon troller s from Mic rochip T ech nology Incor porated. The PICDEM 17 dem onstrati on board a llows you to q u[...]

  • Página 8

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 2  2001 Microchip Technology Inc. Chapter 8: SWITCH.C Description – This chap ter prov ides a d etailed descripti on of the m emory m apping of th e PIC17 C756A and provide s sour ce code to i nterface to the m emory mapp ed swi tches and LEDs. Chapter 9: I2C.C Description – T[...]

  • Página 9

     2001 Microchip T echnology Inc. DS 39024B-page 3 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 1. About PICDEM 17 Demonstration Boa rd 1.1 Introd uc tion This c hapter des cribes t he feature s of the P ICDEM 17 dem onstration board. 1.2 Highlight s This chapter covers the foll owing t opics: • Process or Soc kets • Externa[...]

  • Página 10

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 4  2001 Microchip Technology Inc. 1.4 External FLASH Memor y The PICDEM 17 demo nstratio n board sup ports all o perating modes of th e PIC17 C7XX PIC micro ® microcontro ller . H owever , the Mon itor progr am uses the extend ed micr ocontro ller mod e of oper ation. Th e FLASH [...]

  • Página 11

     2001 Microchip T echnology Inc. DS 39024B-page 5 About PICDEM 17 Demons tr ation Board 1.8 Osci llator Options The PICDEM 17 demo nstratio n board l ayout wil l only a ccept a can ned oscill ator . T he use o f a crys tal or ceram ic reso nator r equires that the us er modify th e board. 1.9 R S-232 Serial Port s The PICDEM 17 demo nstratio n b[...]

  • Página 12

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 6  2001 Microchip Technology Inc. 1.14 CAN Bus Interface The PICDEM 17 demo nstratio n board p rovides a simple interfac e to a CAN Bus. T he Micr ochip T ech nology M CP2510 CAN Inte rface pe riphera l device with th e Phillips PCA 82C250 device pr ovide a c omplete CAN Interf ac[...]

  • Página 13

     2001 Microchip T echnology Inc. DS 39024B-page 7 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 2. Using the PICDEM 17 Monitor 2.1 Introd uc tion This chapter discus s es how to use the Mon itor progr am to inte ract with the PIC17C7X X devic e on the P ICDEM 17 de monstrat ion bo ard. 2.2 Highlight s This chapter incl udes: •[...]

  • Página 14

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 8  2001 Microchip Technology Inc. 2.4 Using the PICDEM 17 Monitor Program The Moni tor progr am uses a serial p ort on the Host PC. It c urrent ly suppor ts COM1 throug h COM 4. The co mmand li ne to exec ute the Mon itor pr ogram should b e: 756MON. EXE COM ? where ? is the de si[...]

  • Página 15

     2001 Microchip T echnology Inc. DS 39024B-page 9 Using the PICDEM 17 Monitor 2.5 R esetting the PIC DEM 17 Demonstration B oard One uni que featur e of USART2 is the abil ity to r eset the P ICmicro ® MCU. This is accomplis hed by c onnectin g the DTR sig nal from P2 to the M CLR pin of the PI Cmicro MCU using the cir cuit in Fi gure 2.4. Jump[...]

  • Página 16

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 10  2001 Microchip Technology Inc. Fig u re 2. 3: Dow nlo ading … Window At the completi on of the do wnload , the Monito r status win dow will h ave display ed a E rasure Complete and Downloa d Complete messag e. When the mess age window shows a :> , it is r eady to process [...]

  • Página 17

     2001 Microchip T echnology Inc. DS39024B-page 11 Using the PICDEM 17 Monitor 2.9 Running Diagnostics on the PICDEM 17 Demonstration Bo ard The Moni tor firmwa re on the P IC17C75 6A provide s se veral d iagnosti c routines th at allow th e user to run pret ested co de on a per iphera l. The diagnos tic s incl ude: • A/D – The A/D diagnos ti[...]

  • Página 18

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 12  2001 Microchip Technology Inc. • LCD – This di agnostic configu res I/O pins and writes a me ssag e to the external L CD panel in 4- bit mode. If this diagnosti c is selected and these I/O p ins ar e not con nected to the LCD panel, then t he message will no t be displayed[...]

  • Página 19

     2001 Microchip T echnology Inc. DS39024B-page 13 Using the PICDEM 17 Monitor Figure 2.5: Running Diagnostics[...]

  • Página 20

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 14  2001 Microchip Technology Inc. 2.10 Modifying Memory Content s The PICDE M 17 Moni tor progr am has the capability to read f rom any Data memory location or interna l/exte rnal Prog ram memo ry locati on. It can a lso write to any Data memory loca tion and any ex ternal FLA SH[...]

  • Página 21

     2001 Microchip T echnology Inc. DS39024B-page 15 Using the PICDEM 17 Monitor Figu re 2.7 : Wri tin g D ata Me mory T o wr ite to a Data me mory lo cation, th e user m ust first sel ect the Data Memory radio button in th e Modi fy Memory window of th e Monit or progra m. Then the Data memory address mu st be w ritten in to the Addres s edit b ox[...]

  • Página 22

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 16  2001 Microchip Technology Inc. Figure 2.8: Reading Program Memory T o r ead from a Progr am memor y location, the user must fir st sele ct the Program Memory radio butto n in the Modify M emory windo w of the Monitor program. T hen the P rogram memory address mu st be w ritten[...]

  • Página 23

     2001 Microchip T echnology Inc. DS39024B-page 17 Using the PICDEM 17 Monitor Figure 2.9: Writing Pr ogram Memory T o wr ite to a Progr am memor y locatio n, the user mus t first select the Program Memory radio button in th e Modi fy Memory window of th e Monit or progra m. Then the Progra m memory ad dress must be wr itten into the Address edit[...]

  • Página 24

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 18  2001 Microchip Technology Inc. NOTES:[...]

  • Página 25

     2001 Microchip T echnology Inc. DS39024B-page 19 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 3. Hard war e Descripti on 3.1 Introd uc tion The ha rdware on th e PICDEM 17 demon stration board is s imple an d is intende d to il lustrate the ease of use and capabiliti es of the P IC17C7X X family of devic es. 3.2 Highlight s Th[...]

  • Página 26

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 20  2001 Microchip Technology Inc. 3.4 Push-button Switches The PICDEM 17 demo nstratio n board h as a total of n ine push-bu tton switc hes. S5 – S 12 are the eight gene ral pur pose push- button swi tch inputs that are a vailable to the us er . S1 is the MCL R res et push-butt[...]

  • Página 27

     2001 Microchip T echnology Inc. DS39024B-page 21 Hardware De scription 3.8 Modular Connectors As descri bed previous ly , the modular connector s can be used to set up a CAN Bus o r a I 2 C Bu s by si mply con necting standar d 4 or 6 -conduc tor phone cable. Re fer to F igure A. 1 in A ppendix A for the p inout of the conne ctors.[...]

  • Página 28

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 22  2001 Microchip Technology Inc. NOTES:[...]

  • Página 29

     2001 Microchip T echnology Inc. DS39024B-page 23 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 4. Using the MPLAB ® C17 C Compiler 4.1 Introd uc tion This chapter des cribe s the file s neces sary to compil e programs with the MPLAB C17 C compil er to run on the PI CDEM 17 demonstrati on board . A sampl e linker sc ript file, [...]

  • Página 30

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 24  2001 Microchip Technology Inc. 4.3 Linker Script File Any pro gram com piled wit h the MP LAB C17 C c ompil er requir es the us e of a linker s cript file that docum ents the area s of m emory th at the linker is free to use. Progr ams targete d to run o ut of exter nal FLAS H[...]

  • Página 31

     2001 Microchip T echnology Inc. DS39024B-page 25 Using the MPLAB ® C17 C Compiler DATABANK PROTECTED NAME=SFR4 START=0x410 END=0x417 DATABANK PROTECTED NAME=SFR5 START=0x510 END=0x517 DATABANK PROTECTED NAME=SFR6 START=0x610 END=0x617 DATABANK PROTECTED NAME=SSR7 START=0x710 END=0x717 // 3. SFRs shared (0x18 to 0x19) SHAREBANK PROTECTED NAME=S[...]

  • Página 32

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 26  2001 Microchip Technology Inc. 4.4 St artup Code File The startup c ode file i s used t o call the s tartup functi on (if en abled), ini tialize data routine (if enabled ), init ialize the stack, a nd then br anch to th e main function. This file would need to be a ssemble d a[...]

  • Página 33

     2001 Microchip T echnology Inc. DS39024B-page 27 Using the MPLAB ® C17 C Compiler movlw HIGH _start movwf PCLATH movlw LOW _start movwf PCL ;***********************************************************; _start_section CODE ;-----------------------------------------------------------; ; ;Beginning of startup code ; _start ;----------------------[...]

  • Página 34

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 28  2001 Microchip Technology Inc. 4.5 Interrupt Code File The inte rrupt code file is used to s etup the in terrupt vectors fo r the I NT pin, TMR0 Over flow , T0CKI pin, an d the Peri pheral I nterrupt ve ctor . Included with this co de is the context s ave and r estore routines[...]

  • Página 35

     2001 Microchip T echnology Inc. DS39024B-page 29 Using the MPLAB ® C17 C Compiler RES 1 ;ALUSTA RES 1 ;CPUSTA ;-- Bank 3 INTSAVE_SEC3 UDATA SAVEINT_START + 0x301 RES 1 ;WREG RES 1 ;ALUSTA RES 1 ;CPUSTA ;-----------------------------------------------------------; ;***********************************************************; VARIABLES UDATA_OVR[...]

  • Página 36

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 30  2001 Microchip Technology Inc. ; Branch to prolog movlw HIGH _T0CKI_prolog movwf PCLATH movlw LOW _T0CKI_prolog movwf PCL ;-----------------------------------------------------------; ;***********************************************************; _PIV_sec CODE H ’ 4020 ’ ;-[...]

  • Página 37

     2001 Microchip T echnology Inc. DS39024B-page 31 Using the MPLAB ® C17 C Compiler ;Save BSR and WREG movfp BSR, PCLATH clrf BSR, 1 movpf PCLATH, save_BSR ;Service the interrupt by calling the interrupt ;handling function goto _TMR0_2 _TMR0_1 BANKSEL fpTMR0 movfp fpTMR0+1, PCLATH movfp fpTMR0, PCL _TMR0_2 call _TMR0_1 ; push address of next ins[...]

  • Página 38

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 32  2001 Microchip Technology Inc. ;-----------------------------------------------------------; _PIV_prolog ;Save BSR and WREG movfp BSR, PCLATH clrf BSR, 1 movpf PCLATH, save_BSR ;Service the interrupt by calling the interrupt ;handling function goto _PIV_2 _PIV_1 BANKSEL fpPIV [...]

  • Página 39

     2001 Microchip T echnology Inc. DS39024B-page 33 Using the MPLAB ® C17 C Compiler 4.6 Other Files One addi tional fi le requir ed to comp ile prog rams for th e PICDEM 1 7 demonstr ation boa rd is th e associat ed proce ssor ob ject mod ule. For the PIC17C7 56A microc ontroll er this file woul d be P17C756.A SM. This fil e would need to be ass[...]

  • Página 40

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 34  2001 Microchip Technology Inc. NOTES:[...]

  • Página 41

     2001 Microchip T echnology Inc. DS39024B-page 35 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 5. LCD.C Description 5.1 Introd uc tion This chapter des cribes t he demo nstratio n program f or the PIC17C756A , LCD.C . This prog ram take s an inc rementin g coun t and dis plays i t on an exter nal LCD panel u sing the inte rface[...]

  • Página 42

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 36  2001 Microchip Technology Inc. 5.3 PICm icro ® C Librarie s The files in LCD.P JT use th e followin g libra y functio n(s) con tained PMC75 6L.LIB: Delay10TCY( ) Delay1KTCYx( ) 5.4 Source Code Descriptions DEMO756L.LKR This file is the link er script f ile for t he project. P[...]

  • Página 43

     2001 Microchip T echnology Inc. DS39024B-page 37 LCD.C Description 5.5 LCD.C Sourc e Code Listi ng //**************************************************** //* LCD.C //**************************************************** //* Rodger Richey //* Principal Applications Engineer //* Microchip Technology Incorporated //*********************************[...]

  • Página 44

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 38  2001 Microchip Technology Inc. // Print the Hello message to the first line putrsXLCD(Hello); // Wait for the LCD to finish last command while(BusyXLCD()); // Set the cursor to the start of the 2nd line SetDDRamAddr(0x28); // Print the World message to the 2nd line putrsXLCD(W[...]

  • Página 45

     2001 Microchip T echnology Inc. DS39024B-page 39 LCD.C Description 5.6 XLCD.H Source Code Listing #pragma nolist /***************************************************************** * PICmicro C Libraries V2.10 * Written and Tested using MPLABC V2.10 ****************************************************************** * Filename: xlcd.h * Date: 14 [...]

  • Página 46

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 40  2001 Microchip Technology Inc. #define RS_PIN PORTFbits.RF7 // Port for RS #define TRIS_RS DDRFbits.RF7 // TRIS for RS #define E_PIN PORTGbits.RG1 // PORT for E #define TRIS_E DDRGbits.RG1 // TRIS for E // Display ON/OFF Control defines #define DON 0b00001111 // Display on #de[...]

  • Página 47

     2001 Microchip T echnology Inc. DS39024B-page 41 LCD.C Description // to the LCD void putrsXLCD(static const rom char *); // Writes a string of characters // in ROM to the LCD // User defines these routines according to the oscillator frequency extern far void DelayFor18TCY(void); extern far void DelayPORXLCD(void); extern far void DelayXLCD(vo[...]

  • Página 48

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 42  2001 Microchip Technology Inc. 5.7 XLCD.C Source Code Listing #include <p17cxx.h> #include “ xlcd.h ” / ******************************************************************* * * PICmicro C Libraries V2.10 * Written and Tested using MPLABC V2.10 ************************[...]

  • Página 49

     2001 Microchip T echnology Inc. DS39024B-page 43 LCD.C Description while(*buffer) // Write data to LCD up to null { while(BusyXLCD()); // Wait while LCD is busy WriteDataXLCD(*buffer); // Write character to LCD buffer++; // Increment buffer } return; } / ******************************************************************* * * Function Name: putr[...]

  • Página 50

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 44  2001 Microchip Technology Inc. { // The data bits must be either a 8-bit port or the upper or // lower 4-bits of a port. These pins are made into inputs #ifdef BIT8 // 8-bit mode, use whole port DATA_PORT = 0; TRIS_DATA_PORT = 0xff; #else // 4-bit mode #ifdef UPPER // Upper 4-[...]

  • Página 51

     2001 Microchip T echnology Inc. DS39024B-page 45 LCD.C Description // Setup interface to LCD #ifdef BIT8 // 8-bit interface DATA_PORT = 0b00110000; // Function set cmd(8-bit interface) #else // 4-bit interface #ifdef UPPER // Upper nibble interface DATA_PORT &= 0x0f; // Function set cmd(4-bit interface) DATA_PORT |= 0b00110000; #else // Low[...]

  • Página 52

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 46  2001 Microchip Technology Inc. E_PIN = 1; // Clock cmd in DelayFor18TCY(); E_PIN = 0; #endif #ifdef BIT8 // 8-bit interface TRIS_DATA_PORT = 0xff;// Make data port input #else // 4-bit interface #ifdef UPPER // Upper nibble interface TRIS_DATA_PORT |= 0xf0; // Make data nibble[...]

  • Página 53

     2001 Microchip T echnology Inc. DS39024B-page 47 LCD.C Description { while(BusyXLCD()); #ifdef BIT8 // 8-bit interface TRIS_DATA_PORT = 0; // Data port output DATA_PORT = cmd; // Write command to data port RW_PIN = 0; // Set the control signals RS_PIN = 0; // for sending a com- mand DelayFor18TCY(); E_PIN = 1; // Clock the command in DelayFor18[...]

  • Página 54

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 48  2001 Microchip Technology Inc. / ******************************************************************* * * Function Name: SetCGRamAddr * Return Value: void * Parameters: CGaddr: character generator ram address * Description: This routine sets the character generator * address of[...]

  • Página 55

     2001 Microchip T echnology Inc. DS39024B-page 49 LCD.C Description #else // Lower nibble interface DATA_PORT &= 0xf0; // Write lower nib- ble DATA_PORT |= (CGaddr&0x0f); #endif DelayFor18TCY(); E_PIN = 1; // Clock cmd and address in DelayFor18TCY(); E_PIN = 0; #ifdef UPPER // Upper nibble interface TRIS_DATA_PORT |= 0xf0; // Make inputs[...]

  • Página 56

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 50  2001 Microchip Technology Inc. #else // Lower nibble interface TRIS_DATA_PORT &= 0xf0; // Make port output DATA_PORT &= 0xf0; // and write upper nibble DATA_PORT |= (((DDaddr | 0b10000000)>>4) & 0x0f); #endif RW_PIN = 0; // Set control bits RS_PIN = 0; DelayF[...]

  • Página 57

     2001 Microchip T echnology Inc. DS39024B-page 51 LCD.C Description DelayFor18TCY(); #ifdef BIT8 // 8-bit interface if(DATA_PORT.7) // Read bit 7 (busy bit) { // If high E_PIN = 0; // Reset clock line RW_PIN = 0; // Reset control line return 1; // Return TRUE } else // Bit 7 low { E_PIN = 0; // Reset clock line RW_PIN = 0; // Reset control line [...]

  • Página 58

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 52  2001 Microchip Technology Inc. * must check to see if the LCD controller is * busy before calling this routine. The address * is read from the character generator RAM or * the display data RAM depending on what the * previous SetxxRamAddr routine was called. ******************[...]

  • Página 59

     2001 Microchip T echnology Inc. DS39024B-page 53 LCD.C Description / ******************************************************************* * * Function Name: ReadDataXLCD * Return Value: char: data byte from LCD controller * Parameters: void * Description: This routine reads a data byte from the * Hitachi HD44780 LCD controller. The user * must c[...]

  • Página 60

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 54  2001 Microchip Technology Inc. #else // Lower nibble interface data |= DATA_PORT&0x0f; // Read the lower nibble of data #endif E_PIN = 0; RS_PIN = 0; // Reset the control bits RW_PIN = 0; #endif return(data); // Return the data byte } / ************************************[...]

  • Página 61

     2001 Microchip T echnology Inc. DS39024B-page 55 LCD.C Description DelayFor18TCY(); E_PIN = 1; // Clock nibble into LCD DelayFor18TCY(); E_PIN = 0; #ifdef UPPER // Upper nibble interface DATA_PORT &= 0x0f; DATA_PORT |= ((data<<4)&0xf0); #else // Lower nibble interface DATA_PORT &= 0xf0; DATA_PORT |= (data&0x0f); #endif Del[...]

  • Página 62

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 56  2001 Microchip Technology Inc. NOTES:[...]

  • Página 63

     2001 Microchip T echnology Inc. DS39024B-page 57 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 6. USART.C Description 6.1 Introd uc tion This chapter des cribes t he demo nstratio n program f or the PIC17C756A , USART.C . This prog ram take s an i ncremen ting coun t and di spla ys it on the Monitor program using USART2 and ha [...]

  • Página 64

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 58  2001 Microchip Technology Inc. 6.4 PICmic ro C Libra ries The file s in USA RT .PJT us e the follo wing l ibrary fun ction(s) contained PMC75 6L.LIB: Delay10KTCYx( ) BusyUSART2( ) putcUSART2( ) OpenUSART2( ) ubtoa( ) 6.5 Source Code Descriptions DEMO756L.LKR This file is the l[...]

  • Página 65

     2001 Microchip T echnology Inc. DS39024B-page 59 USART.C Description 6.6 USART.C Source Code Listing //**************************************************** //* USART.C //**************************************************** //* Rodger Richey //* Principal Applications Engineer //* Microchip Technology Incorporated //*****************************[...]

  • Página 66

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 60  2001 Microchip Technology Inc. OpenUSART2(USART_TX_INT_OFF&USART_RX_INT_OFF&USART_ASYNCH_MODE& USART_EIGHT_BIT&USART_CONT_RX,25); // Send a carriage return and linefeed PutsUSART2(crlf); // Initialize the count variable i = 0; while(1) { // Convert the count va[...]

  • Página 67

     2001 Microchip T echnology Inc. DS39024B-page 61 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 7. ANALOG.C Description 7.1 Introd uc tion This chapter des cribes t he demo nstratio n program f or the PIC17C756A , ANALOG.C . This prog ram con tinuous ly conve rts on chann el 0 (whi ch is connec ted to a precisi on 4.096 V voltag[...]

  • Página 68

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 62  2001 Microchip Technology Inc. 7.2 PICmic ro C Libra ries The fil es in ANA LOG .PJT us e the f ollowing library f unction( s) con tained in PMC75 6L.LIB: Delay10KTCYx( ) BusyUSART2( ) putcUSART2( ) OpenUSART2( ) OpenADC( ) ConvertADC( ) BusyADC( ) ReadADC( ) uitoa( ) 7.3 Sour[...]

  • Página 69

     2001 Microchip T echnology Inc. DS39024B-page 63 ANALOG.C Description 7.4 ANALOG.C Source Code Li sting //**************************************************** //* ANALOG.C //**************************************************** //* Rodger Richey //* Principal Applications Engineer //* Microchip Technology Incorporated //*************************[...]

  • Página 70

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 64  2001 Microchip Technology Inc. OpenUSART2(USART_TX_INT_OFF&USART_RX_INT_OFF&USART_ASYNCH_MODE& USART_EIGHT_BIT&USART_CONT_RX,25); // Initialize the A/D OpenADC(ADC_INT_OFF&ADC_FOSC_32&ADC_RIGHT_JUST&ADC_VREF_INT& ADC_4ANA_8DIG,ADC_CH0); // Print[...]

  • Página 71

     2001 Microchip T echnology Inc. DS39024B-page 65 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 8. SWITCH.C Description 8.1 Introd uc tion This chapter des cribes t he demo nstratio n program f or the PIC17C756A , SWITCH.C . This prog ram first turns on all the me mory mappe d LEDs. W hen the cor respondin g pus hbutton swi tch [...]

  • Página 72

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 66  2001 Microchip Technology Inc. 8.4 PICmic ro C Libra ries The files in SW ITCH.PJT us e the follo wing l ibrary fun ction(s) contained in PMC75 6L.LIB: Delay1KTCYx( ) 8.5 Source Code Descriptions DEMO756L.LKR This file is the link er script f ile for t he project. P17C756.O li[...]

  • Página 73

     2001 Microchip T echnology Inc. DS39024B-page 67 SWITCH.C Description 8.6 SWITCH.C Source Code Li sting //**************************************************** //* SWITCH.C //**************************************************** //* Rodger Richey //* Principal Applications Engineer //* Microchip Technology Incorporated //*************************[...]

  • Página 74

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 68  2001 Microchip Technology Inc. else // OR in desired LED LEDbuf |= Temp; // Write new value to LEDs *LEDptr = LEDbuf; } // Update switch state buffer SWTbuf = TEMPbuf; // Wait for ~16ms Delay1KTCYx(64); } }[...]

  • Página 75

     2001 Microchip T echnology Inc. DS39024B-page 69 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Chapter 9. I2C.C Description 9.1 Introd uc tion This chapter des cribes t he demo nstratio n program f or the PIC17C756A , I2C.C . This prog ram take s an inc rementin g count an d writes it to th e 24LC01 B Serial EEPROM and dis plays th e a[...]

  • Página 76

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 70  2001 Microchip Technology Inc. 9.4 PICmic ro C Libra ries The files in I2C.P JT use th e followin g libra ry funct ion(s) containe d in PMC75 6L.LIB: Delay1KTCYx( ) 9.5 Source Code Descriptions DEMO756L.LKR This file is the link er script f ile for t he project. P17C756.O This[...]

  • Página 77

     2001 Microchip T echnology Inc. DS39024B-page 71 I 2 C.C Description 9.6 I2C.C Sourc e Code Listi ng //**************************************************** //* I2C.C //**************************************************** //* Rodger Richey //* Principal Applications Engineer //* Microchip Technology Incorporated //*******************************[...]

  • Página 78

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 72  2001 Microchip Technology Inc. putcUSART2(data); // Print charac- ter to USART2 return; } void main(void) { rom int *LEDptr; unsigned char addr; unsigned char byte; char str[5]; char crlf[3]; // Initialize the carriage return/linefeed string crlf[0] = 0x0d; crlf[1] = 0x0a; crl[...]

  • Página 79

     2001 Microchip T echnology Inc. DS39024B-page 73 I 2 C.C Description PutsUSART2(crlf); // Print a CRLF to USART2 addr++; // Increment the address if(addr > 127) // If > 127 addr = 0; // reset to 0 Delay10KTCYx(250); // Wait a while } }[...]

  • Página 80

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 74  2001 Microchip Technology Inc. NOTES:[...]

  • Página 81

     2001 Microchip Technology Inc. DS39024B-page 75 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Appe nd ix A . PICDEM 1 7 Dem onstra t ion Board S ch ematics Figure A.1 PICDEM 17 Demonstration Board Part s Layout[...]

  • Página 82

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 76  2001 Microchip Technology Inc. A.1 SCHEMATIC 1[...]

  • Página 83

     2001 Microchip Technology Inc. DS39024B-page 77 PICDEM 17 Demonstr ation Board Schematics A.2 SCHEMATIC 2[...]

  • Página 84

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 78  2001 Microchip Technology Inc. A.3 SCHEMATIC 3[...]

  • Página 85

     2001 Microchip Technology Inc. DS39024B-page 79 PICDEM 17 Demonstr ation Board Schematics A.4 SCHEMATIC 4[...]

  • Página 86

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 80  2001 Microchip Technology Inc. NOTES:[...]

  • Página 87

     2001 Microchip Technology Inc. DS39024B-page 81 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Appendix B. RS-232 Communication Pr otocol B.1 INTRODUCTION This appendix descr ibes the protocol between the PIC17C7 56A microc ontrol le r and the Host PC. B.2 OVERVIEW The P ICDEM 17 Mo nitor pr ogram an d associat ed firmwa re in the PIC17[...]

  • Página 88

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 82  2001 Microchip Technology Inc. For Dat a Memory operations: • b is the bank number • xx is the data memor y address • dd is the 8-bit da ta value For Pro gram Memo ry operati ons: • yyyy is the 16-bi t addres s • dddd is the 16-bi t data[...]

  • Página 89

     2001 Microchip Technology Inc. DS39024B-page 83 PICDEM ™ 17 DEMONSTR ATION BOARD USER ’ S GUIDE 12 Appendix C. Floppy Disk Contents C.1 INTRODUCTION This appendix p rovides a list ing and de scription of all fil es inclu ded on the 3.5 ” floppy disk. C.2 CON TENT S The fl oppy d isk in cludes t he foll owing fil es: • PICDEM 17 PIC17C7 [...]

  • Página 90

    PICDEM ™ 17 Demonstration Board User ’ s Gu ide DS39024B-page 84  2001 Microchip Technology Inc. NOTES:[...]

  • Página 91

     2001 Microchip Technology Inc. DS39024B-page 85 Floppy Disk Contents NOTES:[...]

  • Página 92

    Information c ontained in this publica tion regarding dev ice applicat ions and the like is i ntended through suggestion only and ma y be supers eded by update s. It i s your respo nsibilit y to en sure t hat you r app licatio n mee ts with y our sp ecifica tions. N o re presen tation or warra nt y is given and n o liability is assumed by M icroc h[...]