PICDEM™ 17 Demonstration Board User’s Guide
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-bits of
the port
DATA_PORT &= 0x0f;
TRIS_DATA_PORT |= 0xf0;
#else
// Lower 4-bits of
the port
DATA_PORT &= 0xf0;
TRIS_DATA_PORT |= 0x0f;
#endif
#endif
TRIS_RW = 0;
// All control sig-
nals made outputs
TRIS_RS = 0;
TRIS_E = 0;
RW_PIN = 0;
// R/W pin made low
RS_PIN = 0;
// Register select
pin made low
E_PIN = 0;
// Clock pin made low
// Delay for 15ms to allow for LCD Power on reset
DelayPORXLCD();
// Setup interface to LCD
#ifdef BIT8
// 8-bit mode inter-
face
TRIS_DATA_PORT = 0;
// Data port output
DATA_PORT = 0b00110000;
// Function set
cmd(8-bit interface)
#else
// 4-bit mode inter-
face
#ifdef UPPER
// Upper nibble
interface
TRIS_DATA_PORT &= 0x0f;
DATA_PORT &= 0x0f;
DATA_PORT |= 0b00110000;
// Function set
cmd(4-bit interface)
#else
// Lower nibble
interface
TRIS_DATA_PORT &= 0xf0;
DATA_PORT &= 0xf0;
DATA_PORT |= 0b00000011;
// Function set
cmd(4-bit interface)
#endif
#endif
E_PIN = 1;
// Clock the cmd in
DelayFor18TCY();
E_PIN = 0;
// Delay for at least 4.1ms
DelayXLCD();
Содержание Picdem 17
Страница 1: ...PICDEM 17 DEMONSTRATION BOARD USER S GUIDE 2001 Microchip Technology Inc DS39024B ...
Страница 19: ... 2001 Microchip Technology Inc DS39024B page 13 Using the PICDEM 17 Monitor Figure 2 5 Running Diagnostics ...
Страница 24: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 18 2001 Microchip Technology Inc NOTES ...
Страница 28: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 22 2001 Microchip Technology Inc NOTES ...
Страница 40: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 34 2001 Microchip Technology Inc NOTES ...
Страница 62: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 56 2001 Microchip Technology Inc NOTES ...
Страница 80: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 74 2001 Microchip Technology Inc NOTES ...
Страница 82: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 76 2001 Microchip Technology Inc A 1 SCHEMATIC 1 ...
Страница 83: ... 2001 Microchip Technology Inc DS39024B page 77 PICDEM 17 Demonstration Board Schematics A 2 SCHEMATIC 2 ...
Страница 84: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 78 2001 Microchip Technology Inc A 3 SCHEMATIC 3 ...
Страница 85: ... 2001 Microchip Technology Inc DS39024B page 79 PICDEM 17 Demonstration Board Schematics A 4 SCHEMATIC 4 ...
Страница 86: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 80 2001 Microchip Technology Inc NOTES ...
Страница 90: ...PICDEM 17 Demonstration Board User s Guide DS39024B page 84 2001 Microchip Technology Inc NOTES ...
Страница 91: ... 2001 Microchip Technology Inc DS39024B page 85 Floppy Disk Contents NOTES ...