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

Go to page of

A good user manual

The rules should oblige the seller to give the purchaser an operating instrucion of Arizona 17, along with an item. The lack of an instruction or false information given to customer shall constitute grounds to apply for a complaint because of nonconformity of goods with the contract. In accordance with the law, a customer can receive an instruction in non-paper form; lately graphic and electronic forms of the manuals, as well as instructional videos have been majorly used. A necessary precondition for this is the unmistakable, legible character of an instruction.

What is an instruction?

The term originates from the Latin word „instructio”, which means organizing. Therefore, in an instruction of Arizona 17 one could find a process description. An instruction's purpose is to teach, to ease the start-up and an item's use or performance of certain activities. An instruction is a compilation of information about an item/a service, it is a clue.

Unfortunately, only a few customers devote their time to read an instruction of Arizona 17. A good user manual introduces us to a number of additional functionalities of the purchased item, and also helps us to avoid the formation of most of the defects.

What should a perfect user manual contain?

First and foremost, an user manual of Arizona 17 should contain:
- informations concerning technical data of Arizona 17
- name of the manufacturer and a year of construction of the Arizona 17 item
- rules of operation, control and maintenance of the Arizona 17 item
- safety signs and mark certificates which confirm compatibility with appropriate standards

Why don't we read the manuals?

Usually it results from the lack of time and certainty about functionalities of purchased items. Unfortunately, networking and start-up of Arizona 17 alone are not enough. An instruction contains a number of clues concerning respective functionalities, safety rules, maintenance methods (what means should be used), eventual defects of Arizona 17, and methods of problem resolution. Eventually, when one still can't find the answer to his problems, he will be directed to the Arizona service. Lately animated manuals and instructional videos are quite popular among customers. These kinds of user manuals are effective; they assure that a customer will familiarize himself with the whole material, and won't skip complicated, technical information of Arizona 17.

Why one should read the manuals?

It is mostly in the manuals where we will find the details concerning construction and possibility of the Arizona 17 item, and its use of respective accessory, as well as information concerning all the functions and facilities.

After a successful purchase of an item one should find a moment and get to know with every part of an instruction. Currently the manuals are carefully prearranged and translated, so they could be fully understood by its users. The manuals will serve as an informational aid.

Table of contents for the manual

  • Page 1

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

  • Page 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[...]

  • Page 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[...]

  • Page 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 .[...]

  • Page 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 .................. ..... .... ..... ..........[...]

  • Page 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 ........ .............. .............. .............. .......... .........[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 [...]

  • Page 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[...]

  • Page 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[...]

  • Page 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: •[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 [...]

  • Page 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[...]

  • Page 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[...]

  • Page 19

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

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 24

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

  • Page 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[...]

  • Page 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[...]

  • Page 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.[...]

  • Page 28

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

  • Page 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, [...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 ;----------------------[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 ’ ;-[...]

  • Page 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[...]

  • Page 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 [...]

  • Page 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[...]

  • Page 40

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

  • Page 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[...]

  • Page 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[...]

  • Page 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 //*********************************[...]

  • Page 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[...]

  • Page 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 [...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 ************************[...]

  • Page 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[...]

  • Page 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-[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 [...]

  • Page 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. ******************[...]

  • Page 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[...]

  • Page 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 } / ************************************[...]

  • Page 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[...]

  • Page 62

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

  • Page 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 [...]

  • Page 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[...]

  • Page 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 //*****************************[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 //*************************[...]

  • Page 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[...]

  • Page 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 [...]

  • Page 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[...]

  • Page 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 //*************************[...]

  • Page 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); } }[...]

  • Page 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[...]

  • Page 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[...]

  • Page 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 //*******************************[...]

  • Page 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[...]

  • Page 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 } }[...]

  • Page 80

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

  • Page 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[...]

  • Page 82

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

  • Page 83

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

  • Page 84

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

  • Page 85

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

  • Page 86

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

  • Page 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[...]

  • Page 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[...]

  • Page 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 [...]

  • Page 90

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

  • Page 91

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

  • Page 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[...]